mandala.jacob.remote.rmi
Class RMIMap

java.lang.Object
  extended bymandala.jacob.remote.AbstractRemote
      extended bymandala.jacob.remote.AbstractLocalReferenceRetriever
          extended bymandala.jacob.remote.rmi.RMISingletonRemoteProxy
              extended bymandala.jacob.remote.rmi.RMIMap
All Implemented Interfaces:
LocalReferenceRetriever, java.util.Map, java.rmi.Remote, Remote, RemoteMap, java.io.Serializable
Direct Known Subclasses:
RMIActiveMap

public class RMIMap
extends mandala.jacob.remote.rmi.RMISingletonRemoteProxy
implements RemoteMap

Java-RMI Map implementation.

Version:
$Revision: 1.5 $
Author:
eipi
See Also:
AbstractRemote, RemoteMap, ExceptionHandler, Serialized Form

Nested Class Summary
static class RMIMap.RMIEntry
          Java-RMI Map.Entry implementation.
 
Nested classes inherited from class mandala.jacob.remote.RemoteMap
RemoteMap.RemoteEntry, RemoteMap.RemoteMapMethods
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
protected static SingletonGiver singletonGiver
           
 
Fields inherited from class mandala.jacob.remote.AbstractRemote
defaultExceptionHandler, exceptionHandler, syslog
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set entrySet()
          Returns a RemoteSet value.
 java.lang.Object get(java.lang.Object key)
           
 boolean isEmpty()
           
 java.util.Set keySet()
          Returns a RemoteSet value.
static RMIMap newServer(java.util.Map map)
          Creates a new RMIMap server for the specified map.
static RMIMap newServer(java.util.Map map, int port)
          Creates a new RMIMap server for the specified map.
 java.lang.Object put(java.lang.Object key, java.lang.Object object)
           
 void putAll(java.util.Map m)
           
 void putAll(RemoteMap m)
           
protected  java.lang.Object readResolve()
          Ensure singleton for any subclasses.
 java.lang.Object remove(java.lang.Object key)
           
 int size()
           
 java.lang.String toString()
           
 java.util.Collection values()
          Returns a RemoteCollection value.
 
Methods inherited from class mandala.jacob.remote.AbstractLocalReferenceRetriever
finalize, getID, getLocalReference
 
Methods inherited from class mandala.jacob.remote.AbstractRemote
getDefaultExceptionHandler, getExceptionHandler, getSyslog, handleException, setDefaultExceptionHandler, setExceptionHandler, setSyslog
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 
Methods inherited from interface mandala.jacob.remote.LocalReferenceRetriever
getID, getLocalReference
 
Methods inherited from interface mandala.jacob.remote.Remote
getExceptionHandler, setExceptionHandler
 

Field Detail

singletonGiver

protected static final SingletonGiver singletonGiver
Method Detail

newServer

public static RMIMap newServer(java.util.Map map)
                        throws java.rmi.RemoteException

Creates a new RMIMap server for the specified map.

Parameters:
map - the map to serve remotely
Returns:
the RMIMap instance representing the given map
Throws:
java.rmi.RemoteException - if an error occurs

newServer

public static RMIMap newServer(java.util.Map map,
                               int port)
                        throws java.rmi.RemoteException

Creates a new RMIMap server for the specified map.

Parameters:
map - the map to serve remotely
port - the port to listen to
Returns:
the RMIMap instance representing the given map
Throws:
java.rmi.RemoteException - if an error occurs

clear

public void clear()
Specified by:
clear in interface java.util.Map

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map

entrySet

public java.util.Set entrySet()
Description copied from interface: RemoteMap

Returns a RemoteSet value.

Specified by:
entrySet in interface RemoteMap
Returns:
a RemoteSet value
See Also:
RemoteSet

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object object)
Specified by:
put in interface java.util.Map

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map

keySet

public java.util.Set keySet()
Description copied from interface: RemoteMap

Returns a RemoteSet value.

Specified by:
keySet in interface RemoteMap
Returns:
a RemoteSet value
See Also:
RemoteSet

putAll

public void putAll(java.util.Map m)
Specified by:
putAll in interface java.util.Map

putAll

public void putAll(RemoteMap m)
Specified by:
putAll in interface RemoteMap

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map

size

public int size()
Specified by:
size in interface java.util.Map

values

public java.util.Collection values()
Description copied from interface: RemoteMap

Returns a RemoteCollection value.

Specified by:
values in interface RemoteMap
Returns:
a RemoteCollection value
See Also:
RemoteCollection

toString

public java.lang.String toString()

readResolve

protected java.lang.Object readResolve()
                                throws java.io.ObjectStreamException

Ensure singleton for any subclasses.

If subclasses overwrite this method, they must ensure the singleton property themselves.

Returns:
an Object value
Throws:
java.io.ObjectStreamException - if an error occurs


Mandala help mailing list