|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.genuine.organizer.AbstractModule
This class is a default implementation of the Module
interface that does nothing by itself but provides convenience methods. It is intended
to be sub classed by module classes for which it implements common functionality.
Constructor Summary | |
AbstractModule()
|
Method Summary | |
VisualComponent |
createVisualComponent(java.lang.String componentId,
java.lang.String instanceId)
Default implementation does nothing. |
GenuineAction |
getAction(java.lang.String actionId)
Implementation of the Module's getAction method that returns GenuineAction instances that have been registered by calling registerAction(GenuineAction) . |
protected ComponentManager |
getComponentManager()
Convenience method that returns the component manager |
protected HelperService |
getHelperService()
Convenience method that returns the helper service |
java.lang.String |
getId()
Returns this module's id. |
protected MessageBus |
getMessageBus()
Convenience method that returns the message bus |
protected ModuleManager |
getModuleManager()
Convenience method that returns the module manager |
protected java.lang.String |
getProperty(java.lang.String propertyName)
Returns the value for a property that was passed to the initialize method. |
Service |
getService(java.lang.Class serviceType)
Implementation of the Module's getService method that returns Service instances that were registered by using the method
registerService(Class, Service) . |
protected ServiceBroker |
getServiceBroker()
Convenience method that returns the service broker. |
void |
initialize(java.lang.String moduleId,
ModuleManager moduleManager,
java.util.Map properties)
The references to the passed parameters are stored locally. |
void |
postInitialize()
Default implementation that does nothing. |
protected void |
registerAction(GenuineAction action)
Helper method for modules to register actions so that the module manager may retrieve them by calling getAction(String) . |
protected void |
registerService(java.lang.Class serviceInterface,
Service service)
Helper method for modules to register service instances so that the service broker may retrieve them by calling getService(Class) .
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractModule()
Method Detail |
public void initialize(java.lang.String moduleId, ModuleManager moduleManager, java.util.Map properties) throws ConfigurationException
initialize
in interface Module
moduleId
- The module's unique identifier that is defined in the
application's configuration file.moduleManager
- A reference to the ModuleManager
that
gives access to all services the Organizer provides to modules.properties
- A collection of properties that has been defined for this
module in the application's configuration file. For each key, there
is either an Object
value or a Set
of
Object
values, depending on the XML configuration
data. For each property
defined, there is a
Object
value, for each propertyset defined,
there is a Set
of Object
values.
If the value is an integer, the value instance is of type
Integer
, otherwise the value instance is of type
String
. A Set
instance is actually an
instance of LinkedHashSet
so that the order of values
is kept as in the configuration file if you iterate over them.
- Throws:
ConfigurationException
- Thrown by the module if a severe error
occurs during its initialization so that the module cannot
operate.
public java.lang.String getId()
getId
in interface Module
protected ModuleManager getModuleManager()
protected ServiceBroker getServiceBroker()
protected ComponentManager getComponentManager()
protected MessageBus getMessageBus()
protected HelperService getHelperService()
protected java.lang.String getProperty(java.lang.String propertyName)
propertyName
- The name of a property as defined in the configuration
data of the module.
protected void registerAction(GenuineAction action)
getAction(String)
.
action
- A fully initialized GenuineAction object whose identifier
must match an action reference in the XML configuration data.public GenuineAction getAction(java.lang.String actionId)
registerAction(GenuineAction)
.
getAction
in interface Module
actionId
- The identifier of an action as used in the XML configuration
data, for example for a menu item or a toolbar button.
public VisualComponent createVisualComponent(java.lang.String componentId, java.lang.String instanceId) throws ConfigurationException
createVisualComponent
in interface Module
componentId
- The id of the component as given in the XML configuration data
ConfigurationException
protected void registerService(java.lang.Class serviceInterface, Service service)
getService(Class)
.
Services have to be created and initialized upon the initialization of
the module.
serviceInterface
- The service interface that is implemented by the service objectservice
- The actual service instancepublic Service getService(java.lang.Class serviceType)
Service
instances that were registered by using the method
registerService(Class, Service)
.
getService
in interface Module
public void postInitialize()
postInitialize
in interface Module
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |