org.apache.felix.scr.impl.metadata
Class ComponentMetadata

java.lang.Object
  extended by org.apache.felix.scr.impl.metadata.ComponentMetadata

public class ComponentMetadata
extends Object

This class holds the information associated to a component in the descriptor *


Field Summary
static String CONFIGURATION_POLICY_IGNORE
           
static String CONFIGURATION_POLICY_OPTIONAL
           
static String CONFIGURATION_POLICY_REQUIRE
           
 
Constructor Summary
ComponentMetadata(int namespaceCode)
           
 
Method Summary
 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
 String getActivate()
          Returns the name of the activate method
 String getConfigurationPolicy()
          Returns the configuration Policy
 String getDeactivate()
          Returns the name of the deactivate method
 List getDependencies()
          Returns the dependency descriptors
 String getFactoryIdentifier()
          Returns the factory identifier
 String getImplementationClassName()
          Returns the name of the implementation class
 String getModified()
          Returns the name of the modified method
 String getName()
          Returns the name of the component
 int getNamespaceCode()
          Returns the namespace code of the namespace of the component element declaring this component.
 Dictionary getProperties()
          Returns the properties.
 ServiceMetadata getServiceMetadata()
          Returns the associated ServiceMetadata
 boolean isActivateDeclared()
          Returns whether the activate method has been declared in the descriptor or not.
 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 isConfigurationRequired()
          Returns true if the configuration policy is configured to CONFIGURATION_POLICY_REQUIRE.
 boolean isDeactivateDeclared()
          Returns whether the deactivate method has been declared in the descriptor or not.
 boolean isDS11()
          Returns true if the metadata declaration has used the Declarative Services version 1.1 namespace or a later namespace.
 boolean isDS11Felix()
          Returns true if the metadata declaration has used the Declarative Services version 1.1-felixnamespace or a later namespace.
 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.
 void setActivate(String activate)
          Sets the name of the activate method
 void setConfigurationPolicy(String configurationPolicy)
          Sets the configuration policy
 void setDeactivate(String deactivate)
          Sets the name of the deactivate method
 void setEnabled(boolean enabled)
          Setter for the enabled property
 void setFactoryIdentifier(String factoryIdentifier)
           
 void setImmediate(boolean immediate)
          Setter for the immediate property
 void setImplementationClassName(String implementationClassName)
          Sets the name of the implementation class
 void setModified(String modified)
          Sets the name of the modified method
 void setName(String name)
          Setter for the name
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIGURATION_POLICY_REQUIRE

public static final String CONFIGURATION_POLICY_REQUIRE
See Also:
Constant Field Values

CONFIGURATION_POLICY_IGNORE

public static final String CONFIGURATION_POLICY_IGNORE
See Also:
Constant Field Values

CONFIGURATION_POLICY_OPTIONAL

public static final String CONFIGURATION_POLICY_OPTIONAL
See Also:
Constant Field Values
Constructor Detail

ComponentMetadata

public ComponentMetadata(int namespaceCode)
Method Detail

setName

public void setName(String name)
Setter for the name

Parameters:
name -

setEnabled

public void setEnabled(boolean enabled)
Setter for the enabled property

Parameters:
enabled -

setFactoryIdentifier

public void setFactoryIdentifier(String factoryIdentifier)
Parameters:
factoryIdentifier -

setImmediate

public void setImmediate(boolean immediate)
Setter for the immediate property

Parameters:
immediate -

setImplementationClassName

public void setImplementationClassName(String implementationClassName)
Sets the name of the implementation class

Parameters:
implementationClassName - a class name

setConfigurationPolicy

public void setConfigurationPolicy(String configurationPolicy)
Sets the configuration policy

Parameters:
configurationPolicy - configuration policy
Since:
1.2.0 (DS 1.1)

setActivate

public void setActivate(String activate)
Sets the name of the activate method

Parameters:
activate - a method name
Since:
1.2.0 (DS 1.1)

setDeactivate

public void setDeactivate(String deactivate)
Sets the name of the deactivate method

Parameters:
deactivate - a method name
Since:
1.2.0 (DS 1.1)

setModified

public void setModified(String modified)
Sets the name of the modified method

Parameters:
modified - a method name
Since:
1.2.0 (DS 1.1)

addProperty

public void addProperty(PropertyMetadata newProperty)
Used to add a property to the instance

Parameters:
newProperty - a property metadata object

setService

public void setService(ServiceMetadata service)
Used to set a ServiceMetadata object.

Parameters:
service - a ServiceMetadata

addDependency

public void addDependency(ReferenceMetadata newReference)
Used to add a reference metadata to the component

Parameters:
newReference - a new ReferenceMetadata to be added

getNamespaceCode

public int getNamespaceCode()
Returns the namespace code of the namespace of the component element declaring this component. This is one of the XmlHandler.DS_VERSION_* constants.


isDS11

public boolean isDS11()
Returns true if the metadata declaration has used the Declarative Services version 1.1 namespace or a later namespace.


isDS11Felix

public boolean isDS11Felix()
Returns true if the metadata declaration has used the Declarative Services version 1.1-felixnamespace or a later namespace.

See Also:
FELIX-1893

getName

public String getName()
Returns the name of the component

Returns:
A string containing the name of the component

isEnabled

public boolean isEnabled()
Returns the value of the enabled flag

Returns:
a boolean containing the value of the enabled flag

getFactoryIdentifier

public String getFactoryIdentifier()
Returns the factory identifier

Returns:
A string containing a factory identifier or null

isImmediate

public boolean isImmediate()
Returns the flag that defines the activation policy for the component.

This method may only be trusted after this instance has been validated by the #validate() 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.

Returns:
a boolean that defines the activation policy

getImplementationClassName

public String getImplementationClassName()
Returns the name of the implementation class

Returns:
the name of the implementation class

getConfigurationPolicy

public String getConfigurationPolicy()
Returns the configuration Policy

Returns:
the configuration policy
Since:
1.2.0 (DS 1.1)

getActivate

public String getActivate()
Returns the name of the activate method

Returns:
the name of the activate method
Since:
1.2.0 (DS 1.1)

isActivateDeclared

public boolean isActivateDeclared()
Returns whether the activate method has been declared in the descriptor or not.

Returns:
whether the activate method has been declared in the descriptor or not.
Since:
1.2.0 (DS 1.1)

getDeactivate

public String getDeactivate()
Returns the name of the deactivate method

Returns:
the name of the deactivate method
Since:
1.2.0 (DS 1.1)

isDeactivateDeclared

public boolean isDeactivateDeclared()
Returns whether the deactivate method has been declared in the descriptor or not.

Returns:
whether the deactivate method has been declared in the descriptor or not.
Since:
1.2.0 (DS 1.1)

getModified

public String getModified()
Returns the name of the modified method

Returns:
the name of the modified method
Since:
1.2.0 (DS 1.1)

getServiceMetadata

public ServiceMetadata getServiceMetadata()
Returns the associated ServiceMetadata

Returns:
a ServiceMetadata object or null if the Component does not provide any service

getProperties

public Dictionary getProperties()
Returns the properties.

Returns:
the properties as a Dictionary

getDependencies

public List getDependencies()
Returns the dependency descriptors

Returns:
a Collection of dependency descriptors

isFactory

public boolean isFactory()
Test to see if this service is a factory

Returns:
true if it is a factory, false otherwise

isConfigurationRequired

public boolean isConfigurationRequired()
Returns true if the configuration policy is configured to CONFIGURATION_POLICY_REQUIRE.


isConfigurationIgnored

public boolean isConfigurationIgnored()
Returns true if the configuration policy is configured to CONFIGURATION_POLICY_IGNORE.


isConfigurationOptional

public boolean isConfigurationOptional()
Returns true if the configuration policy is configured to CONFIGURATION_POLICY_OPTIONAL.


validate

public void validate(Logger logger)
Method used to verify if the semantics of this metadata are correct



Copyright © 2013 The Apache Software Foundation. All Rights Reserved.