org.alfresco.repo.module
Interface ModuleComponent

All Known Implementing Classes:
AbstractModuleComponent, ImporterModuleComponent, LoggerModuleComponent, ModuleComponentHelperTest.NoopModuleComponent

public interface ModuleComponent

Interface for classes that control the startup and shutdown behaviour of modules.

Note that the execution order of these components is on the basis of dependencies only. The version numbering determines only whether a component will be executed and doesn't imply any ordering.

Equals and Hashcode method must be implemented.

Since:
2.0

Method Summary
 void execute()
          Perform the actual component's work.
 org.alfresco.util.VersionNumber getAppliesFromVersionNumber()
           
 org.alfresco.util.VersionNumber getAppliesToVersionNumber()
           
 java.util.List getDependsOn()
          A list of module components that must be executed prior to this instance.
 java.lang.String getDescription()
           
 java.lang.String getModuleId()
           
 java.lang.String getName()
           
 org.alfresco.util.VersionNumber getSinceVersionNumber()
           
 boolean isExecuteOnceOnly()
           
 

Method Detail

getModuleId

java.lang.String getModuleId()
Returns:
Returns the globally unique module ID.

getName

java.lang.String getName()
Returns:
Returns the name of the component in the context of the module ID. It does not have to be globally unique.

getDescription

java.lang.String getDescription()
Returns:
Returns a description of the component.

getSinceVersionNumber

org.alfresco.util.VersionNumber getSinceVersionNumber()
Returns:
Returns the version number of the module for which this component was introduced.

getAppliesFromVersionNumber

org.alfresco.util.VersionNumber getAppliesFromVersionNumber()
Returns:
Returns the smallest version number of the module to which this component applies.

getAppliesToVersionNumber

org.alfresco.util.VersionNumber getAppliesToVersionNumber()
Returns:
Returns the largest version number of the module to which this component applies.

getDependsOn

java.util.List getDependsOn()
A list of module components that must be executed prior to this instance. This is the only way to guarantee ordered execution. The dependencies may include components from other modules, guaranteeing an early failure if a module is missing.

Returns:
Returns a list of components that must be executed prior to this component.

isExecuteOnceOnly

boolean isExecuteOnceOnly()
Returns:
Returns true if the component is to be successfully executed exactly once, or false if the component must be executed with each startup.

execute

void execute()
Perform the actual component's work. Execution will be done within the context of a system account with an enclosing transaction. Long-running processes should be spawned from the calling thread, if required.

All failures should just be thrown out as runtime exceptions and will be dealt with by the associated module infrastructure.



Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.