Class ReferenceMetadata
- java.lang.Object
-
- org.apache.felix.scr.impl.metadata.ReferenceMetadata
-
public class ReferenceMetadata extends java.lang.ObjectInformation associated to a dependency
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReferenceMetadata.ReferenceScope
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCARDINALITY_0_1static java.lang.StringCARDINALITY_0_Nstatic java.lang.StringCARDINALITY_1_1static java.lang.StringCARDINALITY_1_Nprivate static java.util.Set<java.lang.String>CARDINALITY_VALIDprivate static java.lang.StringFIELD_STRATEGY_REPLACEprivate static java.lang.StringFIELD_STRATEGY_UPDATEprivate static java.util.Set<java.lang.String>FIELD_STRATEGY_VALIDstatic java.lang.StringFIELD_VALUE_TYPE_PROPERTIESstatic java.lang.StringFIELD_VALUE_TYPE_REFERENCEstatic java.lang.StringFIELD_VALUE_TYPE_SERVICEstatic java.lang.StringFIELD_VALUE_TYPE_SERVICEOBJECTSstatic java.lang.StringFIELD_VALUE_TYPE_TUPLEprivate static java.util.Set<java.lang.String>FIELD_VALUE_TYPE_VALIDprivate java.lang.Stringm_bindprivate java.lang.Stringm_cardinalityprivate java.lang.Stringm_collection_typeprivate java.lang.Stringm_fieldprivate java.lang.Stringm_field_optionprivate java.lang.Stringm_interfaceprivate booleanm_isMultipleprivate booleanm_isOptionalprivate booleanm_isReluctantprivate booleanm_isReplaceprivate booleanm_isStaticprivate java.lang.Stringm_nameprivate java.lang.Stringm_parameterprivate java.lang.Integerm_parameterIndexprivate java.lang.Stringm_policyprivate java.lang.Stringm_policy_optionprivate ReferenceMetadata.ReferenceScopem_scopeprivate java.lang.Stringm_scopeNameprivate java.lang.Stringm_targetprivate java.lang.Stringm_unbindprivate java.lang.Stringm_updatedprivate booleanm_validatedstatic java.lang.StringPOLICY_DYNAMICstatic java.lang.StringPOLICY_OPTION_GREEDYstatic java.lang.StringPOLICY_OPTION_RELUCTANTprivate static java.util.Set<java.lang.String>POLICY_OPTION_VALIDstatic java.lang.StringPOLICY_STATICprivate static java.util.Set<java.lang.String>POLICY_VALID
-
Constructor Summary
Constructors Constructor Description ReferenceMetadata()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcollectStrings(java.util.Set<java.lang.String> strings)java.lang.StringgetBind()Get the name of a method in the component implementation class that is used to notify that a service is bound to the component configurationjava.lang.StringgetCardinality()Get the cardinality as a stringjava.lang.StringgetDebugInfo()java.lang.StringgetField()Get the name of a field in the component implementation class that is used to hold the referencejava.lang.StringgetFieldCollectionType()Get the value type of a field in the component implementation class that is used to hold the referencejava.lang.StringgetFieldOption()Get the strategy of a field in the component implementation class that is used to hold the referencejava.lang.StringgetInterface()Returns the fully qualified name of the class that is used by the component to access the servicejava.lang.StringgetMinCardinalityName()java.lang.StringgetName()Returns the name of the referencejava.lang.StringgetParameterCollectionType()Get the value type of a parameter in the component implementation class that is used to hold the reference DS 1.4java.lang.IntegergetParameterIndex()Get the parameter index, if specified.java.lang.StringgetPolicy()Get the policy as a stringjava.lang.StringgetPolicyOption()Get the policy option as a stringReferenceMetadata.ReferenceScopegetScope()java.lang.StringgetTarget()Returns the filter expression that further constrains the set of target servicesjava.lang.StringgetTargetPropertyName()Returns the name of the component property referring to thetargetproperty of this reference.java.lang.StringgetUnbind()Get the name of a method in the component implementation class that is used to notify that a service is unbound from the component configurationjava.lang.StringgetUpdated()Get the name of a method in the component implementation class that is used to notify that the service properties of a bound service have been updatedbooleanisMultiple()Test if dependency is multiple (0..n or 1..n)booleanisOptional()Test if dependency is optional (0..1 or 0..n)booleanisReluctant()Test if policy option is reluctantbooleanisReplace()Test if field strategy is replace.booleanisStatic()Test if dependency's binding policy is static(package private) static ReferenceMetadataload(java.io.DataInputStream in, MetadataStoreHelper.MetaDataReader metaDataReader)voidsetBind(java.lang.String bind)Setter for the bind method attributevoidsetCardinality(java.lang.String cardinality)Setter for the cardinality attributevoidsetField(java.lang.String field)Setter for the field attributevoidsetFieldCollectionType(java.lang.String valuetype)Setter for the field value type attributevoidsetFieldOption(java.lang.String strategy)Setter for the field strategy attributevoidsetInterface(java.lang.String interfaceName)Setter for the interfaceName attributevoidsetName(java.lang.String name)Setter for the name attributevoidsetParameter(java.lang.String val)Setter for the parameter value DS 1.4voidsetPolicy(java.lang.String policy)Setter for the policy attributevoidsetPolicyOption(java.lang.String policyOption)Setter for the policy option attributevoidsetScope(java.lang.String scopeName)voidsetTarget(java.lang.String target)Setter for the target attribute (filter)voidsetUnbind(java.lang.String unbind)Setter for the unbind method attributevoidsetUpdated(java.lang.String updated)Setter for the updated method attribute(package private) voidstore(java.io.DataOutputStream out, MetadataStoreHelper.MetaDataWriter metaDataWriter)(package private) voidvalidate(ComponentMetadata componentMetadata)Method used to verify if the semantics of this metadata are correct
-
-
-
Field Detail
-
CARDINALITY_0_1
public static final java.lang.String CARDINALITY_0_1
- See Also:
- Constant Field Values
-
CARDINALITY_0_N
public static final java.lang.String CARDINALITY_0_N
- See Also:
- Constant Field Values
-
CARDINALITY_1_1
public static final java.lang.String CARDINALITY_1_1
- See Also:
- Constant Field Values
-
CARDINALITY_1_N
public static final java.lang.String CARDINALITY_1_N
- See Also:
- Constant Field Values
-
CARDINALITY_VALID
private static final java.util.Set<java.lang.String> CARDINALITY_VALID
-
POLICY_STATIC
public static final java.lang.String POLICY_STATIC
- See Also:
- Constant Field Values
-
POLICY_DYNAMIC
public static final java.lang.String POLICY_DYNAMIC
- See Also:
- Constant Field Values
-
POLICY_VALID
private static final java.util.Set<java.lang.String> POLICY_VALID
-
POLICY_OPTION_RELUCTANT
public static final java.lang.String POLICY_OPTION_RELUCTANT
- See Also:
- Constant Field Values
-
POLICY_OPTION_GREEDY
public static final java.lang.String POLICY_OPTION_GREEDY
- See Also:
- Constant Field Values
-
POLICY_OPTION_VALID
private static final java.util.Set<java.lang.String> POLICY_OPTION_VALID
-
FIELD_STRATEGY_UPDATE
private static final java.lang.String FIELD_STRATEGY_UPDATE
- See Also:
- Constant Field Values
-
FIELD_STRATEGY_REPLACE
private static final java.lang.String FIELD_STRATEGY_REPLACE
- See Also:
- Constant Field Values
-
FIELD_STRATEGY_VALID
private static final java.util.Set<java.lang.String> FIELD_STRATEGY_VALID
-
FIELD_VALUE_TYPE_SERVICE
public static final java.lang.String FIELD_VALUE_TYPE_SERVICE
- See Also:
- Constant Field Values
-
FIELD_VALUE_TYPE_PROPERTIES
public static final java.lang.String FIELD_VALUE_TYPE_PROPERTIES
- See Also:
- Constant Field Values
-
FIELD_VALUE_TYPE_REFERENCE
public static final java.lang.String FIELD_VALUE_TYPE_REFERENCE
- See Also:
- Constant Field Values
-
FIELD_VALUE_TYPE_SERVICEOBJECTS
public static final java.lang.String FIELD_VALUE_TYPE_SERVICEOBJECTS
- See Also:
- Constant Field Values
-
FIELD_VALUE_TYPE_TUPLE
public static final java.lang.String FIELD_VALUE_TYPE_TUPLE
- See Also:
- Constant Field Values
-
FIELD_VALUE_TYPE_VALID
private static final java.util.Set<java.lang.String> FIELD_VALUE_TYPE_VALID
-
m_name
private java.lang.String m_name
-
m_interface
private java.lang.String m_interface
-
m_cardinality
private java.lang.String m_cardinality
-
m_target
private java.lang.String m_target
-
m_bind
private java.lang.String m_bind
-
m_updated
private java.lang.String m_updated
-
m_unbind
private java.lang.String m_unbind
-
m_field
private java.lang.String m_field
-
m_field_option
private java.lang.String m_field_option
-
m_collection_type
private java.lang.String m_collection_type
-
m_policy
private java.lang.String m_policy
-
m_policy_option
private java.lang.String m_policy_option
-
m_scopeName
private java.lang.String m_scopeName
-
m_scope
private ReferenceMetadata.ReferenceScope m_scope
-
m_parameter
private java.lang.String m_parameter
-
m_parameterIndex
private java.lang.Integer m_parameterIndex
-
m_isStatic
private boolean m_isStatic
-
m_isOptional
private boolean m_isOptional
-
m_isMultiple
private boolean m_isMultiple
-
m_isReluctant
private boolean m_isReluctant
-
m_isReplace
private boolean m_isReplace
-
m_validated
private boolean m_validated
-
-
Method Detail
-
setName
public void setName(java.lang.String name)
Setter for the name attribute- Parameters:
name-
-
setInterface
public void setInterface(java.lang.String interfaceName)
Setter for the interfaceName attribute- Parameters:
interfaceName-
-
setCardinality
public void setCardinality(java.lang.String cardinality)
Setter for the cardinality attribute- Parameters:
cardinality-
-
setPolicy
public void setPolicy(java.lang.String policy)
Setter for the policy attribute- Parameters:
policy-
-
setPolicyOption
public void setPolicyOption(java.lang.String policyOption)
Setter for the policy option attribute- Parameters:
policyOption-
-
setTarget
public void setTarget(java.lang.String target)
Setter for the target attribute (filter)- Parameters:
target-
-
setBind
public void setBind(java.lang.String bind)
Setter for the bind method attribute- Parameters:
bind-
-
setUpdated
public void setUpdated(java.lang.String updated)
Setter for the updated method attribute- Parameters:
updated-
-
setUnbind
public void setUnbind(java.lang.String unbind)
Setter for the unbind method attribute- Parameters:
unbind-
-
setField
public void setField(java.lang.String field)
Setter for the field attribute- Parameters:
field- the field name
-
setFieldOption
public void setFieldOption(java.lang.String strategy)
Setter for the field strategy attribute- Parameters:
strategy- the field strategy
-
setFieldCollectionType
public void setFieldCollectionType(java.lang.String valuetype)
Setter for the field value type attribute- Parameters:
valuetype- the field value type
-
setScope
public void setScope(java.lang.String scopeName)
-
setParameter
public void setParameter(java.lang.String val)
Setter for the parameter value DS 1.4- Parameters:
attribute- value
-
getName
public java.lang.String getName()
Returns the name of the reference- Returns:
- A string containing the reference's name
-
getInterface
public java.lang.String getInterface()
Returns the fully qualified name of the class that is used by the component to access the service- Returns:
- A string containing a fully qualified name
-
getCardinality
public java.lang.String getCardinality()
Get the cardinality as a string- Returns:
- A string with the cardinality
-
getPolicy
public java.lang.String getPolicy()
Get the policy as a string- Returns:
- A string with the policy
-
getPolicyOption
public java.lang.String getPolicyOption()
Get the policy option as a string- Returns:
- A string with the policy option
-
getTarget
public java.lang.String getTarget()
Returns the filter expression that further constrains the set of target services- Returns:
- A string with a filter
-
getBind
public java.lang.String getBind()
Get the name of a method in the component implementation class that is used to notify that a service is bound to the component configuration- Returns:
- a String with the name of the bind method
-
getUpdated
public java.lang.String getUpdated()
Get the name of a method in the component implementation class that is used to notify that the service properties of a bound service have been updated- Returns:
- a String with the name of the updated method
-
getUnbind
public java.lang.String getUnbind()
Get the name of a method in the component implementation class that is used to notify that a service is unbound from the component configuration- Returns:
- a String with the name of the unbind method
-
getField
public java.lang.String getField()
Get the name of a field in the component implementation class that is used to hold the reference- Returns:
- a String with the name of the field
-
getFieldOption
public java.lang.String getFieldOption()
Get the strategy of a field in the component implementation class that is used to hold the reference- Returns:
- a String with the strategy name for the field
-
getFieldCollectionType
public java.lang.String getFieldCollectionType()
Get the value type of a field in the component implementation class that is used to hold the reference- Returns:
- a String with the value type for the field
-
getParameterIndex
public java.lang.Integer getParameterIndex()
Get the parameter index, if specified. This method returns the correct value only after this metadata object has been validated by a call to#validate(ComponentMetadata, Logger)and the validation has been successful. DS 1.4- Returns:
- The parameter index , if no parameter is set this returns
-null
-
getParameterCollectionType
public java.lang.String getParameterCollectionType()
Get the value type of a parameter in the component implementation class that is used to hold the reference DS 1.4- Returns:
- a String with the value type for the parameter
-
isStatic
public boolean isStatic()
Test if dependency's binding policy is static- Returns:
- true if static
-
isOptional
public boolean isOptional()
Test if dependency is optional (0..1 or 0..n)- Returns:
- true if the dependency is optional
-
isMultiple
public boolean isMultiple()
Test if dependency is multiple (0..n or 1..n)- Returns:
- true if the dependency is multiple
-
isReluctant
public boolean isReluctant()
Test if policy option is reluctant- Returns:
- true if policy option is reluctant
-
isReplace
public boolean isReplace()
Test if field strategy is replace.- Returns:
- true if field strategy is replace
-
getTargetPropertyName
public java.lang.String getTargetPropertyName()
Returns the name of the component property referring to thetargetproperty of this reference.- Returns:
- the name of the target property which is the name of this referene suffixed with the string ".target".
-
getMinCardinalityName
public java.lang.String getMinCardinalityName()
-
getScope
public ReferenceMetadata.ReferenceScope getScope()
-
validate
void validate(ComponentMetadata componentMetadata)
Method used to verify if the semantics of this metadata are correct
-
getDebugInfo
public java.lang.String getDebugInfo()
-
collectStrings
void collectStrings(java.util.Set<java.lang.String> strings)
-
store
void store(java.io.DataOutputStream out, MetadataStoreHelper.MetaDataWriter metaDataWriter) throws java.io.IOException- Throws:
java.io.IOException
-
load
static ReferenceMetadata load(java.io.DataInputStream in, MetadataStoreHelper.MetaDataReader metaDataReader) throws java.io.IOException
- Throws:
java.io.IOException
-
-