GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CLASS::COMPONENT::PLUGIN (3)

.ds Aq ’

NAME

Class::Component::Plugin - plugin base for pluggable component framework

CONTENTS

SYNOPSIS

Your plugins should succeed to Class::Component::Plugin by your name space, and use it.



    package MyClass::Plugin;
    use strict;
    use warnings;
    use base Class::Component::Plugin;
    1;



for instance, the init phase is rewritten.



    package MyClass::Plugin;
    use strict;
    use warnings;
    use base Class::Component::Plugin;
    __PACKAGE__->mk_accessors(qw/ base_config /);

    sub init {
        my($self, $c) = @_;
        $self->base_config($self->config);
        $self->config($self->config->{config});
    }
    1;


    package MyClass::Plugin::Hello;
    use strict;
    use warnings;
    use base MyClass::Plugin;
    sub hello :Method {
        my($self, $context, $args) = @_;
        hello
    }
    sub hello_hook :Hook(hello) {
        my($self, $context, $args) = @_;
        hook hello
    }



can use alias method name



    sub foo :Method(bar) {}

    $self->call(bar); # call foo method



default hook name is method name if undefined Hook name



    sub defaulthook :Hook {}

    $self->run_hook( defaulthook );



HOOK POINTS

init init phase your plugins
class_component_plugin_attribute_detect
class_component_plugin_attribute_detect_cache_enable 1 = using attribute detect cache 0 = not use cache
class_component_load_attribute_resolver attribute name space detector

ATTRIBUTES

Method register_method is automatically done.
Hook register_hook is automatically done.

AUTHOR

Kazuhiro Osawa <ko@yappo.ne.jp>

SEE ALSO

Class::Component

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CLASS::COMPONENT::PLUGIN (3) 2008-05-08

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.