public class ComponentMetadata
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIGURATION_POLICY_IGNORE |
static java.lang.String |
CONFIGURATION_POLICY_OPTIONAL |
static java.lang.String |
CONFIGURATION_POLICY_REQUIRE |
private static java.util.Set<java.lang.String> |
CONFIGURATION_POLICY_VALID |
private static java.lang.String |
IMPLEMENTATION_CLASS_DUPLICATE |
private java.lang.String |
m_activate |
private boolean |
m_activateDeclared |
private boolean |
m_configurableServiceProperties |
private java.util.List<java.lang.String> |
m_configurationPid |
private java.lang.String |
m_configurationPolicy |
private boolean |
m_configureWithInterfaces |
private java.lang.String |
m_deactivate |
private boolean |
m_deactivateDeclared |
private boolean |
m_delayedKeepInstances |
private boolean |
m_deleteCallsModify |
private DSVersion |
m_dsVersion |
private boolean |
m_enabled |
private java.lang.String |
m_factory |
private java.lang.Boolean |
m_immediate |
private java.lang.String |
m_implementationClassName |
private java.lang.String |
m_modified |
private java.lang.String |
m_name |
private java.lang.Boolean |
m_obsoleteFactoryComponentFactory |
private boolean |
m_persistentFactoryComponent |
private java.util.Map<java.lang.String,java.lang.Object> |
m_properties |
private java.util.List<PropertyMetadata> |
m_propertyMetaData |
private java.util.List<ReferenceMetadata> |
m_references |
private ServiceMetadata |
m_service |
private boolean |
m_validated |
private static ServiceMetadata |
SERVICE_DUPLICATE |
Constructor and Description |
---|
ComponentMetadata(DSVersion dsVersion) |
Modifier and Type | Method and Description |
---|---|
void |
addDependency(ReferenceMetadata newReference)
Used to add a reference metadata to the component
|
void |
addProperty(PropertyMetadata newProperty)
Used to add a property to the instance
|
java.lang.String |
getActivate()
Returns the name of the activate method
|
java.util.List<java.lang.String> |
getConfigurationPid()
Returns the configuration pid for the component.
|
java.lang.String |
getConfigurationPolicy()
Returns the configuration Policy
|
java.lang.String |
getDeactivate()
Returns the name of the deactivate method
|
java.util.List<ReferenceMetadata> |
getDependencies()
Returns the dependency descriptors
|
DSVersion |
getDSVersion()
Returns the namespace code of the namespace of the component element
declaring this component.
|
java.lang.String |
getFactoryIdentifier()
Returns the factory identifier
|
java.lang.String |
getImplementationClassName()
Returns the name of the implementation class
|
java.lang.String |
getModified()
Returns the name of the modified method
|
java.lang.String |
getName()
Returns the name of the component
|
int |
getPidIndex(TargetedPID pid) |
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Returns the properties.
|
(package private) java.util.List<PropertyMetadata> |
getPropertyMetaData()
Returns the list of property meta data.
|
ServiceMetadata |
getServiceMetadata()
Returns the associated ServiceMetadata
|
ServiceMetadata.Scope |
getServiceScope() |
boolean |
isActivateDeclared()
Returns whether the activate method has been declared in the descriptor
or not.
|
boolean |
isConfigurableServiceProperties() |
boolean |
isConfigurationIgnored()
Returns
true if the configuration policy is configured to
CONFIGURATION_POLICY_IGNORE . |
boolean |
isConfigurationOptional()
Returns
true if the configuration policy is configured to
CONFIGURATION_POLICY_OPTIONAL . |
boolean |
isConfigurationPidDeclared()
Returns whether the configuration-pid has been declared in the descriptor
or not.
|
boolean |
isConfigurationRequired()
Returns
true if the configuration policy is configured to
CONFIGURATION_POLICY_REQUIRE . |
boolean |
isConfigureWithInterfaces() |
boolean |
isDeactivateDeclared()
Returns whether the deactivate method has been declared in the descriptor
or not.
|
boolean |
isDelayedKeepInstances() |
boolean |
isDeleteCallsModify() |
boolean |
isEnabled()
Returns the value of the enabled flag
|
boolean |
isFactory()
Test to see if this service is a factory
|
boolean |
isImmediate()
Returns the flag that defines the activation policy for the component.
|
boolean |
isObsoleteFactoryComponentFactory() |
boolean |
isPersistentFactoryComponent() |
void |
setActivate(java.lang.String activate)
Sets the name of the activate method
|
void |
setConfigurableServiceProperties(boolean configurableServiceProperties) |
void |
setConfigurationPid(java.lang.String[] configurationPid)
Setter for the configuration-pid component (since DS 1.2)
|
void |
setConfigurationPolicy(java.lang.String configurationPolicy)
Sets the configuration policy
|
void |
setConfigureWithInterfaces(boolean configureWithInterfaces) |
void |
setDeactivate(java.lang.String deactivate)
Sets the name of the deactivate method
|
void |
setDelayedKeepInstances(boolean delayedKeepInstances) |
void |
setDeleteCallsModify(boolean deleteCallsModify) |
void |
setEnabled(boolean enabled)
Setter for the enabled property
|
void |
setFactoryIdentifier(java.lang.String factoryIdentifier) |
void |
setImmediate(boolean immediate)
Setter for the immediate property
|
void |
setImplementationClassName(java.lang.String implementationClassName)
Sets the name of the implementation class
|
void |
setModified(java.lang.String modified)
Sets the name of the modified method
|
void |
setName(java.lang.String name)
Setter for the name
|
void |
setObsoleteFactoryComponentFactory(boolean obsoleteFactoryComponentFactory) |
void |
setPersistentFactoryComponent(boolean persistentFactoryComponent) |
void |
setService(ServiceMetadata service)
Used to set a ServiceMetadata object.
|
void |
validate(Logger logger)
Method used to verify if the semantics of this metadata are correct
|
(package private) org.osgi.service.component.ComponentException |
validationFailure(java.lang.String reason)
Returns a
ComponentException for this compeonent with the
given explanation for failure. |
public static final java.lang.String CONFIGURATION_POLICY_REQUIRE
public static final java.lang.String CONFIGURATION_POLICY_IGNORE
public static final java.lang.String CONFIGURATION_POLICY_OPTIONAL
private static final java.util.Set<java.lang.String> CONFIGURATION_POLICY_VALID
private static final java.lang.String IMPLEMENTATION_CLASS_DUPLICATE
private static final ServiceMetadata SERVICE_DUPLICATE
private final DSVersion m_dsVersion
private java.lang.String m_name
private boolean m_enabled
private java.lang.String m_factory
private java.lang.Boolean m_immediate
private java.lang.String m_implementationClassName
private java.lang.String m_activate
private boolean m_activateDeclared
private java.lang.String m_deactivate
private boolean m_deactivateDeclared
private java.lang.String m_modified
private java.lang.String m_configurationPolicy
private java.util.List<java.lang.String> m_configurationPid
private java.util.Map<java.lang.String,java.lang.Object> m_properties
private java.util.List<PropertyMetadata> m_propertyMetaData
private ServiceMetadata m_service
private java.util.List<ReferenceMetadata> m_references
private boolean m_configurableServiceProperties
private boolean m_persistentFactoryComponent
private boolean m_deleteCallsModify
private java.lang.Boolean m_obsoleteFactoryComponentFactory
private boolean m_configureWithInterfaces
private boolean m_delayedKeepInstances
private boolean m_validated
public ComponentMetadata(DSVersion dsVersion)
public void setConfigurationPid(java.lang.String[] configurationPid)
configurationPid
- public void setName(java.lang.String name)
name
- public void setEnabled(boolean enabled)
enabled
- public void setFactoryIdentifier(java.lang.String factoryIdentifier)
factoryIdentifier
- public void setImmediate(boolean immediate)
immediate
- public void setImplementationClassName(java.lang.String implementationClassName)
implementationClassName
- a class namepublic void setConfigurationPolicy(java.lang.String configurationPolicy)
configurationPolicy
- configuration policypublic void setActivate(java.lang.String activate)
activate
- a method namepublic void setDeactivate(java.lang.String deactivate)
deactivate
- a method namepublic void setModified(java.lang.String modified)
modified
- a method namepublic void addProperty(PropertyMetadata newProperty)
newProperty
- a property metadata objectpublic void setService(ServiceMetadata service)
service
- a ServiceMetadatapublic void addDependency(ReferenceMetadata newReference)
newReference
- a new ReferenceMetadata to be addedpublic void setConfigurableServiceProperties(boolean configurableServiceProperties)
public void setPersistentFactoryComponent(boolean persistentFactoryComponent)
public void setDeleteCallsModify(boolean deleteCallsModify)
public void setObsoleteFactoryComponentFactory(boolean obsoleteFactoryComponentFactory)
public void setConfigureWithInterfaces(boolean configureWithInterfaces)
public void setDelayedKeepInstances(boolean delayedKeepInstances)
public DSVersion getDSVersion()
public java.lang.String getName()
public java.util.List<java.lang.String> getConfigurationPid()
public int getPidIndex(TargetedPID pid)
public boolean isConfigurationPidDeclared()
public boolean isEnabled()
public java.lang.String getFactoryIdentifier()
public boolean isImmediate()
This method may only be trusted after this instance has been validated
by the validate( Logger logger )
call. Else it will either return the value
of an explicitly set "immediate" attribute or return false if a service
element or the factory attribute is set or true otherwise. This latter
default value deduction may be unsafe while the descriptor has not been
completely read.
public java.lang.String getImplementationClassName()
public java.lang.String getConfigurationPolicy()
public java.lang.String getActivate()
public boolean isActivateDeclared()
public java.lang.String getDeactivate()
public boolean isDeactivateDeclared()
public java.lang.String getModified()
public ServiceMetadata getServiceMetadata()
public ServiceMetadata.Scope getServiceScope()
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
java.util.List<PropertyMetadata> getPropertyMetaData()
public java.util.List<ReferenceMetadata> getDependencies()
public boolean isFactory()
public boolean isConfigurationRequired()
true
if the configuration policy is configured to
CONFIGURATION_POLICY_REQUIRE
.public boolean isConfigurationIgnored()
true
if the configuration policy is configured to
CONFIGURATION_POLICY_IGNORE
.public boolean isConfigurationOptional()
true
if the configuration policy is configured to
CONFIGURATION_POLICY_OPTIONAL
.public boolean isConfigurableServiceProperties()
public boolean isPersistentFactoryComponent()
public boolean isDeleteCallsModify()
public boolean isObsoleteFactoryComponentFactory()
public boolean isConfigureWithInterfaces()
public boolean isDelayedKeepInstances()
public void validate(Logger logger)
org.osgi.service.component.ComponentException validationFailure(java.lang.String reason)
ComponentException
for this compeonent with the
given explanation for failure.reason
- The explanation for failing to validate this component.