org.apache.tuscany.sca.assembly.impl
Class ReferenceImpl

java.lang.Object
  extended by org.apache.tuscany.sca.assembly.impl.BaseImpl
      extended by org.apache.tuscany.sca.assembly.impl.ExtensibleImpl
          extended by org.apache.tuscany.sca.assembly.impl.ContractImpl
              extended by org.apache.tuscany.sca.assembly.impl.AbstractReferenceImpl
                  extended by org.apache.tuscany.sca.assembly.impl.ReferenceImpl
All Implemented Interfaces:
java.lang.Cloneable, AbstractContract, AbstractReference, Base, Contract, Extensible, OperationsConfigurator, Reference, IntentAttachPoint, PolicySetAttachPoint
Direct Known Subclasses:
ComponentReferenceImpl, CompositeReferenceImpl

public class ReferenceImpl
extends AbstractReferenceImpl
implements Reference, java.lang.Cloneable

Represents a reference.


Constructor Summary
protected ReferenceImpl()
          Constructs a new reference.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of the contract.
 java.util.List<PolicySet> getApplicablePolicySets()
          Returns a list of policy sets defined in the domain, that are applicable to this PolicySetAttachPoint.
<B> B
getBinding(java.lang.Class<B> bindingClass)
          Returns a binding of the specified type or null if there is no such binding configured on this contract.
 java.util.List<Binding> getBindings()
          Returns the bindings supported by this contract.
 Callback getCallback()
          Returns a callback definition of the bindings to use for callbacks.
<B> B
getCallbackBinding(java.lang.Class<B> bindingClass)
          Returns a callback binding of the specified type or null if there is no such callback binding configured on this contract.
 InterfaceContract getInterfaceContract(Binding binding)
          By default return the interface contract for the reference
 java.util.List<PolicySet> getPolicySets()
          Returns a list of policy sets.
 java.util.List<ComponentService> getTargets()
          Returns the targets of this reference.
 boolean isPromotionOverride()
          Returns a boolean value, "false" by default, which indicates whether the configuration of this reference is a promotion override for another more deeply nested reference.
 boolean isWiredByImpl()
          Returns a boolean value, "false" by default, which indicates that the implementation wires this reference dynamically.
 void setCallback(Callback callback)
          Sets a callback definition of the bindings to use for callbacks
 void setPolicySets(java.util.List<PolicySet> policySets)
           
 void setPromotionOverride(boolean promotionOverride)
          Sets a boolean value, "false" by default, which indicates whether the configuration of this reference is a promotion override for another more deeply nested reference.
 void setWiredByImpl(boolean wiredByImpl)
          Sets a boolean value, "false" by default, which indicates that the implementation wires this reference dynamically.
 
Methods inherited from class org.apache.tuscany.sca.assembly.impl.AbstractReferenceImpl
getMultiplicity, setMultiplicity
 
Methods inherited from class org.apache.tuscany.sca.assembly.impl.ContractImpl
getConfiguredOperations, getInterfaceContract, getName, getRequiredIntents, getType, isCallback, setConfiguredOperations, setInterfaceContract, setIsCallback, setName, setRequiredIntents, setType
 
Methods inherited from class org.apache.tuscany.sca.assembly.impl.ExtensibleImpl
getExtensions
 
Methods inherited from class org.apache.tuscany.sca.assembly.impl.BaseImpl
isUnresolved, setUnresolved
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tuscany.sca.assembly.AbstractReference
getMultiplicity, setMultiplicity
 
Methods inherited from interface org.apache.tuscany.sca.assembly.AbstractContract
getInterfaceContract, getName, isCallback, setInterfaceContract, setIsCallback, setName
 
Methods inherited from interface org.apache.tuscany.sca.assembly.Base
isUnresolved, setUnresolved
 
Methods inherited from interface org.apache.tuscany.sca.assembly.Extensible
getExtensions
 
Methods inherited from interface org.apache.tuscany.sca.assembly.OperationsConfigurator
getConfiguredOperations
 
Methods inherited from interface org.apache.tuscany.sca.policy.IntentAttachPoint
getRequiredIntents, getType, setType
 

Constructor Detail

ReferenceImpl

protected ReferenceImpl()
Constructs a new reference.

Method Detail

getApplicablePolicySets

public java.util.List<PolicySet> getApplicablePolicySets()
Description copied from interface: PolicySetAttachPoint
Returns a list of policy sets defined in the domain, that are applicable to this PolicySetAttachPoint. An applicable PolicySet is one that include this PolicySetAttachPoint as part of its 'appliesTo' XPath attribute.

Specified by:
getApplicablePolicySets in interface PolicySetAttachPoint
Returns:
a list of policy sets applicable to this PolicySetAttachPoint

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from interface: Contract
Returns a clone of the contract.

Specified by:
clone in interface Contract
Overrides:
clone in class java.lang.Object
Returns:
a clone of the reference
Throws:
java.lang.CloneNotSupportedException

getBindings

public java.util.List<Binding> getBindings()
Description copied from interface: Contract
Returns the bindings supported by this contract.

Specified by:
getBindings in interface Contract
Returns:
the bindings supported by this contract

getBinding

public <B> B getBinding(java.lang.Class<B> bindingClass)
Description copied from interface: Contract
Returns a binding of the specified type or null if there is no such binding configured on this contract.

Specified by:
getBinding in interface Contract
Type Parameters:
B - the binding type
Parameters:
bindingClass - the binding type class
Returns:
the binding or null if there is no binding of the specified type

getCallbackBinding

public <B> B getCallbackBinding(java.lang.Class<B> bindingClass)
Description copied from interface: Contract
Returns a callback binding of the specified type or null if there is no such callback binding configured on this contract.

Specified by:
getCallbackBinding in interface Contract
Type Parameters:
B - the callback binding type
Parameters:
bindingClass - the callback binding type class
Returns:
the callback binding or null if there is no callback binding of the specified type

isWiredByImpl

public boolean isWiredByImpl()
Description copied from interface: Reference
Returns a boolean value, "false" by default, which indicates that the implementation wires this reference dynamically.

Specified by:
isWiredByImpl in interface Reference
Returns:
true if the implementation wires this reference dynamically

setWiredByImpl

public void setWiredByImpl(boolean wiredByImpl)
Description copied from interface: Reference
Sets a boolean value, "false" by default, which indicates that the implementation wires this reference dynamically.

Specified by:
setWiredByImpl in interface Reference
Parameters:
wiredByImpl - whether the implementation wires this reference dynamically

isPromotionOverride

public boolean isPromotionOverride()
Description copied from interface: Reference
Returns a boolean value, "false" by default, which indicates whether the configuration of this reference is a promotion override for another more deeply nested reference.

Specified by:
isPromotionOverride in interface Reference
Returns:
true if the reference is a promotion override

setPromotionOverride

public void setPromotionOverride(boolean promotionOverride)
Description copied from interface: Reference
Sets a boolean value, "false" by default, which indicates whether the configuration of this reference is a promotion override for another more deeply nested reference.

Specified by:
setPromotionOverride in interface Reference
Parameters:
promotionOverride - whether the reference is a promotion override

getPolicySets

public java.util.List<PolicySet> getPolicySets()
Description copied from interface: PolicySetAttachPoint
Returns a list of policy sets. See the Policy Framework specification for a description of this attribute.

Specified by:
getPolicySets in interface PolicySetAttachPoint
Returns:
a list of policy sets.

getTargets

public java.util.List<ComponentService> getTargets()
Description copied from interface: Reference
Returns the targets of this reference.

Specified by:
getTargets in interface Reference
Returns:
the targets of this reference.

getCallback

public Callback getCallback()
Description copied from interface: Contract
Returns a callback definition of the bindings to use for callbacks.

Specified by:
getCallback in interface Contract
Returns:
a definition of the bindings to use for callbacks

setCallback

public void setCallback(Callback callback)
Description copied from interface: Contract
Sets a callback definition of the bindings to use for callbacks

Specified by:
setCallback in interface Contract
Parameters:
callback - a definition of the bindings to use for callbacks

setPolicySets

public void setPolicySets(java.util.List<PolicySet> policySets)

getInterfaceContract

public InterfaceContract getInterfaceContract(Binding binding)
By default return the interface contract for the reference

Specified by:
getInterfaceContract in interface Contract
Parameters:
binding - the binding for which the interface contract is required
Returns:
the interface contract