org.eclipse.wst.server.core
Interface IModule


public interface IModule

A module is a unit of "content" that can be published to a server.

All modules have a module type, which is fixed for the lifetime of the module. The set of module types (or "kinds") is open-ended.

All modules are created by module factories using the moduleFactories extension point.

The content of a module is a collection of file and folder resources in the workspace.

In principle, a module exists independent of any particular server. The same module instance can be associated with multiple server instances at the same time. That is why you cannot ask the module which server it's associated with.

[issue: Equality/identify for modules?]

Concrete module types are represented by concrete classes implementing this interface. The only legitimate reason to declare a subclass is to implement a module factory.

Caveat: The server core API is still in an early form, and is likely to change significantly before the initial release.

Since:
1.0

Method Summary
 java.lang.Object getAdapter(java.lang.Class adapter)
          Returns an object which is an instance of the given class associated with this object.
 java.lang.String getId()
          Returns the id of this module.
 IModuleType getModuleType()
          Returns the type of this module.
 java.lang.String getName()
          Returns the displayable name for this module.
 IProject getProject()
          Returns the workbench project that this module is contained in, or null if the module is outside of the workspace.
 java.lang.Object loadAdapter(java.lang.Class adapter, IProgressMonitor monitor)
          Returns an object which is an instance of the given class associated with this object.
 

Method Detail

getId

public java.lang.String getId()
Returns the id of this module. Each module has a distinct id, used to distinguish this module from all other modules in the workspace (and within a server). Ids are intended to be used internally as keys; they are not intended to be shown to end users.

Returns:
the module id

getName

public java.lang.String getName()
Returns the displayable name for this module.

Note that this name is appropriate for the current locale.

Returns:
a displayable name for this module

getModuleType

public IModuleType getModuleType()
Returns the type of this module.

Returns:
the module type

getProject

public IProject getProject()
Returns the workbench project that this module is contained in, or null if the module is outside of the workspace.

Returns:
a project

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

This method will not check the delegate class for adapting unless it is already loaded. No plugin loading will occur when calling this method.

Parameters:
adapter - the adapter class to look up
Returns:
a object castable to the given class, or null if this object does not have an adapter for the given class
See Also:
IAdaptable#getAdapter(Class)

loadAdapter

public java.lang.Object loadAdapter(java.lang.Class adapter,
                                    IProgressMonitor monitor)
Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

This method will force a load of the delegate class and check it for adapting.

Parameters:
adapter - the adapter class to look up
monitor - a progress monitor, or null if progress reporting and cancellation are not desired
Returns:
a object castable to the given class, or null if this object does not have an adapter for the given class