|
Voyager ORB | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectspace.voyager.directory.Directory
Directory is the building block of Voyager's federating naming service. You can use this service to place an object into a distributed hierarchical naming structure. This structure allows you to associate objects with symbolic path names comprised of simple strings separated by ‘/’ characters such as chemistry/symbol/calcium or chemistry/number/gold.
To create a naming structure, construct a Directory object. You may use put() to associate a simple string with an object, including a remote reference to another Directory. If you invoke put() with a path name, it automatically looks up the Directory associated with the head of the path name and then forwards the put() message with the remaining tail of the path name. If the head is not present or is not associated with an Directory, a DirectoryException is thrown. The same logic applies to get() and remove().
Directories are serializable.
Field Summary | |
protected static byte |
ALL_ENTRY
|
protected static byte |
DIRECTORY_ENTRY
|
protected java.util.Dictionary |
map
|
protected static byte |
OBJECT_ENTRY
|
Constructor Summary | |
Directory()
Construct myself to be an empty directory. |
Method Summary | |
void |
clear()
Remove every entry from the local directory. |
java.lang.Object |
get(java.lang.String key)
Return the value associated with a particular key. |
Entry[] |
getAllEntries(java.lang.String key)
|
Entry[] |
getDirectoryEntries(java.lang.String key)
|
protected Entry[] |
getEntries(byte type)
|
java.lang.Object[] |
getKeys()
Return an array of the keys in the local directory. |
Entry[] |
getObjectEntries(java.lang.String key)
|
java.lang.Object[] |
getValues()
Return an array of the values in the local directory. |
protected void |
initialize()
|
protected IDirectory |
newDirectory(java.lang.String name)
|
protected Entry |
newEntry(java.lang.String name,
java.lang.Object object)
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
Associate a key with a value. |
java.lang.Object |
remove(java.lang.String key)
Remove the directory entry with the specified key. |
protected java.lang.Object |
resolveValue(java.lang.Object object)
|
int |
size()
Return the number of keys in the local directory. |
java.lang.String |
toString()
Return a string that describes me. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected static final byte OBJECT_ENTRY
protected static final byte DIRECTORY_ENTRY
protected static final byte ALL_ENTRY
protected java.util.Dictionary map
Constructor Detail |
public Directory()
Method Detail |
protected void initialize()
public java.lang.String toString()
public java.lang.Object put(java.lang.String key, java.lang.Object value) throws DirectoryException
key
- The key.value
- The value to be associated with the key.public java.lang.Object get(java.lang.String key) throws DirectoryException
key
- The key.public Entry[] getAllEntries(java.lang.String key) throws DirectoryException
public Entry[] getObjectEntries(java.lang.String key) throws DirectoryException
public Entry[] getDirectoryEntries(java.lang.String key) throws DirectoryException
public java.lang.Object remove(java.lang.String key) throws DirectoryException
key
- The key.public void clear()
public int size()
public java.lang.Object[] getValues()
public java.lang.Object[] getKeys()
protected Entry[] getEntries(byte type)
protected Entry newEntry(java.lang.String name, java.lang.Object object)
protected IDirectory newDirectory(java.lang.String name)
protected java.lang.Object resolveValue(java.lang.Object object)
|
ObjectSpace Inc. | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |