com.andreani.xtol.util
Class SessionSpaceManager
java.lang.Object
|
+--com.andreani.xtol.util.SessionSpaceManager
- All Implemented Interfaces:
- ServiceDiscoveryListener
- public class SessionSpaceManager
- extends Object
- implements ServiceDiscoveryListener
This class manages available JavaSpaces putting and getting entries.
- Version:
- 1.0
- Author:
- Stefano Andreani
Field Summary |
protected Category |
cat
Log handler (Log4Java) |
Constructor Summary |
SessionSpaceManager()
Connects to the JavaSpaces that contain the SessionEntries and registers
the listener for new spaces. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cat
protected Category cat
- Log handler (Log4Java)
SessionSpaceManager
public SessionSpaceManager()
- Connects to the JavaSpaces that contain the SessionEntries and registers
the listener for new spaces.
insertEmptyEntry
public void insertEmptyEntry(String sessionid,
String server)
- Inserts an entry into the space with an empty hashtable.
retrieveEntry
public SessionEntry retrieveEntry(String sessionid)
- Find an entry into the space. The caller must be sure the entry is into
the space.
- Parameters:
sessionid
- id of the entry to find- Returns:
- returns the session entry
serviceAdded
public void serviceAdded(ServiceDiscoveryEvent evt)
- Specified by:
serviceAdded
in interface ServiceDiscoveryListener
serviceRemoved
public void serviceRemoved(ServiceDiscoveryEvent event)
- Specified by:
serviceRemoved
in interface ServiceDiscoveryListener
serviceChanged
public void serviceChanged(ServiceDiscoveryEvent event)
- Specified by:
serviceChanged
in interface ServiceDiscoveryListener
setFailStatus
public void setFailStatus(String sessionid,
boolean fail)
updateSession
public void updateSession(SessionEntry entry)
snoopSpace
public void snoopSpace()
populateSpace
public void populateSpace(int i)
- This method populate a new JavaSpace with SessionEntries contained in the
other spaces. ServiceDiscoveryListener docs suggests to simply note the
occurrence of the ServiceDiscoveryEvent, and perform any time consuming
event handling asynchronously, so this method needs to be fast, otherwise
it needs to be invoked asynchronously.
- Parameters:
i
- Index of the space to populate
updateReferences
public void updateReferences(String oldAddr,
String newAddr)
terminate
public void terminate()
Copyright © 2001 Stefano Andreani - No Rights Reserved ;-)