Home » geronimo-2.2-source-release » org.apache.geronimo.naming.java » [javadoc | source]

    1   /**
    2    *
    3    * Copyright 2003-2004 The Apache Software Foundation
    4    *
    5    *  Licensed under the Apache License, Version 2.0 (the "License");
    6    *  you may not use this file except in compliance with the License.
    7    *  You may obtain a copy of the License at
    8    *
    9    *     http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    *  Unless required by applicable law or agreed to in writing, software
   12    *  distributed under the License is distributed on an "AS IS" BASIS,
   13    *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    *  See the License for the specific language governing permissions and
   15    *  limitations under the License.
   16    */
   17   
   18   package org.apache.geronimo.naming.java;
   19   
   20   import java.util.Hashtable;
   21   import javax.naming.Context;
   22   import javax.naming.Name;
   23   import javax.naming.OperationNotSupportedException;
   24   import javax.naming.spi.ObjectFactory;
   25   
   26   /**
   27    * URLContextFactory for the java: JNDI namespace.
   28    *
   29    * @version $Rev: 126558 $ $Date: 2005-01-26 15:13:09 -0800 (Wed, 26 Jan 2005) $
   30    */
   31   public class javaURLContextFactory implements ObjectFactory {
   32       /**
   33        * Return a Context that is able to resolve names in the java: namespace.
   34        * The root context, "java:" is always returned. This is a specific
   35        * implementation of a URLContextFactory and not a general ObjectFactory.
   36        * @param obj must be null
   37        * @param name ignored
   38        * @param nameCtx ignored
   39        * @param environment ignored
   40        * @return the Context for "java:"
   41        * @throws javax.naming.OperationNotSupportedException if obj is not null
   42        */
   43       public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws Exception {
   44           if (obj == null) {
   45               return new RootContext();
   46           } else {
   47               throw new OperationNotSupportedException();
   48           }
   49       }
   50   }

Home » geronimo-2.2-source-release » org.apache.geronimo.naming.java » [javadoc | source]