org.vrspace.server
Class ProxyDispatcher
java.lang.Object
java.util.Observable
org.vrspace.server.Dispatcher
org.vrspace.server.ProxyDispatcher
- public class ProxyDispatcher
- extends Dispatcher
This dispatcher only forwards events to/from client/other host.
But it should maintain a scene for all foreign objects, in order to reduce
network trafic and speed up event distribution, also keep local-remote
user mappings etc.
Fields inherited from class org.vrspace.server.Dispatcher |
clients, clientsSync, daemonSessions, initialized, receivedBytes, receivedChars, receivedRequests, sentBytes, sentChars, sentRequests, server, space, startTime |
Method Summary |
protected void |
forward(Request r)
Forward Request to the Client |
void |
login(Client c)
start |
Client |
login(Session session,
java.lang.String login,
java.lang.String password,
boolean daemon)
This should not be called |
protected void |
logout(Client c,
Session s)
Logout Client c from remote host, session is not used |
void |
request(Request r)
Process request from the client. |
protected void |
shutdown()
Called from server upon shutdown |
Methods inherited from class org.vrspace.server.Dispatcher |
addClient, addTransformToScene, buildDefaultDatabase, get, getAll, getByName, getByName, getClientsOnline, getDB, getRange, getRange, getServer, getTransform, init, logout, put, putTransform, remove, remove, removeClient, removeTransform, removeTransformFromScene, requestSceneUpdates, updateScene |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
connections
protected static java.util.Hashtable connections
remove
public boolean remove
autocommit
public boolean autocommit
ProxyDispatcher
public ProxyDispatcher(Client gate,
Client client)
throws java.lang.Exception
ProxyDispatcher
public ProxyDispatcher(java.lang.String host,
int port,
Client client)
throws java.lang.Exception
login
public void login(Client c)
throws ConnectionException
- start
- Throws:
ConnectionException
forward
protected void forward(Request r)
- Forward Request to the Client
request
public void request(Request r)
throws RequestException
- Process request from the client. This forwards request to remote host, changes local client ID to remote ID if necessary
- Overrides:
request
in class Dispatcher
- Throws:
RequestException
login
public Client login(Session session,
java.lang.String login,
java.lang.String password,
boolean daemon)
throws java.lang.Exception
- This should not be called
- Overrides:
login
in class Dispatcher
- Throws:
java.lang.Exception
logout
protected void logout(Client c,
Session s)
- Logout Client c from remote host, session is not used
- Overrides:
logout
in class Dispatcher
shutdown
protected void shutdown()
- Called from server upon shutdown
- Overrides:
shutdown
in class Dispatcher