public class BaseComponent extends Object implements IComponent, IConstants
IComponent
interfaceModifier and Type | Field and Description |
---|---|
protected IComponentData |
m_componentData
This won't be cached in the future, once we have the MetadataService on-line.
|
protected IComponentProvider |
m_componentProvider
The
IComponentProvider that is the 'container' for this component |
protected boolean |
m_isInitialized
is this initialized?
|
protected IURI |
m_uri
A default implementation of a uri
|
ALL_CRITERIA, CATEGORY_TAG, CLASS, COMPONENT_TAG, COMPONENTS_TAG, CONFIG, CONFIG_FILE, CONFIG_TAG, CRITERION, DATACHANNEL_NONE, DEFAULT, DEFAULT_JAVA_HEAP_SIZE, DELIV_METHOD, DESCRIPTION, EMPTY_STRING, ENABLED, FALSE, FOLDER_TYPE, FORWARD_SLASH, FRAMEWORK_ACCESS_MODEL, FRAMEWORK_DEV_MODE, FRAMEWORK_EDITOR_CONFIG, FRAMEWORK_JAVA_COMMAND_LINE, FRAMEWORK_JAVA_COMPILER, FRAMEWORK_JAVA_HEAP_SIZE, GROUPID, ID_NAME, INFO, INIT_FILE, INIT_FILE_ENABLED, INIT_ONLY_MODE, LIBRARY_MODE, NAME, NOTIFICATION_IDS, OWNERID, PAGE_SIZE, PARAM_STRING, PERMISSIVE_MODEL, PHASE_TAG, PHASEINFO_TAG, PHASES_TAG, PROVIDER_TAG, PROVIDERS_TAG, REMOTE_OBJECT_BODY, RESOURCE_URI, RESTRICTIVE_MODEL, SPACE, START_INDEX, SYSTEM_PATH_CLASSES, SYSTEM_PATH_CONFIG, SYSTEM_PATH_DATA, SYSTEM_PATH_DEPLOY, SYSTEM_PATH_HOME, SYSTEM_PATH_INSTALL, SYSTEM_PATH_LIB, SYSTEM_PATH_LOGS, SYSTEM_PATH_PREFIX, SYSTEM_PATH_SCRIPTS, SYSTEM_PATH_SYSTEMLIB, SYSTEM_PATH_TEMPCLASSES, SYSTEM_PATH_WEBINF, SYSTEM_PATH_WEBROOT, TAG_BR, TEXT_HTML, TEXT_IPL, TEXT_PLAIN, TEXT_XML, TRUE, TYPE, URL_NAME, VALUE, XTYPE_NAME
Constructor and Description |
---|
BaseComponent() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(Map<String,Object> config)
Activation of OSGi declaritive service
|
protected void |
bindGlobalProvider(IGlobalProvider globalProvider) |
protected void |
deactivate()
Deactivation of OSGi declaritive service
|
IComponentData |
getComponentData()
Gets the data from the IComponent
TODO instead of caching the
m_componentData , this will be looked up instead |
String |
getComponentName()
Get the common name of this component
|
IComponentProvider |
getComponentProvider()
get the provider that provided this component
|
protected IGlobalProvider |
getGlobalProvider() |
IURI |
getURI()
This is a simplistic implementation that appends the component provider's name with our name
TODO make a real implementation
|
void |
init(IComponentData componentData,
String phase)
Initialize the component with the appropriate componentData
|
boolean |
isInitialized(int phase)
check to see if object has been initialized
|
void |
setComponentData(IComponentData componentData)
This should only be used by IComponentProviders and only under extreme caution
TODO instead of caching the
m_componentData , this will be looked up instead |
void |
setComponentProvider(IComponentProvider componentProvider)
This should only be used by IComponentProviders and only under extreme caution
|
void |
shutdown()
Allows your component to shutdown
This will clear the data structures, so do your work first
|
protected IComponentData m_componentData
protected IComponentProvider m_componentProvider
IComponentProvider
that is the 'container' for this componentprotected boolean m_isInitialized
protected void activate(Map<String,Object> config) throws InitializationException
config
- the configuration properties of the OSGi serviceInitializationException
- if activation failsprotected void deactivate()
public void init(IComponentData componentData, String phase) throws InitializationException
init
in interface IInitializable
componentData
- which contains enough information for this component to initializephase
- the name of the current phaseInitializationException
InitializationException.RECOVERABLE_ERROR
,
InitializationException.NON_RECOVERABLE_ERROR
public void shutdown()
shutdown
in interface IInitializable
IInitializable.shutdown()
public boolean isInitialized(int phase)
isInitialized
in interface IComponent
phase
- optional for multi-phase init, pass IPhase.UNK_PHASE to ignorepublic String getComponentName()
getComponentName
in interface IComponent
public IComponentData getComponentData()
m_componentData
, this will be looked up insteadgetComponentData
in interface IComponent
IComponentData
public void setComponentData(IComponentData componentData)
m_componentData
, this will be looked up insteadsetComponentData
in interface IComponent
public IComponentProvider getComponentProvider()
getComponentProvider
in interface IComponent
IComponentProvider
public void setComponentProvider(IComponentProvider componentProvider)
setComponentProvider
in interface IComponent
public IURI getURI()
getURI
in interface IComponent
protected void bindGlobalProvider(IGlobalProvider globalProvider)
protected IGlobalProvider getGlobalProvider()
IGlobalProvider