|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
org.vrspace.server.Dispatcher
Main class responsible for event dispatching. It's also a DBManager.
Nested Class Summary | |
class |
Dispatcher.DaemonLoader
|
Field Summary | |
protected java.util.HashSet |
clients
|
protected java.lang.Object |
clientsSync
|
protected long |
daemonSessions
|
protected boolean |
initialized
|
protected long |
receivedBytes
|
protected long |
receivedChars
|
protected long |
receivedRequests
|
protected long |
sentBytes
|
protected long |
sentChars
|
protected long |
sentRequests
|
protected Server |
server
|
protected DB |
space
|
protected long |
startTime
|
Constructor Summary | |
protected |
Dispatcher()
|
|
Dispatcher(Server s,
DB db)
Constructs new Dispatcher for Server s and database db |
Method Summary | |
void |
addClient(Client c)
|
void |
addTransformToScene(Transform t)
|
protected void |
buildDefaultDatabase(DB db)
|
VRObject |
get(Client c,
java.lang.String className,
long id)
Fetch an object from the database. IMPORTANT: no protection mechanism, at least AuthInfo objects should not be retreived! |
java.lang.Object[] |
getAll(java.lang.String className)
Returns all objects of class className |
VRObject |
getByName(Client c,
java.lang.String name)
Fetch an object from the database having field name equal to name parameter IMPORTANT: no protection mechanism, at least AuthInfo objects should not be retreived! |
VRObject |
getByName(Client c,
java.lang.String className,
java.lang.String name)
Fetch an object from the database having field name equal to name parameter IMPORTANT: no protection mechanism, at least AuthInfo objects should not be retreived! |
java.util.HashSet |
getClientsOnline()
To allow VRObjects to get a list of the clients that are online. |
DB |
getDB(Client c)
Returns the reference to the database. |
java.lang.Object[] |
getRange(Client c,
java.lang.String className,
java.lang.String field,
java.lang.Object value)
Returns the object of className class having field == value |
java.lang.Object[] |
getRange(Client c,
VRObject o1,
VRObject o2)
Returns Object[] between o1 and o2 Class must have comparator() method to be searchable. |
Server |
getServer(Client c)
Returns server instance |
Transform |
getTransform(HasTransform o)
Returns parent Transform of o |
protected void |
init()
Initialize dispatcher - loads permanent Transforms and starts daemons |
Client |
login(Session session,
java.lang.String login,
java.lang.String password,
boolean daemon)
Constructs a new client object. |
protected void |
logout(Client c,
Session s)
Logout Client c from Session s |
protected void |
logout(Client c,
Session s,
boolean relogin)
Logout Client c from Session s |
void |
put(Client c,
VRObject obj)
Store an object to the database. |
void |
putTransform(Client c,
Transform t)
Add a Transform from the database. |
void |
remove(Client c,
java.lang.String className,
long id)
Remove an object from the database. |
void |
remove(Client c,
VRObject obj)
Remove an object from the database. |
void |
removeClient(Client c)
|
void |
removeTransform(Client c,
Transform t)
Remove a Transform from the database. |
void |
removeTransformFromScene(Transform t)
|
void |
request(Request r)
Process request from the client. |
void |
requestSceneUpdates()
Request scene updates for all clients. Most likely inapropriate to be located in the dispatcher, but for now the dispatcher is the most centralized object. |
protected void |
shutdown()
Called from server upon shutdown |
void |
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 |
Field Detail |
protected DB space
protected java.util.HashSet clients
protected java.lang.Object clientsSync
protected long sentChars
protected long receivedChars
protected long startTime
protected long sentRequests
protected long receivedRequests
protected long sentBytes
protected long receivedBytes
protected long daemonSessions
protected Server server
protected boolean initialized
Constructor Detail |
protected Dispatcher()
public Dispatcher(Server s, DB db)
Method Detail |
protected void buildDefaultDatabase(DB db)
protected void init()
public Server getServer(Client c)
public java.util.HashSet getClientsOnline()
public VRObject get(Client c, java.lang.String className, long id) throws java.lang.Exception
java.lang.Exception
public VRObject getByName(Client c, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public VRObject getByName(Client c, java.lang.String className, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public void put(Client c, VRObject obj) throws java.lang.Exception
java.lang.Exception
public void remove(Client c, VRObject obj) throws java.lang.Exception
java.lang.Exception
public void remove(Client c, java.lang.String className, long id) throws java.lang.Exception
java.lang.Exception
public Transform getTransform(HasTransform o) throws java.lang.Exception
java.lang.Exception
public void removeTransformFromScene(Transform t) throws java.lang.Exception
java.lang.Exception
public void addTransformToScene(Transform t) throws java.lang.Exception
java.lang.Exception
public void updateScene() throws java.lang.Exception
java.lang.Exception
public void removeTransform(Client c, Transform t) throws java.lang.Exception
java.lang.Exception
public void putTransform(Client c, Transform t) throws java.lang.Exception
java.lang.Exception
public java.lang.Object[] getRange(Client c, VRObject o1, VRObject o2) throws java.lang.Exception
java.lang.Exception
VRObjectComparator
,
TransformComparator
public java.lang.Object[] getRange(Client c, java.lang.String className, java.lang.String field, java.lang.Object value) throws java.lang.Exception
java.lang.Exception
public java.lang.Object[] getAll(java.lang.String className) throws java.lang.Exception
java.lang.Exception
public DB getDB(Client c)
public void request(Request r) throws RequestException
RequestException
public Client login(Session session, java.lang.String login, java.lang.String password, boolean daemon) throws java.lang.Exception
java.lang.Exception
protected void logout(Client c, Session s)
protected void logout(Client c, Session s, boolean relogin)
public void addClient(Client c)
public void removeClient(Client c)
protected void shutdown()
public void requestSceneUpdates()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |