|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.nist.nlpir.irf.irfman.InfoServer
The InfoServer is responsible for keeping track of available indexes,
document collections, and indirectly of available indexers and
query-document matchers.
Field Summary | |
private static java.util.Vector |
classesToShutdown
This static vector will contain every class that registered itself with the registerForShutdown() method. |
private java.util.Vector |
converters
Names of the used converters if they actually exist. |
private java.util.Dictionary |
docColls
Available document collections. |
private HandlesByOid |
handlesByOid
Handles by Oid table |
private IndexerManager |
indexerMan
Manager for available indexers. |
static int |
lastUsedOidAtStart
The Oid class can't keep track itself of the last Oid given away because of the static keyword vs Serialization behavior. |
private java.lang.String |
locationOfBrokeredStorage
High-level information for use by brokers in locating persistent storage - transient here; saved by collection in DocCollection. |
private MatcherManager |
matcherMan
Manager for available query-doc matchers. |
(package private) static long |
serialVersionUID
serial version universal id - put here so Java does not insert one which may change due to revisions and make it impossible to deserialize earlier versions of serialized objects |
Constructor Summary | |
InfoServer()
|
Method Summary | |
void |
addConverter(java.lang.String converterName)
|
void |
addDocColl(DocCollection doccoll)
Add a document collection to the dictionary of available document collections |
DocCollection |
findDocColl(char[] doccollname)
Look up a document collection by name in the dictionary of available collections |
DocCollection |
findDocColl(java.lang.String doccollname)
Look up a document collection by name in the dictionary of available collections |
java.util.Vector |
getConverters()
|
java.util.Enumeration |
getDocCollIter()
Get an enumeration to allow interation over the available document collections |
void |
getFirstInstances()
For proxy management purpose. |
HandlesByOid |
getHandlesByOid()
|
IndexerManager |
getIndexerManager()
Get the IndexerManager which is a component of this InfoServer |
java.lang.String |
getLocationOfBrokeredStorage()
|
MatcherManager |
getMatcherManager()
Get the MatcherManager which is a component of this InfoServer |
java.util.Vector |
getModifiedDocColls()
Find the document collections that have been modified |
private void |
initialize()
Initialize the Infoserver dictionary of document collections, etc. |
void |
present()
Print out a list of available resources |
static void |
registerForShutdown(java.lang.Class toBeRegistered)
This method must be called from a static initializer by every class that wishes to be notified when the InfoServer shuts down. |
void |
setLocationOfBrokeredStorage(java.lang.String location)
Set the the locationOfBrokeredStorage |
void |
setMaxHandlesByOidCacheEntries(int maxHandlesByOidCacheEntries)
If one wants to change the size of the cache used to match Handles to Oids, this function * is for this purpose. |
void |
shutdown()
This method must be called before this InfoServer disappears, otherwise there will likely be synchronization problems, like Handles not being saved. |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final long serialVersionUID
private HandlesByOid handlesByOid
private java.util.Dictionary docColls
private java.util.Vector converters
private transient java.lang.String locationOfBrokeredStorage
private transient IndexerManager indexerMan
private transient MatcherManager matcherMan
public static int lastUsedOidAtStart
static
keyword vs Serialization behavior.
We must then store it here.
It is static, so the basic serialization can't take care of it.
It doesn't have any static initalizer for the same reason. Only the
initialize() method can set it at first, and then the deserialization
process will assure we can get new Oids during subsequent runs.Oid
private static java.util.Vector classesToShutdown
registerForShutdown()
method. When the InfoServer shuts
down, each of these classes will be notified.Constructor Detail |
public InfoServer()
Method Detail |
private void initialize()
public HandlesByOid getHandlesByOid()
public void setMaxHandlesByOidCacheEntries(int maxHandlesByOidCacheEntries)
public void setLocationOfBrokeredStorage(java.lang.String location)
public java.lang.String getLocationOfBrokeredStorage()
public void present()
public void addDocColl(DocCollection doccoll)
doccoll
- the document collection to be addedpublic java.util.Enumeration getDocCollIter()
public DocCollection findDocColl(char[] doccollname)
doccollname
- the name of the document collection to be looked uppublic DocCollection findDocColl(java.lang.String doccollname)
doccollname
- the name of the document collection to be looked uppublic java.util.Vector getModifiedDocColls()
public IndexerManager getIndexerManager()
public MatcherManager getMatcherManager()
public void addConverter(java.lang.String converterName)
public java.util.Vector getConverters()
public void getFirstInstances()
VirtualProxy.getFirstInstance()
public void shutdown()
public static void registerForShutdown(java.lang.Class toBeRegistered)
shutdown()
method on every
class that registered with the current method. This method will have to
be static public
. A class may wish to be notified this way
if, for instance, it uses a file that may not be saved if the class isn't
aware of the shutdown process.theFile
) and thus it wishes to be notified when the application is about
to leave so that it can close this file. It must then register with
InfoServer using a static initializer like this one:static { theInfoServer(). registerForShutdown(FileClient.class); }This way the given InfoServer is aware of the existence of this class. It will call
shutdown()
on FileClient before it
disappears. Thus FileClient must provide this shutdown method:public static void shutdown() { try { theFile.close(); } catch (IOException ioe) { Support.errorMessage("FileClient.shutdown(): Can't close theFile."); } }
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |