|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.araneaframework.core.BaseComponent
org.araneaframework.core.BaseService
org.araneaframework.framework.router.BaseServiceRouterService
public abstract class BaseServiceRouterService
A router service consists of multiple child services, they form a service map. One of the services is a default one.
| Nested Class Summary | |
|---|---|
protected class |
BaseServiceRouterService.ServiceRouterContextImpl
|
| Nested classes/interfaces inherited from class org.araneaframework.core.BaseService |
|---|
BaseService.ServiceImpl |
| Nested classes/interfaces inherited from class org.araneaframework.core.BaseComponent |
|---|
BaseComponent.ComponentImpl |
| Nested classes/interfaces inherited from interface org.araneaframework.Service |
|---|
Service.Interface |
| Field Summary | |
|---|---|
protected Object |
defaultServiceId
|
| Fields inherited from class org.araneaframework.core.BaseService |
|---|
currentInputData, currentOutputData |
| Constructor Summary | |
|---|---|
BaseServiceRouterService()
|
|
| Method Summary | |
|---|---|
protected void |
action(Path path,
InputData input,
OutputData output)
Uses the map to route the request to the service under getServiceId(input). |
protected void |
closeService(Object serviceId)
|
protected Environment |
getChildEnvironment(Object serviceId)
|
protected Object |
getDefaultServiceId()
Returns the default service id. |
protected Object |
getServiceId(InputData input)
Returns the service id of the request. |
protected Object |
getServiceIdFromInput(InputData input)
Returns the service id read from input. |
protected abstract Object |
getServiceKey()
Every service has its own key under which the service service id can be found in the request. |
protected void |
init()
Initialize all the services in the service map with getChildEnvironment(Object serviceId). |
protected void |
propagate(Message message)
Forwards the message to the component and to all of its
children components. |
void |
setDefaultServiceId(Object defaultServiceId)
Sets the default service id. |
void |
setServiceMap(Map serviceMap)
Sets the service map. |
| Methods inherited from class org.araneaframework.core.BaseService |
|---|
_getService, getInputData, getOutputData, handleServiceException |
| Methods inherited from class org.araneaframework.core.BaseComponent |
|---|
_addComponent, _addComponent, _checkCall, _disableComponent, _enableComponent, _endCall, _endWaitingCall, _getChildren, _getComponent, _getDisabledChildren, _propagate, _relocateComponent, _removeComponent, _setEnvironment, _setScope, _startCall, _startWaitingCall, _strictCheckCall, _strictStartCall, _waitNoCall, destroy, disable, enable, getEnvironment, getScope, handleException, isAlive, isDead, isInitialized |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.araneaframework.Component |
|---|
_getComponent, getEnvironment, getScope, isAlive |
| Field Detail |
|---|
protected Object defaultServiceId
| Constructor Detail |
|---|
public BaseServiceRouterService()
| Method Detail |
|---|
public void setServiceMap(Map serviceMap)
public void setDefaultServiceId(Object defaultServiceId)
protected void init()
throws Exception
getChildEnvironment(Object serviceId). The serviceId is the
key of the service in the service map.
init in class BaseComponentException - Any runtime exception that may occur.
protected void propagate(Message message)
throws Exception
BaseComponentmessage to the component and to all of its
children components.
propagate in class BaseComponentmessage - A message to forward.
Exception - Any runtime exception that may occur.
protected void action(Path path,
InputData input,
OutputData output)
throws Exception
getServiceId(input).
If the service id cannot be determined then the default id is used set via
setDefaultServiceId(Object).
action in class BaseServicepath - The path of the component to whom the action is targeted.input - The request data.output - The response data.
Exception - Any runtime exception that may occur.
protected Environment getChildEnvironment(Object serviceId)
throws Exception
Exception
protected Object getServiceId(InputData input)
throws Exception
getServiceKey(). Returns
defaultServiceId when input has no service information
specified.
Exception
protected Object getServiceIdFromInput(InputData input)
throws Exception
Exceptionprotected Object getDefaultServiceId()
protected abstract Object getServiceKey()
throws Exception
Exceptionprotected void closeService(Object serviceId)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||