Agent-TCLI
view release on metacpan or search on metacpan
lib/Agent/TCLI/Transport/Base.pm view on Meta::CPAN
=cut
my @alias :Field
:Get('alias');
=item peers
An array of peers
B<set_peers> will only accept ARRAYREF type values.
=cut
my @peers :Field
:All('peers')
:Type('ARRAY');
# Holds our session data. Made weak per Merlyn
# http://poe.perl.org/?POE_Cookbook/Object_Methods.
# We also don't take session on init.
my @session :Field
:Arg('session')
:Get('session')
:Weak;
=item control_options
A hash of options to pass to a new control object. These are passed
straight through as is. See Agent::TCLI::Control for information
about the options.
B<control_options> will only accept HASHREF type values.
=cut
my @control_options :Field
:All('control_options')
:Type('HASHREF');
# Standard class utils are inherited
=item Arrays
Attributes that are typed as arrays also support the following mutators for
the lazy:
B<shift_>field<> - works the same as I<shift>, returing the shifted member.
B<unshift_>field<(list)> - works the same as I<unshift>.
B<pop_>field<> - works the same as I<pop>, returing the popped member.
B<push_>field<(list)> - works the same as I<push>.
B<depth_>field<> - returns the curent size of the array.
=cut
my %init_args :InitArgs = (
'alias' => {
'Default' => 'base',
'Field' => \@alias,
},
);
##u_ subs can't be private if used in %init_args
##named u_ to sort nicer in Eclipse
#sub u_is_text {
# return (
# validate_pos( @_, { type => Params::Validate::SCALAR | Params::Validate::SCALARREF } )
# )
#}
#sub u_is_num {
# return (
# Scalar::Utils->looks_like_number($_[0])
# )
#}
#sub u_is_int {
# my $arg = $_[0];
# return (Scalar::Util::looks_like_number($arg) &&
# (int($arg) == $arg));
# }
=back
=head2 METHODS
These methods may be used as is, or subclasses may use them as
starting point.
=over
=cut
sub _init :Init {
my ($self, $args) = @_;
}
=item _start
Get things rolling.
=cut
sub _start :Cumulative {
my ($kernel, $self, $session) =
@_[KERNEL, OBJECT, SESSION];
# are we up before OIO has finished initializing object?
if (!defined( $self->alias ))
{
$self->Verbose("_start: OIO not started delaying ",0);
$kernel->call('_start');
return;
}
# There is only one command object per TCLI
$kernel->alias_set($self->alias);
$self->Verbose("_start: Starting alias(".$self->alias.")",0);
} # End sub start
=item _stop
Mostly just a placeholder.
=cut
( run in 1.592 second using v1.01-cache-2.11-cpan-39bf76dae61 )