|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap
java.util.TreeMap
org.openorb.util.MapNamingContext
This class can be used for an easy to use transient naming context. The context implements the SortedMap interface, and stores all it's bindings as name/value pairs. Using the put operation with a key containing a non-existent context parent(s) will result in the parent contexts being created.
Special notes: Deleting an internal context with the remove operation on any of the associated iterators or collections will cause undefined behaviour. This may change in the future.
| Constructor Summary | |
|---|---|
MapNamingContext(ORB orb,
POA rootPOA)
Create a new MapNamingContext. |
|
MapNamingContext(ORB orb,
POA rootPOA,
java.lang.String poaName)
Create a new MapNamingContext. |
|
| Method Summary | |
|---|---|
NamingContextExt |
addContext(NameComponent[] name)
Add a context to the map, adding ancestor contexts as neccicary. |
NamingContextExt |
addContext(java.lang.String context)
Add a context to the map, adding ancestor contexts as neccicary. |
java.lang.String |
bindCorbaloc()
Bind the nameservice in the forward adapter, if there is a forward adapter. |
void |
deactivate(boolean waitForComplete)
Deactivate the server reference, and all other naming contexts created with the create_context operation. |
boolean |
getAllowSelfDestruct()
Will the destroy_context operation work on the root context? |
java.lang.String |
getCorbaname(NameComponent[] name)
Return a corbaname style address for the name passed. |
java.lang.String |
getCorbaname(java.lang.String str)
Return a corbaname style address for the string name passed. |
NamingContextExt |
getRootCtxt()
Get a reference to the root naming context. |
boolean |
isContext(java.lang.String context)
Determine if the specified name is a subcontext and must be removed with the removeContext operation. |
static void |
main(java.lang.String[] args)
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Add a binding to the map. |
void |
putAll(java.util.Map p1)
|
Object |
putName(NameComponent[] name,
Object obj)
Add a binding to the map, creating ancestor contexts as neccicary. |
Object |
putStr(java.lang.String str,
Object obj)
Add a binding to the map, creating ancestor contexts as neccicary. |
boolean |
removeContext(java.lang.String context)
Remove a context. |
void |
setAllowSelfDestruct(boolean allowSelfDestruct)
When this is set to true the root context may be destroyed with the destroy operation. |
| Methods inherited from class java.util.TreeMap |
|---|
clear, clone, comparator, containsKey, containsValue, entrySet, firstKey, get, headMap, keySet, lastKey, remove, size, subMap, tailMap, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, isEmpty, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode, isEmpty |
| Constructor Detail |
public MapNamingContext(ORB orb,
POA rootPOA)
orb - orb under which the context is to be activated.rootPOA - parent POA under which to create the context's poa.
If null the orb's root POA is used.
public MapNamingContext(ORB orb,
POA rootPOA,
java.lang.String poaName)
throws AdapterAlreadyExists
orb - orb under which the context is to be activated.rootPOA - parent POA under which to create the context's poa.
If null the orb's root POA is used.poaName - name of poa created under rootPOA. If null the name will be
somthing like NameServ_10.
AdapterAlreadyExists - An adapter
with the specified name already exists. This is never thrown if poaName
is null.| Method Detail |
public NamingContextExt getRootCtxt()
public java.lang.String bindCorbaloc()
java.lang.IllegalStateException - if no default adapter exists.public java.lang.String getCorbaname(java.lang.String str)
str - stringified corbaname of target.
java.lang.IllegalArgumentException - if str is not a valid stringified name
java.lang.IllegalStateException - nameservice has not been bound as a corbaloc.public java.lang.String getCorbaname(NameComponent[] name)
name - the name to use.
java.lang.IllegalArgumentException - if name is invalid for some reason.
java.lang.IllegalStateException - nameservice has not been bound as a corbaloc.public boolean getAllowSelfDestruct()
public void setAllowSelfDestruct(boolean allowSelfDestruct)
allowSelfDestruct - New value of property allowSelfDestruct.public void deactivate(boolean waitForComplete)
waitForComplete - wait for completion before returning. If this
parameter is true and this operation is called from a server thread
an exception will be thrown.
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
To insert a new empty context into the map use a key string ending in / The object reference in this case will be ignored.
key - String or NameComponent[] composing the binding's name.value - org.omg.CORBA.Object to be bound to the name.
java.lang.NullPointerException - if key is null.
java.lang.ClassCastException - if key or value is the wrong type.
java.lang.IllegalArgumentException - the key is not a valid name.
java.lang.IllegalStateException - the name is bound to a context, or one of
it's ancestors are bound to an object.
public Object putName(NameComponent[] name,
Object obj)
java.lang.NullPointerException - if key is null.
java.lang.IllegalArgumentException - the key is not a valid name.
java.lang.IllegalStateException - the name is bound to a context, or one of
it's ancestors are bound to an object.
public Object putStr(java.lang.String str,
Object obj)
To insert a new empty context into the map use a key string ending in / The object reference in this case will be ignored.
java.lang.NullPointerException - if key is null.
java.lang.IllegalArgumentException - the key is not a valid name.
java.lang.IllegalStateException - the name is bound to a context, or one of
it's ancestors are bound to an object.public NamingContextExt addContext(java.lang.String context)
context - Name of the context.
java.lang.NullPointerException - if context is null.
java.lang.IllegalArgumentException - the context is not a valid name.
java.lang.IllegalStateException - the context or one of
it's ancestors are bound to an object.public NamingContextExt addContext(NameComponent[] name)
name - Name of the context.
java.lang.NullPointerException - if name is null.
java.lang.IllegalArgumentException - the name is not a valid name.
java.lang.IllegalStateException - the name or one of
it's ancestors are bound to an object.public boolean removeContext(java.lang.String context)
context - the name of the context.public boolean isContext(java.lang.String context)
context - the name of the context.public void putAll(java.util.Map p1)
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||