org.sr.server.ejb
Class EJB2ServiceLocator

java.lang.Object
  extended by org.sr.server.AbstractServiceLocator
      extended by org.sr.server.ejb.EJB2ServiceLocator
All Implemented Interfaces:
IServiceLocator

public class EJB2ServiceLocator
extends AbstractServiceLocator
implements IServiceLocator

This is service locator implementation class for Enterprise Java Beans that implemented using EJB 2.1 and former specs. This locator access EJB instances by using JNDI, so the target attribute of services need to show the JNDI name of the target EJB. In addition to that this locator needs that the service definitions describes the home interface class of the target EJB as custom property.

Sample Configuration

<Config>
 <Locators>
  <Locator class="org.sr.server.ejb.EJB2ServiceLocator" name="EJB2Locator"/>
 </Locators>
 <Services>
  <Service name="echoBean" target="test.bean.EchoBean" lifeContext="singleton" locator="EJB2Locator">
   <Operation pattern=".*" />
    <Property key="homeInterfaceClass" value="test.bean.EchoBeanHome"/>
  </Service>
 <Services>
</Config>

Author:
Serhat Dirik

Field Summary
static java.lang.String HOME_CREATE_METHOD
           
static java.lang.String HOME_INTERFACE_ATTRIBUTE
           
 
Fields inherited from interface org.sr.server.IServiceLocator
SESSION_KEY_PREFIX
 
Constructor Summary
EJB2ServiceLocator()
           
 
Method Summary
 java.lang.Object getServiceByName(java.lang.String serviceName, ICallerContextInfo<?> context)
           
 
Methods inherited from class org.sr.server.AbstractServiceLocator
getLocatorName, getOperationDefinition, getServiceDefinition, getServiceDefinitions, registerService, setLocatorName, unRegisterService
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sr.server.IServiceLocator
getLocatorName, getOperationDefinition, getServiceDefinition, getServiceDefinitions, registerService, setLocatorName, unRegisterService
 

Field Detail

HOME_INTERFACE_ATTRIBUTE

public static final java.lang.String HOME_INTERFACE_ATTRIBUTE
See Also:
Constant Field Values

HOME_CREATE_METHOD

public static final java.lang.String HOME_CREATE_METHOD
See Also:
Constant Field Values
Constructor Detail

EJB2ServiceLocator

public EJB2ServiceLocator()
Method Detail

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