@AlfrescoPublicApi public abstract class AbstractModuleComponent extends Object implements ModuleComponent, org.springframework.beans.factory.BeanNameAware
ModuleComponent
to provide
the basic necessities.executeInternal()
Modifier and Type | Field and Description |
---|---|
protected AuthenticationComponent |
authenticationComponent |
protected ModuleService |
moduleService |
protected ServiceRegistry |
serviceRegistry |
Constructor and Description |
---|
AbstractModuleComponent() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkProperties()
Checks for the presence of all generally-required properties.
|
boolean |
equals(Object obj) |
void |
execute()
Perform the actual component's work.
|
protected abstract void |
executeInternal()
The method that performs the actual work.
|
ModuleVersionNumber |
getAppliesFromVersionNumber() |
ModuleVersionNumber |
getAppliesToVersionNumber() |
List<ModuleComponent> |
getDependsOn()
A list of module components that must be executed prior to this instance.
|
String |
getDescription() |
String |
getModuleId() |
String |
getName() |
ModuleVersionNumber |
getSinceVersionNumber() |
int |
hashCode() |
void |
init() |
boolean |
isExecuteOnceOnly() |
void |
setAppliesFromVersion(String version)
Set the minimum module version number to which this component applies.
|
void |
setAppliesToVersion(String version)
Set the minimum module version number to which this component applies.
|
void |
setAuthenticationComponent(AuthenticationComponent authenticationComponent) |
void |
setBeanName(String name)
Convenience method that will set the name of the component to
match the bean name, unless the
name has
been explicitly set. |
void |
setDependsOn(List<ModuleComponent> dependsOn) |
void |
setDescription(String description)
Set the component's description.
|
void |
setExecuteOnceOnly(boolean executeOnceOnly) |
void |
setModuleId(String moduleId) |
void |
setModuleService(ModuleService moduleService)
Set the module service to register with.
|
void |
setName(String name)
Set the component name, which must be unique within the context of the
module.
|
void |
setServiceRegistry(ServiceRegistry serviceRegistry) |
void |
setSinceVersion(String version)
Set the version number for which this component was added.
|
void |
setTenantAdminService(TenantAdminService tenantAdminService) |
void |
shutdown()
Perform any cleanup required to remove module.
|
String |
toString() |
protected ServiceRegistry serviceRegistry
protected AuthenticationComponent authenticationComponent
protected ModuleService moduleService
protected void checkProperties()
public String toString()
toString
in class Object
getModuleId()
,
getName()
public void setAuthenticationComponent(AuthenticationComponent authenticationComponent)
public void setModuleService(ModuleService moduleService)
moduleService
- the service to register against. This is optional.public void setServiceRegistry(ServiceRegistry serviceRegistry)
public void setTenantAdminService(TenantAdminService tenantAdminService)
public String getModuleId()
getModuleId
in interface ModuleComponent
public void setModuleId(String moduleId)
moduleId
- the globally unique module name.public String getName()
getName
in interface ModuleComponent
public void setName(String name)
name
- the name of the component within the module.setBeanName(String)
public void setBeanName(String name)
name
has
been explicitly set.setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public String getDescription()
getDescription
in interface ModuleComponent
public void setDescription(String description)
description
- a description of the component.public ModuleVersionNumber getSinceVersionNumber()
getSinceVersionNumber
in interface ModuleComponent
public void setSinceVersion(String version)
public ModuleVersionNumber getAppliesFromVersionNumber()
getAppliesFromVersionNumber
in interface ModuleComponent
public void setAppliesFromVersion(String version)
public ModuleVersionNumber getAppliesToVersionNumber()
getAppliesToVersionNumber
in interface ModuleComponent
public void setAppliesToVersion(String version)
public List<ModuleComponent> getDependsOn()
getDependsOn
in interface ModuleComponent
public void setDependsOn(List<ModuleComponent> dependsOn)
dependsOn
- a list of modules that must be executed before this onepublic boolean isExecuteOnceOnly()
isExecuteOnceOnly
in interface ModuleComponent
public void setExecuteOnceOnly(boolean executeOnceOnly)
executeOnceOnly
- true to force execution of this component with
each startup or false if it must only be executed once.public void init()
protected abstract void executeInternal() throws Throwable
Throwable
- any problems, just throw thempublic final void execute()
execute
in interface ModuleComponent
the abstract method to be implemented by subclasses
public final void shutdown()
ModuleComponent
shutdown
in interface ModuleComponent
Copyright © 2005–2017 Alfresco Software. All rights reserved.