|
RAFo C/SRandomAccessFile for Objects |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RemoteObject | +--java.rmi.server.RemoteServer | +--java.rmi.server.UnicastRemoteObject | +--com.linxpda.raf.server.RAFoRMIServer
The RMI server used to allow multiple clients to access RAFo files on a remote server. The RAFoRMIServer is capable of opening multiple RAFo files simultaneously and providing access to these files to multiple clients in a thread safe manner. Thus, only one instance of RAFoRMIServer ever needs to be run on a server to provide access to every RAFo data file on the server to every client on the network.
Constructor Summary | |
RAFoRMIServer()
Initializes the RAFoRMIServer. |
Method Summary | |
void |
close(java.lang.String dbName)
Closes the RAFo file running the given file. |
boolean |
containsKey(java.lang.String dbName,
java.lang.String key)
Test for the given key in the given file. |
java.util.Enumeration |
getKeys(java.lang.String dbName)
Returns an Enumeration of all keys in the given file. |
java.lang.Object |
getObject(java.lang.String dbName,
java.lang.String key)
Returns the object associated with the given key in the given data file. |
int |
getObjectCount(java.lang.String dbName)
Returns an int of the total number of objects stored in the given file. |
void |
insertObject(java.lang.String dbName,
java.lang.String key,
java.lang.Object value)
Inserts the given object into the given data file and associates it with the given key. |
static void |
main(java.lang.String[] args)
Runs the RAFoRMIServer utility, creating a new instance and binding it to the rmiregistry. |
void |
open(java.lang.String dbName)
Opens a new RAFo file and adds it to the list of available RAFo files. |
void |
removeObject(java.lang.String dbName,
java.lang.String key)
Removes the object associated with the given key in the given data file. |
void |
updateObject(java.lang.String dbName,
java.lang.String key,
java.lang.Object value)
Replaces the object associated with the given key in the given file with the new Object value. |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RAFoRMIServer() throws java.rmi.RemoteException
NOTE: Do not call the constructor directly. Rather use the main method to start the server. The main method provides automatic binding to an rmiregistry.
Method Detail |
public void open(java.lang.String dbName) throws java.rmi.RemoteException, java.io.IOException, RAFException
Note: The client does not have direct access to remote method calls.
They are handled automatically by the remote instance obtained
through a call to the RAFo.getRemoteInstance
method.
open
in interface RemoteFile
public void close(java.lang.String dbName) throws java.rmi.RemoteException, java.io.IOException, RAFException
close
in interface RemoteFile
RAFo.close
public java.lang.Object getObject(java.lang.String dbName, java.lang.String key) throws java.rmi.RemoteException, java.io.IOException, java.lang.ClassNotFoundException, RAFException
getObject
in interface RemoteFile
RAFo.getObject
public void removeObject(java.lang.String dbName, java.lang.String key) throws java.rmi.RemoteException, java.io.IOException, RAFException
removeObject
in interface RemoteFile
RAFo.removeObject
public void insertObject(java.lang.String dbName, java.lang.String key, java.lang.Object value) throws java.rmi.RemoteException, java.io.IOException, RAFException
insertObject
in interface RemoteFile
RAFo.insertObject
public void updateObject(java.lang.String dbName, java.lang.String key, java.lang.Object value) throws java.rmi.RemoteException, java.io.IOException, RAFException
updateObject
in interface RemoteFile
RAFo.updateObject
public boolean containsKey(java.lang.String dbName, java.lang.String key) throws java.rmi.RemoteException, RAFException
containsKey
in interface RemoteFile
RAFo.containsKey
public java.util.Enumeration getKeys(java.lang.String dbName) throws java.rmi.RemoteException, RAFException
getKeys
in interface RemoteFile
RAFo.getKeys
public int getObjectCount(java.lang.String dbName) throws java.rmi.RemoteException, RAFException
getObjectCount
in interface RemoteFile
RAFo.getObjectCount
public static void main(java.lang.String[] args)
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |