org.eclipse.wst.server.core.model
Class ModuleFactoryDelegate

java.lang.Object
  extended byorg.eclipse.wst.server.core.model.ModuleFactoryDelegate
Direct Known Subclasses:
ProjectModuleFactoryDelegate

public abstract class ModuleFactoryDelegate
extends java.lang.Object

A module factory delegate provides a mechanism for discovering modules. A module factory delegate is specified by the class attribute of a moduleFactories extension.

When the module factory needs to be given a delegate, the delegate class specified for the module factory is instantiated with a 0-argument constructor.

Module factory delegates may keep state in instance fields, but that state is transient and will not be persisted across workbench sessions.

This abstract class is intended to be extended only by clients to extend the moduleFactories extension point.

Since:
1.0
See Also:
IModule, ModuleDelegate

Constructor Summary
ModuleFactoryDelegate()
          Delegates must have a public 0-arg constructor.
 
Method Summary
 void clearModuleCache()
          Clears the cache of modules returned by getModules().
abstract  ModuleDelegate getModuleDelegate(IModule module)
          Creates the module delegate for a module with the given information.
abstract  IModule[] getModules()
          Return all modules created by this factory.
 void initialize()
          Initializes this module factory delegate.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleFactoryDelegate

public ModuleFactoryDelegate()
Delegates must have a public 0-arg constructor.

Method Detail

initialize

public void initialize()
Initializes this module factory delegate. This method gives delegates a chance to do their own initialization.

This method is called by the server core framework. Clients should never call this method.


clearModuleCache

public void clearModuleCache()
Clears the cache of modules returned by getModules(). Delegates can call this method if they know that the results of the last call to getModules() is invalid and should be refreshed.

See Also:
getModules()

getModuleDelegate

public abstract ModuleDelegate getModuleDelegate(IModule module)
Creates the module delegate for a module with the given information. This method is called when a client needs to access the module delegate associated with the given module.

Parameters:
module - a module
Returns:
the module delegate

getModules

public abstract IModule[] getModules()
Return all modules created by this factory.

This method is normally called by the web server core framework. Clients (other than the delegate) should never call this method.

A new array is returned on each call, so clients may store or modify the result.

Returns:
a possibly-empty array of modules IModule