|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IServiceLocator
Service Locators are access points to services. They stores service & operation definitions and and also offers
access methods to service instances. Another responsibility of a locator is controlling an instance's life cycles.
Locators shouldn't be accessed and used directly. ServicesRegistry
initializes and uses Locators internally
as they defined in the configuration files. Active instances of Locators can be accessed by their names by using
ServicesRegistry
.getServiceLocator method.
In order use a locator actively you need register that locator in the configuration.All the services that you want to
access by using that locator need to be named that locator as their locator attribute.An example usage of config file could be as follow:
<Config>
<Locators>
<Locator class="org.sr.server.spring.SpringServiceLocator" name="SpringLocator"/>
</Locators>
<Services>
<Service name="springEchoBean" target="echoSpringService" instance="singleton" locator="SpringLocator">
<Operation pattern=".*" authenticationRequired="false" transportLayerSecurity="false"/>
</Service>
</Services>
...
</Config>
Simple Remoting offers only limited number of locators. You can expand locators implementing concrete classes of this interface.
Field Summary | |
---|---|
static java.lang.String |
SESSION_KEY_PREFIX
|
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. |
java.lang.Object |
getServiceByName(java.lang.String serviceName,
ICallerContextInfo<?> context)
|
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 locatorName)
Sets the name of the locator |
void |
unRegisterService(java.lang.String serviceName)
|
Field Detail |
---|
static final java.lang.String SESSION_KEY_PREFIX
Method Detail |
---|
java.lang.String getLocatorName()
void setLocatorName(java.lang.String locatorName)
locatorName
- org.sr.common.entitydef.OperationDefinition getOperationDefinition(java.lang.String serviceName, java.lang.String methodName) throws ServiceNotFoundException, ServiceOperationNotFoundException
serviceName
- methodName
-
ServiceNotFoundException
ServiceOperationNotFoundException
org.sr.common.entitydef.ServiceDefinition getServiceDefinition(java.lang.String serviceName) throws ServiceNotFoundException
ServiceNotFoundException
java.util.Collection<org.sr.common.entitydef.ServiceDefinition> getServiceDefinitions()
void registerService(org.sr.common.entitydef.ServiceDefinition serviceDefinition) throws ServiceRegistrationException
ServiceRegistrationException
void unRegisterService(java.lang.String serviceName)
java.lang.Object getServiceByName(java.lang.String serviceName, ICallerContextInfo<?> context) throws ServiceNotFoundException, SessionNotFoundException, ServicePreparationException
ServiceNotFoundException
SessionNotFoundException
ServicePreparationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |