1 package System::Introspector::Gatherer;
4 use Object::Remote::Future;
5 use System::Introspector::Gatherer::Bridge;
6 use Module::Runtime qw( use_module );
9 my ($self, $class, $args) = @_;
10 return use_module("System::Introspector::Probe::$class")
16 my ($class, $remote) = @_;
17 return $class->new::on($remote);
21 my ($class, $bridge, $remote) = @_;
22 return System::Introspector::Gatherer::Bridge->new::on($bridge,
23 remote_spec => $remote,
24 remote_class => $class,
29 my ($class, %arg) = @_;
30 my ($user, $host, $sudo_user) = @arg{qw( user host sudo_user )};
31 my $sudo = defined($sudo_user) ? sprintf('%s@', $sudo_user) : undef;
33 my $remote = join '@', grep defined, $user, $host;
34 if (defined $sudo_user) {
35 return $class->_new_bridged($remote, $sudo);
38 return $class->_new_direct($remote);
42 if (defined $sudo_user) {
43 return $class->_new_direct($sudo);