|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jwebsocket.plugins.BasePlugIn
org.jwebsocket.plugins.TokenPlugIn
pl.bristleback.server.bristle.BristlebackServerPlugin
public class BristlebackServerPlugin
Bristleback Server plugin (also called Bristle plugin) is a helpful framework overlay, which simplifies process of creating applications using jWebsocket library. Bristleback plugin consists of five main elements:
ExceptionHandler interface.
ServerStateListener implementation.
You can add as many ServerStateListener as you want.
Almost every element of plugin is configurable, user can specify how actions or message will be looked.
Yet, default implementation of those elements allow user to create "Hello world" application in just five minutes.
Plugin settings in jwebsocket.xml file are used to configure Bristle plugin.
Please note that this is early version of plugin, so nothing is tested as good as we would like it to be.
BristleConstants class and BristleConfiguration
have fields which can be helpful in creating your first application.
Current version of Bristle plugin contains two default message senders and one message dispatcher.
To make use of message senders, users must add them into their jwebsocket configuration file.
Example configuration is shown in this project, in "xml/jwebsocket.xml" file.
Created on: 2010-09-03 16:01:30
Bristleback configuration,
Bristleback configuration elements| Constructor Summary | |
|---|---|
BristlebackServerPlugin()
Creates a new Bristleback plugin instance and instantiating core elements of plugin. |
|
BristlebackServerPlugin(org.jwebsocket.api.PluginConfiguration configuration)
Constructor required by TokenPlugIn class. |
|
| Method Summary | |
|---|---|
void |
connectorStarted(org.jwebsocket.api.WebSocketConnector connector)
When connector is started, new empty rights set is created and assigned to that connector. |
void |
connectorStopped(org.jwebsocket.api.WebSocketConnector connector,
org.jwebsocket.kit.CloseReason closeReason)
Additional operations performed when connector is stopped. |
void |
engineStarted(org.jwebsocket.api.WebSocketEngine engine)
Loading of all core elements from configuration and annotations. |
void |
engineStopped(org.jwebsocket.api.WebSocketEngine engine)
In this method closing operations are performed. |
ActionsDispatcher |
getActionsDispatcher()
Gets action dispatcher with actions and handlers inside. |
void |
processToken(org.jwebsocket.kit.PlugInResponse response,
org.jwebsocket.api.WebSocketConnector connector,
org.jwebsocket.token.Token token)
Process token sent by user. |
| Methods inherited from class org.jwebsocket.plugins.TokenPlugIn |
|---|
broadcastToken, broadcastToken, createAccessDenied, createResponse, getNamespace, getServer, processPacket, sendToken, setNamespace |
| Methods inherited from class org.jwebsocket.plugins.BasePlugIn |
|---|
addAllSettings, addSetting, clearSettings, getConnector, getConnectorCount, getNode, getNodeId, getPlugInChain, getPluginConfiguration, getSetting, getSetting, getSettings, getUsername, removeNodeId, removeSetting, removeUsername, setNodeId, setPlugInChain, setPluginConfiguration, setUsername |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BristlebackServerPlugin()
public BristlebackServerPlugin(org.jwebsocket.api.PluginConfiguration configuration)
configuration - plugin configuration.| Method Detail |
|---|
public void engineStarted(org.jwebsocket.api.WebSocketEngine engine)
engineStarted in interface org.jwebsocket.api.WebSocketPlugInengineStarted in class org.jwebsocket.plugins.TokenPlugInengine - websocket engine.public void engineStopped(org.jwebsocket.api.WebSocketEngine engine)
engineStopped in interface org.jwebsocket.api.WebSocketPlugInengineStopped in class org.jwebsocket.plugins.TokenPlugInengine - websocket engine.public void connectorStarted(org.jwebsocket.api.WebSocketConnector connector)
ReservedActionName.CONNECTION_STARTED_ACTION_NAME.
connectorStarted in interface org.jwebsocket.api.WebSocketPlugInconnectorStarted in class org.jwebsocket.plugins.TokenPlugInconnector - websocket connector.
public void connectorStopped(org.jwebsocket.api.WebSocketConnector connector,
org.jwebsocket.kit.CloseReason closeReason)
ReservedActionName.CONNECTION_STOPPED_ACTION_NAME.
Reason of closed connection is given in variable named closeReason.
connectorStopped in interface org.jwebsocket.api.WebSocketPlugInconnectorStopped in class org.jwebsocket.plugins.TokenPlugInconnector - websocket connector.closeReason - connection close reason.
public void processToken(org.jwebsocket.kit.PlugInResponse response,
org.jwebsocket.api.WebSocketConnector connector,
org.jwebsocket.token.Token token)
BristleConstants.BRISTLE_PLUGIN_NAMESPACE, then plugin chain is aborted
and dedicated dispatcher performs action. This is one of the core elements in Bristle plugin.
More about dispatching actions can be found in ActionsDispatcher documentation.
processToken in class org.jwebsocket.plugins.TokenPlugInresponse - wrapper object containing information about plugin chain state.connector - websocket connector.token - content of the message.public ActionsDispatcher getActionsDispatcher()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||