public abstract class AbstractModuleComponent extends java.lang.Object implements ModuleComponent, org.springframework.beans.factory.BeanNameAware
ModuleComponent
to provide
the basic necessities.AbstractModuleComponent.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(java.lang.Object obj) |
void |
execute()
Perform the actual component's work.
|
protected abstract void |
executeInternal()
The method that performs the actual 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() |
int |
hashCode() |
void |
init() |
boolean |
isExecuteOnceOnly() |
void |
setAppliesFromVersion(java.lang.String version)
Set the minimum module version number to which this component applies.
|
void |
setAppliesToVersion(java.lang.String version)
Set the minimum module version number to which this component applies.
|
void |
setAuthenticationComponent(AuthenticationComponent authenticationComponent) |
void |
setBeanName(java.lang.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(java.util.List dependsOn) |
void |
setDescription(java.lang.String description)
Set the component's description.
|
void |
setExecuteOnceOnly(boolean executeOnceOnly) |
void |
setModuleId(java.lang.String moduleId) |
void |
setModuleService(ModuleService moduleService)
Set the module service to register with.
|
void |
setName(java.lang.String name)
Set the component name, which must be unique within the context of the
module.
|
void |
setServiceRegistry(ServiceRegistry serviceRegistry) |
void |
setSinceVersion(java.lang.String version)
Set the version number for which this component was added.
|
void |
setTenantAdminService(TenantAdminService tenantAdminService) |
java.lang.String |
toString() |
protected ServiceRegistry serviceRegistry
protected AuthenticationComponent authenticationComponent
protected ModuleService moduleService
protected void checkProperties()
public java.lang.String toString()
toString
in class java.lang.Object
AbstractModuleComponent.getModuleId()
,
AbstractModuleComponent.getName()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
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 java.lang.String getModuleId()
getModuleId
in interface ModuleComponent
public void setModuleId(java.lang.String moduleId)
moduleId
- the globally unique module name.public java.lang.String getName()
getName
in interface ModuleComponent
public void setName(java.lang.String name)
name
- the name of the component within the module.AbstractModuleComponent.setBeanName(String)
public void setBeanName(java.lang.String name)
name
has
been explicitly set.setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public java.lang.String getDescription()
getDescription
in interface ModuleComponent
public void setDescription(java.lang.String description)
description
- a description of the component.public org.alfresco.util.VersionNumber getSinceVersionNumber()
getSinceVersionNumber
in interface ModuleComponent
public void setSinceVersion(java.lang.String version)
public org.alfresco.util.VersionNumber getAppliesFromVersionNumber()
getAppliesFromVersionNumber
in interface ModuleComponent
public void setAppliesFromVersion(java.lang.String version)
public org.alfresco.util.VersionNumber getAppliesToVersionNumber()
getAppliesToVersionNumber
in interface ModuleComponent
public void setAppliesToVersion(java.lang.String version)
public java.util.List getDependsOn()
getDependsOn
in interface ModuleComponent
public void setDependsOn(java.util.List 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 java.lang.Throwable
java.lang.Throwable
- any problems, just throw thempublic final void execute()
execute
in interface ModuleComponent
the abstract method to be implemented by subclasses
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.