org.apache.yoko.orb.CosNaming.tnaming
Class TransientNamingContext

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by org.omg.CosNaming.NamingContextExtPOA
          extended by org.apache.yoko.orb.CosNaming.NamingContextBase
              extended by org.apache.yoko.orb.CosNaming.tnaming.TransientNamingContext
All Implemented Interfaces:
InvokeHandler, NamingContextExtOperations, NamingContextOperations

public class TransientNamingContext
extends NamingContextBase


Nested Class Summary
 class TransientNamingContext.BoundObject
          Internal class used to store bound objects in the HashMap.
 class TransientNamingContext.TransientBindingIterator
          Context implementation version of the BindingIterator object used to return list items.
 
Field Summary
protected  HashMap bindings
           
protected  Object rootContext
           
 
Fields inherited from class org.apache.yoko.orb.CosNaming.NamingContextBase
logger, nonEscaped, orb, poa
 
Constructor Summary
TransientNamingContext(ORB orb, POA poa)
          Create a top-level naming context.
TransientNamingContext(ORB orb, POA poa, Object root)
          Construct a TransientNamingContext subcontext.
 
Method Summary
protected  void bindObject(NameComponent n, Object obj, BindingTypeHolder type)
          Bind an object into the current context.
 void destroy()
          Destroy a context.
 Object getRootContext()
          Retrieve the rootContext for this NamingContext.
 void list(int how_many, BindingListHolder bl, BindingIteratorHolder bi)
          Create a list of bound objects an contexts contained within this context.
 NamingContext new_context()
          Create a new context of the same type as the calling context.
protected  Object resolveObject(NameComponent n, BindingTypeHolder type)
          Resolve an object in this context (single level resolution).
protected  Object unbindObject(NameComponent n)
          Unbind an object from the current context.
 
Methods inherited from class org.apache.yoko.orb.CosNaming.NamingContextBase
bind_context, bind_new_context, bind, debug, encodeRFC2396Name, escapeName, extractSubName, isDebugEnabled, logNameComponent, nameToString, rebind_context, rebind, resolve_str, resolve, resolveContext, to_name, to_string, to_url, unbind, validateName
 
Methods inherited from class org.omg.CosNaming.NamingContextExtPOA
_all_interfaces, _invoke, _this, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _get_interface, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bindings

protected HashMap bindings

rootContext

protected Object rootContext
Constructor Detail

TransientNamingContext

public TransientNamingContext(ORB orb,
                              POA poa)
                       throws Exception
Create a top-level naming context.

Parameters:
orb - The orb hosting this context.
poa - The POA used to activate the object.
Throws:
Exception

TransientNamingContext

public TransientNamingContext(ORB orb,
                              POA poa,
                              Object root)
                       throws Exception
Construct a TransientNamingContext subcontext.

Parameters:
orb - The orb this context is associated with.
poa - The POA the root context is activated under.
root - The root context.
Throws:
Exception
Method Detail

new_context

public NamingContext new_context()
                          throws SystemException
Create a new context of the same type as the calling context.

Specified by:
new_context in interface NamingContextOperations
Specified by:
new_context in class NamingContextBase
Returns:
A new NamingContext item.
Throws:
NotFound
SystemException

destroy

public void destroy()
             throws NotEmpty
Destroy a context. This method should clean up any backing resources associated with the context.

Specified by:
destroy in interface NamingContextOperations
Specified by:
destroy in class NamingContextBase
Throws:
NotEmpty

list

public void list(int how_many,
                 BindingListHolder bl,
                 BindingIteratorHolder bi)
          throws SystemException
Create a list of bound objects an contexts contained within this context.

Specified by:
list in interface NamingContextOperations
Specified by:
list in class NamingContextBase
Parameters:
how_many - The count of elements to return as a BindingList.
bl - A holder element for returning the source binding list.
bi - A holder for returning a BindingIterator. Any extra elements not returned in the BindingList are returned in the BindingIterator.
Throws:
SystemException

resolveObject

protected Object resolveObject(NameComponent n,
                               BindingTypeHolder type)
                        throws SystemException
Resolve an object in this context (single level resolution).

Specified by:
resolveObject in class NamingContextBase
Parameters:
n - The name of the target object.
type - A type holder for returning the bound object type information.
Returns:
The bound object. Returns null if the object does not exist in the context.
Throws:
SystemException

bindObject

protected void bindObject(NameComponent n,
                          Object obj,
                          BindingTypeHolder type)
                   throws SystemException
Bind an object into the current context. This can be either an object or a naming context.

Specified by:
bindObject in class NamingContextBase
Parameters:
n - The single-level name of the target object.
obj - The object or context to be bound.
type -
Throws:
SystemException

unbindObject

protected Object unbindObject(NameComponent n)
                       throws SystemException
Unbind an object from the current context.

Specified by:
unbindObject in class NamingContextBase
Parameters:
n - The name of the target object (single level).
Returns:
The object associated with the binding. Returns null if there was no binding currently associated with this name.
Throws:
SystemException

getRootContext

public Object getRootContext()
Retrieve the rootContext for this NamingContext.

Returns:
The rootContext CORBA object associated with this context.


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.