Name

OO::Plugin::Registry - to register 'em all!

SYNOPSIS

Plugin::Registry.instance.plugin-names;     # list of all registered plugins

DESCRIPTION

This module provides process-wide registration functionality for keeping track of various objects related to OO::Plugin framework. Most of the needed functionality is provided via higher-level means by OO::Plugin and OO::Plugin::Manager modules and described in OO::Plugin::Manual.

EXPORTS

class Plugin::Registry

This class is a singleton and it provides the complete API of this module.

submethod instance

Returns the instance of this class.

method register-plugin

Creates a record mapping plugin FQN (fully qualified name) into its type.

method plugin-names

Returns all FQNs of registered plugins.

method plugin-types

Returns all types of registered plugins.

method plugin-type

plugin-type( Str:D $plugin-FQN )

Returns type for a given plugin FQN. Fails with X::OO::Plugin::NotFound exception if no such plugin found.

method plugin-meta

Registers or returns plugin's meta.

method pluggable-classes

Returns all classes registered as pluggable. Consider the OO::Plugin::Manual with regard to strict or loose modes of operation of the plugin manger class.

method is-pluggable

method type

type( Str:D $class-fqn )

Returns type object for a pluggable class FQN.

method short2fqn

Converts short name of a pluggable class or a plugin into its FQN. $what is either string 'classes' or 'plugins'. Returns the $name parameter if the name is not found.

method fqn2short

Converts FQN of a pluggable class or a plugin into its short name. $what is either string 'classes' or 'plugins'.

method fqn-class-name

Shortcut for short2fqn( 'classes', $name )

method fqn-plugin-name

Shortcut for short2fqn( 'plugins, $name )

method has-autogen-class

has-autogen-class( Str:D $class-fqn )

Returns True if $class-fqn is already in the registry of auto-generated classes. Helps in avoiding generation of duplicate class names.

method registry

Returns a deep copy of the registry Hash, excluding plugins and classes.

method plugs

Returns a deep copy of registered plugs. This branch of registry is currently contains only method handlers but other types of plugs might be invented in the future.

method methods

Returns a copy of registered method handlers Hash. It's keys are (by nesting level):

Leafs are handler methods.

method pluggables

Returns a copy of pluggables registry. Currently only contains methods key.

method extended classes

Returns a copy of the hash of all classes listed in for trait of plug-class declarations. The keys are:

The leafs are list of plug-class type objects.

method plug-classes

Returns a copy of the hash of all registered plug-classes. The keys are:

The leafs are hashes of two keys:

method inventory

Returns a copy of inventory hash. It currently only has one key: autogen-classs which is a set of framework-generated class names.

SEE ALSO

OO::Plugin::Manual, OO::Plugin OO::Plugin::Manager, OO::Plugin::Class

AUTHOR

Vadim Belman <vrurg@cpan.org>