org.apache.tuscany.sca.implementation.spring
Class SpringImplementation

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.ComponentTypeImpl
              extended by org.apache.tuscany.sca.assembly.impl.ImplementationImpl
                  extended by org.apache.tuscany.sca.implementation.spring.SpringImplementation
All Implemented Interfaces:
java.lang.Cloneable, Base, ComponentType, Extensible, Implementation, OperationsConfigurator, IntentAttachPoint, PolicySetAttachPoint

public class SpringImplementation
extends ImplementationImpl
implements Implementation, Extensible

Represents a Spring implementation.


Constructor Summary
protected SpringImplementation()
           
 
Method Summary
 SpringBeanElement getBeanFromService(Service service)
          Returns the Spring Bean which implements a particular service
 ComponentType getComponentType()
           
 JavaConstructorImpl<?> getConstructor()
           
 java.lang.reflect.Method getDestroyMethod()
           
 java.lang.reflect.Method getInitMethod()
           
 java.lang.String getLocation()
           
 java.util.List<PolicyHandlerTuple> getPolicyHandlerClassNames()
           
 java.util.List<Property> getProperties()
          Returns the list of properties that can be set.
 java.lang.Class getPropertyClass(java.lang.String propertyName)
          Gets the Java Class for an SCA property
 java.util.List<Reference> getReferences()
          Returns the list of reference types that are used.
 Resource getResource()
           
 java.util.List<Service> getServices()
          Returns a list of services that are offered.
 void setBeanForService(Service service, SpringBeanElement theBean)
          Sets the mapping from a service to the Spring Bean that implements the service
 void setComponentType(ComponentType componentType)
           
 void setConstructor(JavaConstructorImpl<?> definition)
           
 void setDestroyMethod(java.lang.reflect.Method destroyMethod)
           
 void setInitMethod(java.lang.reflect.Method initMethod)
           
 void setLocation(java.lang.String location)
          Sets the location attribute for this Spring implementation location - a URI to the Spring application-context file
 void setPolicyHandlerClassNames(java.util.List<PolicyHandlerTuple> policyHandlerClassNames)
           
 void setPropertyClass(java.lang.String propertyName, java.lang.Class propertyClass)
          Add a mapping from a SCA property name to a Java class for the property
 void setResource(Resource resource)
           
 
Methods inherited from class org.apache.tuscany.sca.assembly.impl.ImplementationImpl
getApplicablePolicySets, getConfiguredOperations, getPolicySets, getRequiredIntents, getType, setType
 
Methods inherited from class org.apache.tuscany.sca.assembly.impl.ComponentTypeImpl
clone, equals, getConstrainingType, getURI, hashCode, setConstrainingType, setURI
 
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
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tuscany.sca.assembly.ComponentType
getConstrainingType, getURI, setConstrainingType, setURI
 
Methods inherited from interface org.apache.tuscany.sca.assembly.Base
isUnresolved, setUnresolved
 
Methods inherited from interface org.apache.tuscany.sca.assembly.Extensible
getExtensions
 

Constructor Detail

SpringImplementation

protected SpringImplementation()
Method Detail

getLocation

public java.lang.String getLocation()

setLocation

public void setLocation(java.lang.String location)
Sets the location attribute for this Spring implementation location - a URI to the Spring application-context file


setResource

public void setResource(Resource resource)

getResource

public Resource getResource()

getConstructor

public JavaConstructorImpl<?> getConstructor()

setConstructor

public void setConstructor(JavaConstructorImpl<?> definition)

getInitMethod

public java.lang.reflect.Method getInitMethod()

setInitMethod

public void setInitMethod(java.lang.reflect.Method initMethod)

getDestroyMethod

public java.lang.reflect.Method getDestroyMethod()

setDestroyMethod

public void setDestroyMethod(java.lang.reflect.Method destroyMethod)

getComponentType

public ComponentType getComponentType()

setComponentType

public void setComponentType(ComponentType componentType)

getServices

public java.util.List<Service> getServices()
Description copied from interface: ComponentType
Returns a list of services that are offered.

Specified by:
getServices in interface ComponentType
Overrides:
getServices in class ComponentTypeImpl
Returns:
a list of services that are offered

getReferences

public java.util.List<Reference> getReferences()
Description copied from interface: ComponentType
Returns the list of reference types that are used.

Specified by:
getReferences in interface ComponentType
Overrides:
getReferences in class ComponentTypeImpl
Returns:
the list of reference types that are used

getProperties

public java.util.List<Property> getProperties()
Description copied from interface: ComponentType
Returns the list of properties that can be set.

Specified by:
getProperties in interface ComponentType
Overrides:
getProperties in class ComponentTypeImpl
Returns:
the list of properties that can be set

getBeanFromService

public SpringBeanElement getBeanFromService(Service service)
Returns the Spring Bean which implements a particular service

Parameters:
service - the service
Returns:
the bean which implements the service, as a SpringBeanElement

setBeanForService

public void setBeanForService(Service service,
                              SpringBeanElement theBean)
Sets the mapping from a service to the Spring Bean that implements the service

Parameters:
service - the service
theBean - a SpringBeanElement for the Bean implementing the service

setPropertyClass

public void setPropertyClass(java.lang.String propertyName,
                             java.lang.Class propertyClass)
Add a mapping from a SCA property name to a Java class for the property

Parameters:
propertyName -
propertyClass -

getPropertyClass

public java.lang.Class getPropertyClass(java.lang.String propertyName)
Gets the Java Class for an SCA property

Parameters:
propertyName - - the property name
Returns:
- a Class object for the type of the property

getPolicyHandlerClassNames

public java.util.List<PolicyHandlerTuple> getPolicyHandlerClassNames()

setPolicyHandlerClassNames

public void setPolicyHandlerClassNames(java.util.List<PolicyHandlerTuple> policyHandlerClassNames)