net.sf.genuine.organizer
Interface ModuleManager

All Known Subinterfaces:
InternalModuleManager
All Known Implementing Classes:
DefaultModuleManager

public interface ModuleManager

The module manager both creates, initializes, and destroys module instances and it provides access to all Organizer services to the modules.

Author:
Tim Wellhausen

Method Summary
 GenuineAction getAction(java.lang.String identifier)
          Returns the GenuineAction instance with the given identifier if such an action has been registered by any module.
 ComponentManager getComponentManager()
          Returns a reference to the component manager instance.
 HelperService getHelperService()
          Returns a reference to the helper service instance.
 MessageBus getMessageBus()
          Returns a reference to the message bus instance.
 ServiceBroker getServiceBroker()
          Returns a reference to the service broker instance.
 

Method Detail

getComponentManager

public ComponentManager getComponentManager()
Returns a reference to the component manager instance.


getServiceBroker

public ServiceBroker getServiceBroker()
Returns a reference to the service broker instance.


getMessageBus

public MessageBus getMessageBus()
Returns a reference to the message bus instance.


getHelperService

public HelperService getHelperService()
Returns a reference to the helper service instance.


getAction

public GenuineAction getAction(java.lang.String identifier)
Returns the GenuineAction instance with the given identifier if such an action has been registered by any module. If there are multiple actions registered with the same name, any of these actions may be returned.

Use this method with care! It allows you to couple the implementations of modules that are otherwise decoupled. This method's main purpose is to make action objects that provide basic functionality available to all modules so that one action instance can be used by all modules.

For example, Genuine contains a default action module (DefaultActionModule) that registers actions for clipboard actions. If you would like to create a popup menu in your module that contains cut, copy, and paste actions, you can access the default actions:

GenuineAction copyAction = getModuleManager().getAction(DefaultResources.COPY);

You should never assume that an action is always retrievable. If a module is deactivate, its actions are removed from the client application. Therefore, always check the returned object.