org.sr.server
Class AbstractServiceLocator

java.lang.Object
  extended by org.sr.server.AbstractServiceLocator
All Implemented Interfaces:
IServiceLocator
Direct Known Subclasses:
EJB2ServiceLocator, EJB3ServiceLocator, POJOServiceLocator, SpringServiceLocator

public abstract class AbstractServiceLocator
extends java.lang.Object
implements IServiceLocator

Abstract service locator class for service locator implementations

Author:
Serhat Dirik

Field Summary
 
Fields inherited from interface org.sr.server.IServiceLocator
SESSION_KEY_PREFIX
 
Constructor Summary
AbstractServiceLocator()
           
 
Method Summary
 java.lang.String getLocatorName()
          Gives the assigned locator name .Locators normally named in the config file
 org.sr.common.entitydef.OperationDefinition getOperationDefinition(java.lang.String serviceName, java.lang.String methodName)
          Gives the operation definition of given operation name.
 org.sr.common.entitydef.ServiceDefinition getServiceDefinition(java.lang.String serviceName)
           
 java.util.Collection<org.sr.common.entitydef.ServiceDefinition> getServiceDefinitions()
           
 void registerService(org.sr.common.entitydef.ServiceDefinition serviceDefinition)
           
 void setLocatorName(java.lang.String name)
          Sets the name of the locator
 void unRegisterService(java.lang.String serviceName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sr.server.IServiceLocator
getServiceByName
 

Constructor Detail

AbstractServiceLocator

public AbstractServiceLocator()
Method Detail

getLocatorName

public java.lang.String getLocatorName()
Description copied from interface: IServiceLocator
Gives the assigned locator name .Locators normally named in the config file

Specified by:
getLocatorName in interface IServiceLocator
Returns:
name of the locator

setLocatorName

public void setLocatorName(java.lang.String name)
Description copied from interface: IServiceLocator
Sets the name of the locator

Specified by:
setLocatorName in interface IServiceLocator

registerService

public void registerService(org.sr.common.entitydef.ServiceDefinition serviceDefinition)
                     throws ServiceRegistrationException
Specified by:
registerService in interface IServiceLocator
Throws:
ServiceRegistrationException

unRegisterService

public void unRegisterService(java.lang.String serviceName)
Specified by:
unRegisterService in interface IServiceLocator

getServiceDefinitions

public java.util.Collection<org.sr.common.entitydef.ServiceDefinition> getServiceDefinitions()
Specified by:
getServiceDefinitions in interface IServiceLocator

getServiceDefinition

public org.sr.common.entitydef.ServiceDefinition getServiceDefinition(java.lang.String serviceName)
                                                               throws ServiceNotFoundException
Specified by:
getServiceDefinition in interface IServiceLocator
Throws:
ServiceNotFoundException

getOperationDefinition

public org.sr.common.entitydef.OperationDefinition getOperationDefinition(java.lang.String serviceName,
                                                                          java.lang.String methodName)
                                                                   throws ServiceNotFoundException,
                                                                          ServiceOperationNotFoundException
Description copied from interface: IServiceLocator
Gives the operation definition of given operation name. In the config file operations might be defined by using patterns instead of using full names. This method compares

Specified by:
getOperationDefinition in interface IServiceLocator
Returns:
Throws:
ServiceNotFoundException
ServiceOperationNotFoundException