|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.didion.jwnl.dictionary.file_manager.FileManagerImpl
net.didion.jwnl.dictionary.file_manager.RemoteFileManager
public class RemoteFileManager
An object of this class can serve as a FileManager
for remote FileBackedDictionary
instantiations using RMI. This class also contains utility routines to publish a RemoteFileManager
for remote use, and to lookup a remote one for local use.
To make a RemoteFileManager
available to remote clients:
System.setSecurityManager(new RMISecurityManager()); LocateRegistry.createRegistry(Registry.REGISTRY_PORT); new RemoteFileManager().bind();
To create a local Dictionary
backed by a remote RemoteFileManager
:
Dictionary dictionary = new FileBackedDictionary(RemoteFileManager.lookup(hostname));
Field Summary | |
---|---|
static java.lang.String |
BINDING_NAME
The standard RMI binding name. |
Fields inherited from class net.didion.jwnl.dictionary.file_manager.FileManagerImpl |
---|
FILE_TYPE, PATH |
Constructor Summary | |
---|---|
RemoteFileManager(java.lang.String searchDir,
java.lang.Class dictionaryFileType)
Construct a file manager backed by a set of files contained in the default WN search directory. |
Method Summary | |
---|---|
void |
bind()
Bind this object to the value of BINDING_NAME in the local RMI
registry. |
static FileManager |
lookup(java.lang.String hostname)
Lookup the object bound to the value of BINDING_NAME in the RMI
registry on the host named by hostname |
Methods inherited from class net.didion.jwnl.dictionary.file_manager.FileManagerImpl |
---|
close, create, getFile, getFirstLinePointer, getIndexedLinePointer, getMatchingLinePointer, getNextLinePointer, getRandomLinePointer, readLineAt |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BINDING_NAME
Constructor Detail |
---|
public RemoteFileManager(java.lang.String searchDir, java.lang.Class dictionaryFileType) throws java.io.IOException, java.rmi.RemoteException
FileManagerImpl
for a description of the default search directory.
java.rmi.RemoteException
- If remote operation failed.
java.io.IOException
Method Detail |
---|
public void bind() throws java.rmi.RemoteException, java.rmi.AlreadyBoundException
BINDING_NAME
in the local RMI
registry.
java.rmi.AlreadyBoundException
- If BINDING_NAME
is already bound.
java.rmi.RemoteException
- If remote operation failed.public static FileManager lookup(java.lang.String hostname) throws java.rmi.AccessException, java.rmi.NotBoundException, java.rmi.RemoteException, java.rmi.UnknownHostException
BINDING_NAME
in the RMI
registry on the host named by hostname
FileManager
.
java.rmi.AccessException
- If this operation is not permitted.
java.rmi.NotBoundException
- If there is no object named BINDING_NAME
in the remote registry.
java.rmi.RemoteException
- If remote operation failed.
java.rmi.UnknownHostException
- If the host could not be located.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |