org.sr.server.spring
Class SpringServiceLocator
java.lang.Object
org.sr.server.AbstractServiceLocator
org.sr.server.spring.SpringServiceLocator
- All Implemented Interfaces:
- org.springframework.context.ApplicationContextAware, IServiceLocator
public class SpringServiceLocator
- extends AbstractServiceLocator
- implements IServiceLocator, org.springframework.context.ApplicationContextAware
This class is a Service Locator implementation for
Spring beans.This locator access spring beans instances by using spring application context, so the
target attribute of services need to show the spring bean names of the target objects.In order to use this locator
you should also define this locator as spring bean in spring configuration.
Sample SR Configuration
<Config>
<Locators>
<Locator class="org.sr.server.spring.SpringServiceLocator" name="SpringLocator"/>
</Locators>
<Services>
<Service name="echoBean" target="echoSpringService" locator="SpringLocator">
<Operation pattern=".*" />
</Service>
<Services>
</Config>
Sample Spring Configuration
<beans>
<bean id="echoSpringService" class="test.bean.EchoBean"></bean>
<bean class="org.sr.server.spring.SpringServiceLocator"/>
</beans>
- Author:
- Serhat Dirik
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpringServiceLocator
public SpringServiceLocator()
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext arg0)
throws org.springframework.beans.BeansException
- Specified by:
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
getServiceByName
public java.lang.Object getServiceByName(java.lang.String serviceName,
ICallerContextInfo<?> context)
throws ServiceNotFoundException,
SessionNotFoundException,
ServicePreparationException
- Specified by:
getServiceByName
in interface IServiceLocator
- Throws:
ServiceNotFoundException
SessionNotFoundException
ServicePreparationException