org.objectweb.carol.jndi.spi
Class JacORBIIOPContext

java.lang.Object
  extended byorg.objectweb.carol.jndi.spi.AbsContext
      extended byorg.objectweb.carol.jndi.spi.JacORBIIOPContext
All Implemented Interfaces:
javax.naming.Context

public class JacORBIIOPContext
extends AbsContext
implements javax.naming.Context

Author:
Florent Benoit

Nested Class Summary
 
Nested classes inherited from class org.objectweb.carol.jndi.spi.AbsContext
AbsContext.WrappedEnumeration
 
Field Summary
static java.lang.String SAS_COMPONENT
          Object to use (specific POA) when using csiv2
 
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
 
Constructor Summary
JacORBIIOPContext(javax.naming.Context iiopCtx)
          Constructs an IIOP Wrapper context for JacORB
 
Method Summary
 void bind(javax.naming.Name name, java.lang.Object obj)
          Binds a name to an object.
static org.omg.PortableServer.POA getRootPOA()
           
 java.lang.Object lookup(java.lang.String name)
          Retrieves the named object.
 void rebind(javax.naming.Name name, java.lang.Object obj)
          Binds a name to an object, overwriting any existing binding.
protected  java.lang.Object unwrapObject(java.lang.Object o, javax.naming.Name name)
          If this object is a reference wrapper return the reference If this object is a resource wrapper return the resource
protected  java.lang.Object wrapObject(java.lang.Object o, javax.naming.Name name, boolean replace)
          Wrap an Object : If the object is a reference wrap it into a Reference Wrapper Object here the good way is to contact the carol configuration to get the portable remote object
 
Methods inherited from class org.objectweb.carol.jndi.spi.AbsContext
addToEnvironment, addToExported, bind, close, composeName, composeName, createSubcontext, createSubcontext, decode, defaultUnwrapObject, destroySubcontext, destroySubcontext, encode, getEnvironment, getNameInNamespace, getNameParser, getNameParser, getObjectPort, getWrappedContext, list, list, listBindings, listBindings, lookup, lookupLink, lookupLink, rebind, removeFromEnvironment, rename, rename, unbind, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.naming.Context
addToEnvironment, bind, close, composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, getEnvironment, getNameInNamespace, getNameParser, getNameParser, list, list, listBindings, listBindings, lookup, lookupLink, lookupLink, rebind, removeFromEnvironment, rename, rename, unbind, unbind
 

Field Detail

SAS_COMPONENT

public static final java.lang.String SAS_COMPONENT
Object to use (specific POA) when using csiv2

See Also:
Constant Field Values
Constructor Detail

JacORBIIOPContext

public JacORBIIOPContext(javax.naming.Context iiopCtx)
                  throws javax.naming.NamingException
Constructs an IIOP Wrapper context for JacORB

Parameters:
iiopCtx - the inital IIOP context
Throws:
javax.naming.NamingException - if POA cannot be activated
Method Detail

getRootPOA

public static org.omg.PortableServer.POA getRootPOA()
Returns:
the rootPOA.

unwrapObject

protected java.lang.Object unwrapObject(java.lang.Object o,
                                        javax.naming.Name name)
                                 throws javax.naming.NamingException
If this object is a reference wrapper return the reference If this object is a resource wrapper return the resource

Specified by:
unwrapObject in class AbsContext
Parameters:
o - the object to resolve
name - name of the object to unwrap
Returns:
the unwrapped object
Throws:
javax.naming.NamingException - if the object cannot be unwraped

wrapObject

protected java.lang.Object wrapObject(java.lang.Object o,
                                      javax.naming.Name name,
                                      boolean replace)
                               throws javax.naming.NamingException
Wrap an Object : If the object is a reference wrap it into a Reference Wrapper Object here the good way is to contact the carol configuration to get the portable remote object

Specified by:
wrapObject in class AbsContext
Parameters:
o - the object to encode
name - of the object
replace - if the object need to be replaced
Returns:
a Remote JNDIRemoteReference Object if o is a resource o if else
Throws:
javax.naming.NamingException - if object cannot be wrapped

lookup

public java.lang.Object lookup(java.lang.String name)
                        throws javax.naming.NamingException
Retrieves the named object.

Specified by:
lookup in interface javax.naming.Context
Overrides:
lookup in class AbsContext
Parameters:
name - the name of the object to look up
Returns:
the object bound to name
Throws:
javax.naming.NamingException - if a naming exception is encountered

bind

public void bind(javax.naming.Name name,
                 java.lang.Object obj)
          throws javax.naming.NamingException
Binds a name to an object.

Specified by:
bind in interface javax.naming.Context
Overrides:
bind in class AbsContext
Parameters:
name - the name to bind; may not be empty
obj - the object to bind; possibly null
Throws:
javax.naming.NamingException - if a naming exception is encountered

rebind

public void rebind(javax.naming.Name name,
                   java.lang.Object obj)
            throws javax.naming.NamingException
Binds a name to an object, overwriting any existing binding. All intermediate contexts and the target context (that named by all but terminal atomic component of the name) must already exist.

Specified by:
rebind in interface javax.naming.Context
Overrides:
rebind in class AbsContext
Parameters:
name - the name to bind; may not be empty
obj - the object to bind; possibly null
Throws:
javax.naming.NamingException - if a naming exception is encountered