PJODe

The PersonalJava ODBMS

com.linxpda.PJODe.server
Class PJODeRMIServer

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.linxpda.PJODe.server.PJODeRMIServer
All Implemented Interfaces:
java.rmi.Remote, RemoteDB, java.io.Serializable

public class PJODeRMIServer
extends java.rmi.server.UnicastRemoteObject
implements RemoteDB

An RMI server that provides thread safe access to any number of PJODe database systems. Once a PJODeRMIServer is started, all access is provided through the PJODe class by calling the PJODe(String dbName, URL url) constructor. This notifies PJODe that it is to forward all database requests to the remote object referred to in the url parameter, thus allowing for thread safe, multi-client access to a single PJODe database file.

See Also:
Serialized Form

Constructor Summary
PJODeRMIServer()
          Initializes the PJODeRMIServer.
 
Method Summary
 void close(java.lang.String dbName)
          Closes the PJODe database connected to the given file and removes it from the list of available PJODe databases.
 ResultSet get(java.lang.Object query, java.lang.String dbName)
          Queries the database connected to the given filename, using the given object as it's query.
static void main(java.lang.String[] args)
          Runs the PJODeRMIServer utility, creating a new instance and binding it to the rmiregistry.
 void open(java.lang.String dbName)
          Opens a PJODe database using the given file and adds it to the list of available PJODe databases.
 void remove(java.lang.Object value, java.lang.String dbName)
          Removes the specified value from the PJODe connected to the specified filename.
 void set(java.lang.Object value, java.lang.String dbName)
          Adds (or updates) the given value in the PJODe connected to the specified filename.
 
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

PJODeRMIServer

public PJODeRMIServer()
               throws java.rmi.RemoteException
Initializes the PJODeRMIServer.

NOTE: This method is not to be called directly. Rather run this class through it's main method to allow for proper rmiregistry binding.

Method Detail

open

public void open(java.lang.String dbName)
          throws java.rmi.RemoteException,
                 java.io.IOException,
                 DBException
Opens a PJODe database using the given file and adds it to the list of available PJODe databases.
Specified by:
open in interface RemoteDB

close

public void close(java.lang.String dbName)
           throws java.rmi.RemoteException,
                  java.io.IOException,
                  DBException
Closes the PJODe database connected to the given file and removes it from the list of available PJODe databases.
Specified by:
close in interface RemoteDB
See Also:
PJODe.close

get

public ResultSet get(java.lang.Object query,
                     java.lang.String dbName)
              throws java.rmi.RemoteException,
                     java.io.IOException,
                     DBException,
                     java.lang.ClassNotFoundException
Queries the database connected to the given filename, using the given object as it's query.
Specified by:
get in interface RemoteDB
See Also:
PJODe.get

remove

public void remove(java.lang.Object value,
                   java.lang.String dbName)
            throws java.rmi.RemoteException,
                   java.io.IOException,
                   DBException
Removes the specified value from the PJODe connected to the specified filename.
Specified by:
remove in interface RemoteDB
See Also:
PJODe.remove

set

public void set(java.lang.Object value,
                java.lang.String dbName)
         throws java.rmi.RemoteException,
                java.io.IOException,
                DBException
Adds (or updates) the given value in the PJODe connected to the specified filename.
Specified by:
set in interface RemoteDB
See Also:
PJODe.set

main

public static void main(java.lang.String[] args)
Runs the PJODeRMIServer utility, creating a new instance and binding it to the rmiregistry. If no arguments are supplied the server will be bound as remote "PJODe" on port '1099'. Arguments are in the order 'remotename' 'port':
java com.linxpda.PJODe.server.PJODeRMIServer

(c)2001 Linxpda, Inc. www.linxpda.com