org.spicefactory.cinnamon.service.factory
Class SpringServiceFactory
java.lang.Object
org.spicefactory.cinnamon.service.factory.AbstractMethodInvocationServiceFactory
org.spicefactory.cinnamon.service.factory.SpringServiceFactory
- All Implemented Interfaces:
- ServiceFactory
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.
- Author:
- Jens Halm
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpringServiceFactory
public SpringServiceFactory()
- Creates a new factory instance.
init
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- Overrides:
init in class AbstractMethodInvocationServiceFactory
- Parameters:
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
getTargetInstance
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
- Parameters:
request - the service request
- Returns:
- the instance that should be invoked for the given request