Class SpringServiceFactory

  extended by org.spicefactory.cinnamon.service.factory.AbstractMethodInvocationServiceFactory
      extended by org.spicefactory.cinnamon.service.factory.SpringServiceFactory
All Implemented Interfaces:

public class SpringServiceFactory
extends AbstractMethodInvocationServiceFactory

ServiceFactory for Spring managed beans as Cinnamon services. This implementation locates services in Springs root WebApplicationContext, matching service names with bean names. The scope attribute of the Cinnamon service configuration will be ignored, Spring is responsible for appropiate lifecycle management of service beans.

Jens Halm

Constructor Summary
          Creates a new factory instance.
Method Summary
 Object getTargetInstance(ServiceRequest request)
          Returns the target instance that should be invoked for the given request.
 void init(Map<String,String> initMap, Map<String,Object> applicationMap, CinnamonConfig config)
          Initializes the ServiceFactory.
Methods inherited from class org.spicefactory.cinnamon.service.factory.AbstractMethodInvocationServiceFactory
addServiceConfig, getApplicationMap, getConfig, getInitMap, getMethodCandidates, getServiceInvoker
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public SpringServiceFactory()
Creates a new factory instance.

Method Detail


public void init(Map<String,String> initMap,
                 Map<String,Object> applicationMap,
                 CinnamonConfig config)
Description copied from interface: ServiceFactory
Initializes the ServiceFactory. Will only be called once by the framework at application startup.

Specified by:
init in interface ServiceFactory
init in class AbstractMethodInvocationServiceFactory
initMap - the initialisation parameters (taken from ServletConfig in a web application)
applicationMap - the application attributes (taken from ServletContext in a web application)
config - the Cinnamon configuration


public Object getTargetInstance(ServiceRequest request)
Description copied from class: AbstractMethodInvocationServiceFactory
Returns the target instance that should be invoked for the given request. Usually the properties for the service name and operation name in the given request instance are considered when deciding how to locate the target service.

Specified by:
getTargetInstance in class AbstractMethodInvocationServiceFactory
request - the service request
the instance that should be invoked for the given request