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.
 
Method Summary
 void insertEmptyEntry(String sessionid, String server)
          Inserts an entry into the space with an empty hashtable.
 void populateSpace(int i)
          This method populate a new JavaSpace with SessionEntries contained in the other spaces.
 SessionEntry retrieveEntry(String sessionid)
          Find an entry into the space.
 void serviceAdded(ServiceDiscoveryEvent evt)
           
 void serviceChanged(ServiceDiscoveryEvent event)
           
 void serviceRemoved(ServiceDiscoveryEvent event)
           
 void setFailStatus(String sessionid, boolean fail)
           
 void snoopSpace()
           
 void terminate()
           
 void updateReferences(String oldAddr, String newAddr)
           
 void updateSession(SessionEntry entry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

protected Category cat
Log handler (Log4Java)
Constructor Detail

SessionSpaceManager

public SessionSpaceManager()
Connects to the JavaSpaces that contain the SessionEntries and registers the listener for new spaces.
Method Detail

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 ;-)