Methods Summary |
---|
public com.sun.enterprise.naming.java.javaURLContext | addStickyContext(SerialContext serialContext)add SerialContext to preserve stickiness to cloned instance
why clone() : to avoid the case of multiple threads modifying
the context returned for ctx.lookup("java:com/env/ejb")
try {
javaURLContext jCtx = (javaURLContext)this.clone();
jCtx.serialContext = serialContext;
return jCtx;
} catch (java.lang.CloneNotSupportedException ex) {
NamingException ne = new NamingException("problem with cloning javaURLContext instance");
ne.initCause(ex);
throw ne;
}
|
public java.lang.Object | addToEnvironment(java.lang.String propName, java.lang.Object propVal)Add a property to the environment.
if (myEnv == null) {
myEnv = new Hashtable(5, 0.75f);
}
return myEnv.put(propName, propVal);
|
public void | bind(java.lang.String name, java.lang.Object obj)Bind an object in the namespace. Binds the reference to the
actual object in either the cosnaming or serial context.
throw new NamingException("java:comp namespace cannot be modified");
|
public void | bind(javax.naming.Name name, java.lang.Object obj)Bind an object in the namespace. Binds the reference to the
actual object in either the cosnaming or serial context.
throw new NamingException("java:comp namespace cannot be modified");
|
public void | close()New JNDI 1.2 operation.
myEnv = null;
|
public java.lang.String | composeName(java.lang.String name, java.lang.String prefix)
Name result = composeName(new CompositeName(name),
new CompositeName(prefix));
return result.toString();
|
public javax.naming.Name | composeName(javax.naming.Name name, javax.naming.Name prefix)
Name result = (Name)(prefix.clone());
result.addAll(name);
return result;
|
public javax.naming.Context | createSubcontext(java.lang.String name)
throw new NamingException("java:comp namespace cannot be modified");
|
public javax.naming.Context | createSubcontext(javax.naming.Name name)
throw new NamingException("java:comp namespace cannot be modified");
|
public void | destroySubcontext(java.lang.String name)The destroySubcontext operation is not supported by this context.
It throws an OperationNotSupportedException.
throw new NamingException("java:comp namespace cannot be modified");
|
public void | destroySubcontext(javax.naming.Name name)The destroySubcontext operation is not supported by this context.
It throws an OperationNotSupportedException.
throw new NamingException("java:comp namespace cannot be modified");
|
public java.util.Hashtable | getEnvironment()Get the context's environment.
if (myEnv == null) {
// Must return non-null
myEnv = new Hashtable(3, 0.75f);
}
return myEnv;
|
public java.lang.String | getNameInNamespace()Return the name of this context within the namespace. The name
can be passed as an argument to (new InitialContext()).lookup()
to reproduce this context.
return myName;
|
public javax.naming.NameParser | getNameParser(java.lang.String name)Return the name parser for the specified name.
if ( namingManager == null )
throw new NamingException();
return namingManager.getNameParser();
|
public javax.naming.NameParser | getNameParser(javax.naming.Name name)Return the name parser for the specified name.
// Flat namespace; no federation; just call string version
return getNameParser(name.toString());
|
public javax.naming.NamingEnumeration | list(java.lang.String name)Lists the contents of a context or subcontext. The operation is
delegated to the serial context.
if (name.equals("")) {
// listing this context
if ( namingManager == null )
throw new NamingException();
return namingManager.list(myName);
}
// Check if 'name' names a context
Object target = lookup(name);
if (target instanceof Context) {
return ((Context)target).list("");
}
throw new NotContextException(name + " cannot be listed");
|
public javax.naming.NamingEnumeration | list(javax.naming.Name name)Lists the contents of a context or subcontext. The operation is
delegated to the serial context.
// Flat namespace; no federation; just call string version
return list(name.toString());
|
public javax.naming.NamingEnumeration | listBindings(java.lang.String name)Lists the bindings of a context or subcontext. The operation is
delegated to the serial context.
if (name.equals("")) {
// listing this context
if ( namingManager == null )
throw new NamingException();
return namingManager.listBindings(myName);
}
// Perhaps 'name' names a context
Object target = lookup(name);
if (target instanceof Context) {
return ((Context)target).listBindings("");
}
throw new NotContextException(name + " cannot be listed");
|
public javax.naming.NamingEnumeration | listBindings(javax.naming.Name name)Lists the bindings of a context or subcontext. The operation is
delegated to the serial context.
// Flat namespace; no federation; just call string version
return listBindings(name.toString());
|
public java.lang.Object | lookup(java.lang.String name)Lookup an object in the serial context.
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"In javaURLContext.lookup, name = "+name + " serialcontext..." + serialContext);
if ( name.equals("") ) {
/** javadocs for Context.lookup:
* If name is empty, returns a new instance of this context
* (which represents the same naming context as this context,
* but its environment may be modified independently and it may
* be accessed concurrently).
*/
return new javaURLContext(myName, myEnv);
}
String fullName = name;
if ( !myName.equals("") ) {
if ( myName.equals("java:") )
fullName = myName + name;
else
fullName = myName + "/" + name;
}
try {
if ( fullName.startsWith("java:comp/env") ) {
// name is in component specific namespace
return namingManager.lookup(fullName, serialContext);
}
else {
// name is for a global object
if( fullName.equals(ORB_STRING) ) {
// return the singleton ORB instance
return ORBManager.getORB();
}
else if ( fullName.equals(USER_TX) ) {
InvocationManager invMgr = Switch.getSwitch().getInvocationManager();
ComponentInvocation inv = null;
if (invMgr != null) {
inv = invMgr.getCurrentInvocation();
}
if ((inv != null) && (inv.container != null)) {
if (inv.container instanceof BaseContainer) {
BaseContainer container = (BaseContainer) inv.container;
container.checkUserTransactionLookup(inv);
}
}
// UserTransactionImpl is mutable so return new instance
return new UserTransactionImpl();
}
else if ( fullName.equals(EJB_TIMER_SERVICE) ) {
// return the EJB Timer Service. Only works for ejbs.
return Switch.getSwitch().getContainerFactory().
getEJBContextObject("javax.ejb.TimerService");
} else if ( fullName.equals(EJB_CONTEXT) ) {
// return the EJB Timer Service. Only works for ejbs.
return Switch.getSwitch().getContainerFactory().
getEJBContextObject("javax.ejb.EJBContext");
} else if ( fullName.equals(HANDLE_DELEGATE) ) {
return Switch.getSwitch().getHandleDelegate();
}
else if ( fullName.equals(TRANSACTION_MGR) ) {
return Switch.getSwitch().getContainerFactory().getTransactionMgr();
}
else if ( fullName.equals(APPSERVER_TRANSACTION_MGR) ) {
return com.sun.enterprise.transaction.TransactionManagerHelper.getTransactionManager();
}
else if ( fullName.equals(TRANSACTION_SYNC_REGISTRY) ) {
return TransactionSynchronizationRegistryImpl.getInstance();
}
else {
// try NamingManager
return namingManager.lookup(fullName, serialContext);
}
}
} catch ( NamingException ex ) {
throw ex;
} catch ( Exception ex ) {
throw (NamingException)(new NameNotFoundException("No object bound for "+fullName)).initCause(ex);
}
|
public java.lang.Object | lookup(javax.naming.Name name)Lookup a name in either the cosnaming or serial context.
// Flat namespace; no federation; just call string version
return lookup(name.toString());
|
public java.lang.Object | lookupLink(java.lang.String name)This context does not treat links specially. A lookup operation is
performed.
// This flat context does not treat links specially
return lookup(name);
|
public java.lang.Object | lookupLink(javax.naming.Name name)This context does not treat links specially. A lookup operation is
performed.
// Flat namespace; no federation; just call string version
return lookupLink(name.toString());
|
public void | rebind(javax.naming.Name name, java.lang.Object obj)Rebind an object in the namespace. Rebinds the reference to the
actual object in either the cosnaming or serial context.
throw new NamingException("java:comp namespace cannot be modified");
|
public void | rebind(java.lang.String name, java.lang.Object obj)Rebind an object in the namespace. Rebinds the reference to the
actual object in either the cosnaming or serial context.
throw new NamingException("java:comp namespace cannot be modified");
|
public java.lang.Object | removeFromEnvironment(java.lang.String propName)Remove a property from the environment.
if (myEnv == null) {
return null;
}
return myEnv.remove(propName);
|
public void | rename(java.lang.String oldname, java.lang.String newname)The rename operation is not supported by this context. It throws
an OperationNotSupportedException.
throw new NamingException("java:comp namespace cannot be modified");
|
public void | rename(javax.naming.Name oldname, javax.naming.Name newname)The rename operation is not supported by this context. It throws
an OperationNotSupportedException.
throw new NamingException("java:comp namespace cannot be modified");
|
public void | unbind(java.lang.String name)Unbind an object from the namespace.
throw new NamingException("java:comp namespace cannot be modified");
|
public void | unbind(javax.naming.Name name)Unbind an object from the namespace.
throw new NamingException("java:comp namespace cannot be modified");
|