Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.vrspace.server
Class ProxyDispatcher  view ProxyDispatcher download ProxyDispatcher.java

java.lang.Object
  extended byorg.vrspace.server.Dispatcher
      extended byorg.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.


Nested Class Summary
 class ProxyDispatcher.Proxy
           
 
Nested classes inherited from class org.vrspace.server.Dispatcher
Dispatcher.DaemonLoader
 
Field Summary
 boolean autocommit
           
protected static java.util.Hashtable connections
           
 boolean remove
           
 
Fields inherited from class org.vrspace.server.Dispatcher
clients, daemonSessions, initialized, receivedBytes, receivedChars, receivedRequests, sentBytes, sentChars, sentRequests, server, space, startTime
 
Constructor Summary
ProxyDispatcher(Client gate, Client client)
           
ProxyDispatcher(java.lang.String host, int port, Client client)
           
 
Method Summary
private  void checkConnections(Client client)
           
private  void connected(Client client, AuthInfo a)
           
protected  void forward(Request r)
          Forward Request to the Client
private  AuthInfo getAuthInfo(Client client, java.lang.String name)
           
 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
(package private)  void remoteRequest(Request r)
          Process remote request and forward it to the client
(package private)  void remove(ProxyDispatcher.Proxy proxy)
          Return client to previous state
 void request(Request r)
          Process request from the client.
protected  void shutdown()
          Called from server upon shutdown
private  void startDB(Client client, java.lang.String name)
           
 
Methods inherited from class org.vrspace.server.Dispatcher
get, getAuthInfo, getByName, getDB, getRange, getRange, getServer, getTransform, init, put, putTransform, remove, remove, removeTransform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connections

protected static java.util.Hashtable connections

remove

public boolean remove

autocommit

public boolean autocommit
Constructor Detail

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
Method Detail

checkConnections

private void checkConnections(Client client)

connected

private void connected(Client client,
                       AuthInfo a)
                throws java.lang.Exception

startDB

private void startDB(Client client,
                     java.lang.String name)

getAuthInfo

private AuthInfo getAuthInfo(Client client,
                             java.lang.String name)

remove

void remove(ProxyDispatcher.Proxy proxy)
Return client to previous state


login

public void login(Client c)
           throws org.vrspace.util.ConnectionException
start


forward

protected void forward(Request r)
Forward Request to the Client


remoteRequest

void remoteRequest(Request r)
             throws RequestException
Process remote request and forward it 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

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

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