/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
/**
* This class is a context implementation for the java:comp namespace.
* The context determines the component id from the invocation manager
* of the component that is invoking the method and then looks up the
* object in that component's local namespace.
*/
//private Context ctx; XXX not needed ?
/**
* Create a context with the specified environment.
*/
: null;
}
/**
* Create a context with the specified name+environment.
* Called only from GlassfishNamingManager.
*/
throws NamingException {
this(env);
}
/**
* this constructor is called from SerialContext class
*/
throws NamingException {
this(env);
this.serialContext = serialContext;
}
this.serialContext = sctx ;
}
namingManager = mgr;
}
/**
* add SerialContext to preserve stickiness to cloned instance
* why clone() : to avoid the case of multiple threads modifying
*/
/** STICKY context not enabled
public JavaURLContext addStickyContext(SerialContext serialContext)
throws NamingException {
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;
}
}
**/
/**
* Lookup an object in the serial context.
*
* @return the object that is being looked up.
* @throws NamingException if there is a naming exception.
*/
+ " serialcontext..." + serialContext);
/**
* 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).
*/
}
else
}
try {
// If we know for sure it's an entry within an environment namespace
// refers to a dependency defined by the application
} else {
// It's either an application-defined dependency in a java:
// namespace or a special EE platform object.
// Check for EE platform objects first to prevent overriding.
// try GlassfishNamingManager
}
}
}
return obj;
} catch (NamingException ex) {
// This could either be an attempt by an app client to access a portable
// remote session bean JNDI name via the java:app namespace or a lookup of
// an application-defined java:app environment dependency. Try them in
// that order.
try {
// Translate the java:app name into the equivalent java:global name so that
// the lookup will be resolved by the server.
} catch(NamingException javaappenvne) {
}
}
}
}
return obj;
}
throw ex;
throw (NamingException) (new NameNotFoundException(
}
}
/**
* Lookup a name in either the cosnaming or serial context.
*
* @return the object that is being looked up.
* @throws NamingException if there is a naming exception.
*/
// Flat namespace; no federation; just call string version
}
/**
* Bind an object in the namespace. Binds the reference to the
* actual object in either the cosnaming or serial context.
*
* @throws NamingException if there is a naming exception.
*/
throw new NamingException("java:comp namespace cannot be modified");
}
/**
* Bind an object in the namespace. Binds the reference to the
* actual object in either the cosnaming or serial context.
*
* @throws NamingException if there is a naming exception.
*/
throw new NamingException("java:comp namespace cannot be modified");
}
/**
* Rebind an object in the namespace. Rebinds the reference to the
* actual object in either the cosnaming or serial context.
*
* @throws NamingException if there is a naming exception.
*/
throw new NamingException("java:comp namespace cannot be modified");
}
/**
* Rebind an object in the namespace. Rebinds the reference to the
* actual object in either the cosnaming or serial context.
*
* @throws NamingException if there is a naming exception.
*/
throw new NamingException("java:comp namespace cannot be modified");
}
/**
* Unbind an object from the namespace.
*
* @throws NamingException if there is a naming exception.
*/
throw new NamingException("java:comp namespace cannot be modified");
}
/**
* Unbind an object from the namespace.
*
* @throws NamingException if there is a naming exception.
*/
throw new NamingException("java:comp namespace cannot be modified");
}
/**
* The rename operation is not supported by this context. It throws
* an OperationNotSupportedException.
*/
throw new NamingException("java:comp namespace cannot be modified");
}
/**
* The rename operation is not supported by this context. It throws
* an OperationNotSupportedException.
*/
throws NamingException {
throw new NamingException("java:comp namespace cannot be modified");
}
/**
* The destroySubcontext operation is not supported by this context.
* It throws an OperationNotSupportedException.
*/
throw new NamingException("java:comp namespace cannot be modified");
}
/**
* The destroySubcontext operation is not supported by this context.
* It throws an OperationNotSupportedException.
*/
throw new NamingException("java:comp namespace cannot be modified");
}
throw new NamingException("java:comp namespace cannot be modified");
}
throw new NamingException("java:comp namespace cannot be modified");
}
/**
* Lists the contents of a context or subcontext. The operation is
* delegated to the serial context.
*
* @return an enumeration of the contents of the context.
* @throws NamingException if there is a naming exception.
*/
throws NamingException {
// listing this context
if (namingManager == null)
throw new NamingException();
}
// Check if 'name' names a context
}
}
/**
* Lists the contents of a context or subcontext. The operation is
* delegated to the serial context.
*
* @return an enumeration of the contents of the context.
* @throws NamingException if there is a naming exception.
*/
throws NamingException {
// Flat namespace; no federation; just call string version
}
/**
* Lists the bindings of a context or subcontext. The operation is
* delegated to the serial context.
*
* @return an enumeration of the bindings of the context.
* @throws NamingException if there is a naming exception.
*/
throws NamingException {
// listing this context
if (namingManager == null)
throw new NamingException();
}
// Perhaps 'name' names a context
}
}
/**
* Lists the bindings of a context or subcontext. The operation is
* delegated to the serial context.
*
* @return an enumeration of the bindings of the context.
* @throws NamingException if there is a naming exception.
*/
throws NamingException {
// Flat namespace; no federation; just call string version
}
/**
* This context does not treat links specially. A lookup operation is
* performed.
*/
// This flat context does not treat links specially
}
/**
* This context does not treat links specially. A lookup operation is
* performed.
*/
// Flat namespace; no federation; just call string version
}
/**
* Return the name parser for the specified name.
*
* @return the NameParser instance.
* @throws NamingException if there is an exception.
*/
throws NamingException {
if (namingManager == null)
throw new NamingException();
return namingManager.getNameParser();
}
/**
* Return the name parser for the specified name.
*
* @return the NameParser instance.
* @throws NamingException if there is an exception.
*/
// Flat namespace; no federation; just call string version
}
throws NamingException {
new CompositeName(prefix));
}
throws NamingException {
return result;
}
/**
* Add a property to the environment.
*/
throws NamingException {
}
}
/**
* Remove a property from the environment.
*/
throws NamingException {
return null;
}
}
/**
* Get the context's environment.
*/
// Must return non-null
}
return myEnv;
}
/**
* New JNDI 1.2 operation.
*/
}
/**
* 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;
}
}