|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpl.bristleback.server.bristle.actions.ActionsDispatcher
public final class ActionsDispatcher
This class maintains incoming messages and executes action classes based on information taken from message.
It uses token's 'type' variable to indicate which action should be executed.
If requested action class is not set to be a singleton, it creates new instance of action class
(with dependencies and other fields injected).
Even if the action with name given in message is found, dispatcher checks rights of the connector,
so programmer can control whether connector is able to call this action.
Any exception can be caught by ExceptionHandler implementations.
For more information about handling action exception, please refer to action exception handler documentation.
| Constructor Summary | |
|---|---|
ActionsDispatcher()
|
|
| Method Summary | |
|---|---|
ActionsContainer |
getContainer()
Gets actions container, containing action wrappers. |
void |
performAction(org.jwebsocket.api.WebSocketConnector connector,
org.jwebsocket.token.Token token)
Performs action with name given in token content. |
void |
performReservedAction(org.jwebsocket.api.WebSocketConnector connector,
ReservedActionName actionName,
org.jwebsocket.token.Token token)
Performs actions with names reserved by plugin. |
void |
setContainer(ActionsContainer container)
Sets actions container. |
void |
setExceptionHandlersContainer(ExceptionHandlersContainer exceptionHandlersContainer)
Sets exception handlers container. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ActionsDispatcher()
| Method Detail |
|---|
public void performAction(org.jwebsocket.api.WebSocketConnector connector,
org.jwebsocket.token.Token token)
connector - connector.token - message content and additional information.
public void performReservedAction(org.jwebsocket.api.WebSocketConnector connector,
ReservedActionName actionName,
org.jwebsocket.token.Token token)
connector - websocket connector.actionName - name of the action to invoke.token - content of the message.public ActionsContainer getContainer()
public void setContainer(ActionsContainer container)
container - actions container.public void setExceptionHandlersContainer(ExceptionHandlersContainer exceptionHandlersContainer)
exceptionHandlersContainer - exception handlers container.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||