Class ReferenceMetadata
java.lang.Object
org.apache.felix.scr.impl.metadata.ReferenceMetadata
Information associated to a dependency
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringprivate static final Stringprivate static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate Stringprivate Stringprivate Integerprivate Stringprivate Stringprivate ReferenceMetadata.ReferenceScopeprivate Stringprivate Stringprivate Stringprivate Stringprivate booleanstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidcollectStrings(Set<String> strings) 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 configurationGet the cardinality as a stringgetField()Get the name of a field in the component implementation class that is used to hold the referenceGet the value type of a field in the component implementation class that is used to hold the referenceGet the strategy of a field in the component implementation class that is used to hold the referenceReturns the fully qualified name of the class that is used by the component to access the servicegetName()Returns the name of the referenceGet the value type of a parameter in the component implementation class that is used to hold the reference DS 1.4Get the parameter index, if specified.Get the policy as a stringGet the policy option as a stringgetScope()Returns the filter expression that further constrains the set of target servicesReturns the name of the component property referring to thetargetproperty of this reference.Get the name of a method in the component implementation class that is used to notify that a service is unbound from the component configurationGet 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 updatedbooleanTest if dependency is multiple (0..n or 1..n)booleanTest if dependency is optional (0..1 or 0..n)booleanTest if policy option is reluctantbooleanTest if field strategy is replace.booleanisStatic()Test if dependency's binding policy is static(package private) static ReferenceMetadataload(DataInputStream in, MetadataStoreHelper.MetaDataReader metaDataReader) voidSetter for the bind method attributevoidsetCardinality(String cardinality) Setter for the cardinality attributevoidSetter for the field attributevoidsetFieldCollectionType(String valuetype) Setter for the field value type attributevoidsetFieldOption(String strategy) Setter for the field strategy attributevoidsetInterface(String interfaceName) Setter for the interfaceName attributevoidSetter for the name attributevoidsetParameter(String val) Setter for the parameter value DS 1.4voidSetter for the policy attributevoidsetPolicyOption(String policyOption) Setter for the policy option attributevoidvoidSetter for the target attribute (filter)voidSetter for the unbind method attributevoidsetUpdated(String updated) Setter for the updated method attribute(package private) voidstore(DataOutputStream out, MetadataStoreHelper.MetaDataWriter metaDataWriter) (package private) voidvalidate(ComponentMetadata componentMetadata) Method used to verify if the semantics of this metadata are correct
-
Field Details
-
CARDINALITY_0_1
- See Also:
-
CARDINALITY_0_N
- See Also:
-
CARDINALITY_1_1
- See Also:
-
CARDINALITY_1_N
- See Also:
-
CARDINALITY_VALID
-
POLICY_STATIC
- See Also:
-
POLICY_DYNAMIC
- See Also:
-
POLICY_VALID
-
POLICY_OPTION_RELUCTANT
- See Also:
-
POLICY_OPTION_GREEDY
- See Also:
-
POLICY_OPTION_VALID
-
FIELD_STRATEGY_UPDATE
- See Also:
-
FIELD_STRATEGY_REPLACE
- See Also:
-
FIELD_STRATEGY_VALID
-
FIELD_VALUE_TYPE_SERVICE
- See Also:
-
FIELD_VALUE_TYPE_PROPERTIES
- See Also:
-
FIELD_VALUE_TYPE_REFERENCE
- See Also:
-
FIELD_VALUE_TYPE_SERVICEOBJECTS
- See Also:
-
FIELD_VALUE_TYPE_TUPLE
- See Also:
-
FIELD_VALUE_TYPE_VALID
-
m_name
-
m_interface
-
m_cardinality
-
m_target
-
m_bind
-
m_updated
-
m_unbind
-
m_field
-
m_field_option
-
m_collection_type
-
m_policy
-
m_policy_option
-
m_scopeName
-
m_scope
-
m_parameter
-
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
-
-
Constructor Details
-
ReferenceMetadata
public ReferenceMetadata()
-
-
Method Details
-
setName
-
setInterface
Setter for the interfaceName attribute- Parameters:
interfaceName-
-
setCardinality
Setter for the cardinality attribute- Parameters:
cardinality-
-
setPolicy
-
setPolicyOption
Setter for the policy option attribute- Parameters:
policyOption-
-
setTarget
-
setBind
-
setUpdated
Setter for the updated method attribute- Parameters:
updated-
-
setUnbind
-
setField
Setter for the field attribute- Parameters:
field- the field name
-
setFieldOption
Setter for the field strategy attribute- Parameters:
strategy- the field strategy
-
setFieldCollectionType
Setter for the field value type attribute- Parameters:
valuetype- the field value type
-
setScope
-
setParameter
Setter for the parameter value DS 1.4- Parameters:
attribute- value
-
getName
Returns the name of the reference- Returns:
- A string containing the reference's name
-
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
Get the cardinality as a string- Returns:
- A string with the cardinality
-
getPolicy
-
getPolicyOption
Get the policy option as a string- Returns:
- A string with the policy option
-
getTarget
Returns the filter expression that further constrains the set of target services- Returns:
- A string with a filter
-
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
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
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
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
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
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
Get the parameter index, if specified. This method returns the correct value only after this metadata object has been validated by a call toand the validation has been successful. DS 1.4invalid reference
#validate(ComponentMetadata, Logger)- Returns:
- The parameter index , if no parameter is set this returns
-null
-
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
-
getMinCardinalityName
-
getScope
-
validate
Method used to verify if the semantics of this metadata are correct -
getDebugInfo
-
collectStrings
-
store
void store(DataOutputStream out, MetadataStoreHelper.MetaDataWriter metaDataWriter) throws IOException - Throws:
IOException
-
load
static ReferenceMetadata load(DataInputStream in, MetadataStoreHelper.MetaDataReader metaDataReader) throws IOException - Throws:
IOException
-