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

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.AbstractServiceImpl
                  extended by org.apache.tuscany.sca.assembly.impl.ServiceImpl
All Implemented Interfaces:
java.lang.Cloneable, AbstractContract, AbstractService, Base, Contract, Extensible, OperationsConfigurator, Service, IntentAttachPoint, PolicySetAttachPoint
Direct Known Subclasses:
ComponentServiceImpl, CompositeServiceImpl

public class ServiceImpl
extends AbstractServiceImpl
implements Service, java.lang.Cloneable

Represents a reference.


Constructor Summary
protected ServiceImpl()
          Constructs a new service.
 
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 service
 java.util.List<PolicySet> getPolicySets()
          Returns a list of policy sets.
 void setCallback(Callback callback)
          Sets a callback definition of the bindings to use for callbacks
 void setPolicySets(java.util.List<PolicySet> policySets)
           
 
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.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

ServiceImpl

protected ServiceImpl()
Constructs a new service.

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

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.

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 service

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