Package gofer :: Package agent :: Module plugin :: Class Plugin
[hide private]
[frames] | no frames]

Class Plugin

source code

object --+
         |
        Plugin

Represents a plugin.

Instance Methods [hide private]
 
__init__(self, name, descriptor, synonyms=[])
x.__init__(...) initializes x; see help(type(x)) for signature
source code
list
names(self)
Get all the names by which the plugin can be found.
source code
bool
enabled(self)
Get whether the plugin is enabled.
source code
str
getuuid(self)
Get the plugin's messaging UUID.
source code
str
geturl(self)
Get the broker URL
source code
Broker
getbroker(self)
Get the amqp broker for this plugin.
source code
 
getpool(self)
Get the plugin's thread pool.
source code
 
setuuid(self, uuid, save=False)
Set the plugin's UUID.
source code
 
seturl(self, url, save=False)
Set the plugin's URL.
source code
int
nthreads(self)
Get the number of theads in the plugin's pool.
source code
 
attach(self, uuid=None)
Attach (connect) to AMQP broker using the specified uuid.
source code
 
detach(self)
Detach (disconnect) from AMQP broker (if connected).
source code
PluginDescriptor
cfg(self)
Get the plugin descriptor.
source code
 
dispatch(self, request)
Dispatch (invoke) the specified RMI request.
source code
bool
provides(self, name)
Get whether a plugin provides the specified class.
source code
(class|function)
export(self, name)
Export an object defined in the plugin (module).
source code
 
__lock(self) source code
 
__unlock(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
Plugin
add(cls, plugin)
Add the plugin.
source code
 
delete(cls, plugin)
Delete the plugin.
source code
Plugin
find(cls, name)
Find a plugin by name or synonym.
source code
list
all(cls)
Get a unique list of loaded plugins.
source code
Class Variables [hide private]
dict plugins = {}
The dict of loaded plugins.
Instance Variables [hide private]
str descriptor
The plugin descriptor.
str name
The plugin name.
list synonyms
The plugin synonyms.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

add(cls, plugin)
Class Method

source code 

Add the plugin.

Parameters:
  • plugin (Plugin) - The plugin to add.
Returns: Plugin
The added plugin

delete(cls, plugin)
Class Method

source code 

Delete the plugin.

Parameters:
  • plugin (Plugin) - The plugin to delete.

find(cls, name)
Class Method

source code 

Find a plugin by name or synonym.

Parameters:
  • name (str) - A plugin name or synonym.
Returns: Plugin
The plugin when found.

all(cls)
Class Method

source code 

Get a unique list of loaded plugins.

Returns: list
A list of plugins

__init__(self, name, descriptor, synonyms=[])
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • name (str) - The plugin name.
  • descriptor (PluginDescriptor) - The plugin descriptor.
  • synonyms (list) - The plugin synonyms.
Overrides: object.__init__

names(self)

source code 

Get all the names by which the plugin can be found.

Returns: list
A list of name and synonyms.

enabled(self)

source code 

Get whether the plugin is enabled.

Returns: bool
True if enabled.

getuuid(self)

source code 

Get the plugin's messaging UUID.

Returns: str
The plugin's messaging UUID.

geturl(self)

source code 

Get the broker URL

Returns: str
The broker URL

getbroker(self)

source code 

Get the amqp broker for this plugin. Each plugin can connect to a different broker.

Returns: Broker
The broker if configured.

getpool(self)

source code 

Get the plugin's thread pool.

Returns:
ThreadPool.

setuuid(self, uuid, save=False)

source code 

Set the plugin's UUID.

Parameters:
  • uuid (str) - The new UUID.
  • save (bool) - Save to plugin descriptor.

seturl(self, url, save=False)

source code 

Set the plugin's URL.

Parameters:
  • url (str) - The new URL.
  • save (bool) - Save to plugin descriptor.

nthreads(self)

source code 

Get the number of theads in the plugin's pool.

Returns: int
number of theads.

attach(self, uuid=None)

source code 

Attach (connect) to AMQP broker using the specified uuid.

Parameters:
  • uuid (str) - The (optional) messaging UUID.

cfg(self)

source code 

Get the plugin descriptor.

Returns: PluginDescriptor
The plugin descriptor

dispatch(self, request)

source code 

Dispatch (invoke) the specified RMI request.

Parameters:
Returns:
The RMI returned.

provides(self, name)

source code 

Get whether a plugin provides the specified class.

Parameters:
  • name (str) - A class (or module) name.
Returns: bool
True if provides.

export(self, name)

source code 

Export an object defined in the plugin (module). The name must reference a class or function object.

Parameters:
  • name (str) - A name (class|function)
Returns: (class|function)
The named item.
Raises:
  • NameError - when not found