You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ml...@apache.org on 2006/06/01 13:04:08 UTC

svn commit: r410836 [2/2] - /incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/InitialContextFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/InitialContextFactory.java?rev=410836&r1=410835&r2=410836&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/InitialContextFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/InitialContextFactory.java Thu Jun  1 04:04:07 2006
@@ -11,43 +11,43 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
-
-
-package javax.naming.spi;
-
-import java.util.Hashtable;
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-/**
- * An implementation of <code>InitialContextFactory</code> creates an initial 
- * context so that the JNDI application can begin to invoke naming operations 
- * on that context. The class implementing this interface should be public and 
- * should also provide a public constructor taking no arguments.
- * 
- */
-public interface InitialContextFactory {
-
-    /*
-     * -------------------------------------------------------------------
-     * Methods
-     * -------------------------------------------------------------------
-     */
-
-    /**
-     * Returns a non-null initial context object on which naming operations can be
-     * invoked. The specified <code>envmt</code> parameter may be null or may be 
-     * used to customise the requested <code>Context</code> object.  The 
-     * implementation may clone or copy the <code>envmt</code> object, 
-     * but will not modify the original object.
-     * 
-     * @param envmt the context environment as a <code>Hashtable</code>
-     * @return a non-null initial context object
-     * @throws NamingException if a naming exception occurs
-     */
-    Context getInitialContext(Hashtable envmt) throws NamingException;
-
-}
-
-
+ */
+
+
+package javax.naming.spi;
+
+import java.util.Hashtable;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+/**
+ * An implementation of <code>InitialContextFactory</code> creates an initial 
+ * context so that the JNDI application can begin to invoke naming operations 
+ * on that context. The class implementing this interface should be public and 
+ * should also provide a public constructor taking no arguments.
+ * 
+ */
+public interface InitialContextFactory {
+
+    /*
+     * -------------------------------------------------------------------
+     * Methods
+     * -------------------------------------------------------------------
+     */
+
+    /**
+     * Returns a non-null initial context object on which naming operations can be
+     * invoked. The specified <code>envmt</code> parameter may be null or may be 
+     * used to customise the requested <code>Context</code> object.  The 
+     * implementation may clone or copy the <code>envmt</code> object, 
+     * but will not modify the original object.
+     * 
+     * @param envmt the context environment as a <code>Hashtable</code>
+     * @return a non-null initial context object
+     * @throws NamingException if a naming exception occurs
+     */
+    Context getInitialContext(Hashtable<?, ?> envmt) throws NamingException;
+
+}
+
+

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/InitialContextFactoryBuilder.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/InitialContextFactoryBuilder.java?rev=410836&r1=410835&r2=410836&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/InitialContextFactoryBuilder.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/InitialContextFactoryBuilder.java Thu Jun  1 04:04:07 2006
@@ -11,46 +11,46 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
-
-
-package javax.naming.spi;
-
-import java.util.Hashtable;
-import javax.naming.NamingException;
-
-/**
- * An initial context factory builder creates an initial context factory, and
- * an initial context factory creates initial contexts. A variety of different
- * initial context implementations may be used by a JNDI application. The
- * application uses <code>NamingManager.setInitialContextFactoryBuilder()</code> 
- * to specify its own or its preferred builder to override JNDI default policies.
- * Any such builder must implement the <code>InitialContextFactoryBuilder</code>
- * interface.
- * 
- */
-public interface InitialContextFactoryBuilder {
-
-    /*
-     * -------------------------------------------------------------------
-     * Methods
-     * -------------------------------------------------------------------
-     */
-
-    /**
-     * Uses the environment properties in the specified <code>envmt</code> 
-     * parameter to create an initial context factory. If the implementation 
-     * needs to keep a copy of <code>envmt</code> or to change it, it will 
-     * clone or copy the specified object and use that instead.
-     * The <code>envmt</code> parameter may be null.
-     * 
-     * @param envmt the context environment as a <code>Hashtable</code>
-     * @return an initial context factory - cannot be null.
-     * @throws NamingException if an initial context factory could not be created.
-     */
-    InitialContextFactory createInitialContextFactory(Hashtable envmt)
-        throws NamingException;
-
-}
-
-
+ */
+
+
+package javax.naming.spi;
+
+import java.util.Hashtable;
+import javax.naming.NamingException;
+
+/**
+ * An initial context factory builder creates an initial context factory, and
+ * an initial context factory creates initial contexts. A variety of different
+ * initial context implementations may be used by a JNDI application. The
+ * application uses <code>NamingManager.setInitialContextFactoryBuilder()</code> 
+ * to specify its own or its preferred builder to override JNDI default policies.
+ * Any such builder must implement the <code>InitialContextFactoryBuilder</code>
+ * interface.
+ * 
+ */
+public interface InitialContextFactoryBuilder {
+
+    /*
+     * -------------------------------------------------------------------
+     * Methods
+     * -------------------------------------------------------------------
+     */
+
+    /**
+     * Uses the environment properties in the specified <code>envmt</code> 
+     * parameter to create an initial context factory. If the implementation 
+     * needs to keep a copy of <code>envmt</code> or to change it, it will 
+     * clone or copy the specified object and use that instead.
+     * The <code>envmt</code> parameter may be null.
+     * 
+     * @param envmt the context environment as a <code>Hashtable</code>
+     * @return an initial context factory - cannot be null.
+     * @throws NamingException if an initial context factory could not be created.
+     */
+    InitialContextFactory createInitialContextFactory(Hashtable<?, ?> envmt)
+        throws NamingException;
+
+}
+
+

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/NamingManager.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/NamingManager.java?rev=410836&r1=410835&r2=410836&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/NamingManager.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/NamingManager.java Thu Jun  1 04:04:07 2006
@@ -415,9 +415,9 @@
                 .getFactoryNamesFromEnvironmentAndProviderResource(h, c,
                         Context.URL_PKG_PREFIXES);
         // for each RefAddr
-        Enumeration enumeration = ref.getAll();
+        Enumeration<RefAddr> enumeration = ref.getAll();
         while (enumeration.hasMoreElements()) {
-            RefAddr addr = (RefAddr) enumeration.nextElement();
+            RefAddr addr = enumeration.nextElement();
             // if it is StringRefAddr and type is URL
             if (addr instanceof StringRefAddr
                     && addr.getType().equalsIgnoreCase("URL")) { //$NON-NLS-1$
@@ -577,7 +577,8 @@
      * @throws NamingException
      *             if one is encountered
      */
-    public static Object getStateToBind(Object o, Name n, Context c, Hashtable h)
+    public static Object getStateToBind(Object o, Name n,
+                                        Context c, Hashtable<?, ?> h)
             throws NamingException {
 
         // obtain state factories from hashtable and service provider resource

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/ObjectFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/ObjectFactory.java?rev=410836&r1=410835&r2=410836&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/ObjectFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/ObjectFactory.java Thu Jun  1 04:04:07 2006
@@ -11,98 +11,98 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
-
-
-package javax.naming.spi;
-
-import java.util.Hashtable;
-import javax.naming.Name;
-import javax.naming.Context;
-
-/**
- * An <code>ObjectFactory</code> creates objects of a specified type. A variety
- * of different objects may be used by a JNDI application; these objects are
- * meaningful to the application and can be manipulated according to the
- * methods available to the class of the object, such as a printer object.
- * The class implementing this interface should be public, should also provide
- * a public constructor taking no arguments, and should be thread-safe. Where
- * URL is mentioned below, this refers to RFC 1738 and related RFCs.
- *  
- */
-public interface ObjectFactory {
-
-    /*
-     * -------------------------------------------------------------------
-     * Methods
-     * -------------------------------------------------------------------
-     */
-
-    /**
-     * Creates an object of the type specified by parameter <code>o</code>, 
-     * including any reference or location details, customised by the specified
-     * <code>envmt</code> parameter. 
-     * <p>
-     * Object factories are specified via environment properties from several
-     * sources including provider properties files (see the specification of 
-     * the <code>Context</code> interface) and may comprise a list of factories. 
-     * Each object factory in the list is used by 
-     * <code>NamingManager.getObjectInstance()</code> which invokes this method 
-     * on each of them until a non-null result is achieved or until the list is 
-     * exhausted. If an <code>ObjectFactory</code> throws an exception, it 
-     * should be passed back to the code that invoked
-     * <code>NamingManager.getObjectInstance()</code> and no further object 
-     * factories in the list are examined. An exception should only be thrown 
-     * by an object factory if it is intended that no other object factories 
-     * be examined. Usually, if an <code>ObjectFactory</code> is unable to 
-     * create an object, then null should be returned.</p>
-     * <p>
-     * A special case of <code>ObjectFactory</code> is a URL context factory 
-     * which is used either to create an object whose location is specified by 
-     * a URL passed as the object <code>o</code> or creates contexts for 
-     * resolving URLs. The <code>getObjectInstance()</code> method of a URL
-     * context factory must obey these rules:</p>
-     * <p>
-     * 1. When <code>Object o</code> is null, return a new Context object 
-     * suitable for resolving any URL of the scheme supported by this factory.</p>
-     * <p>
-     * 2. When <code>Object o</code> is a URL string, return a new object 
-     * (usually a context) identified by the URL, so that names relatively 
-     * lower than that context may be resolved. </p>
-     * <p>
-     * 3. When <code>Object o</code> is an <code>Array</code> object with more 
-     * than one URL string (order is not important), return a new object 
-     * (usually a context) identified by the URL as in rule 2, above. The URLs 
-     * in the array are considered to be equivalent in relation to the 
-     * associated context, but the object (context) factory can choose whether 
-     * or not to verify that they are truly equivalent.</p>
-     * <p>
-     * 4. Otherwise, the behaviour of this method depends on the context 
-     * factory implementation.</p>
-     * 
-     * @param o     may be null or may contain location or reference details
-     * @param n     the name relative to the context <code>c</code> of the 
-     *              object being created and may be null; the implementation 
-     *              may clone or copy this object, but will not modify the 
-     *              original.
-     * @param c     may be null when the name is relative to the default 
-     *              initial context, or specifies the context to which the 
-     *              name is relative (if a factory uses this context object, 
-     *              synchronization should be used as Context objects are not
-     *              thread-safe).
-     * @param envmt may be null; the implementation may clone or copy this 
-     *              object, but will not modify the original.
-     * @return      either an object of the specified type or null if no 
-     *              object could be created.
-     * @throws Exception causes no further object factory will be tried
-     */
-    Object getObjectInstance(
-        Object o,
-        Name n,
-        Context c,
-        Hashtable envmt)
-        throws Exception;
-
-}
-
-
+ */
+
+
+package javax.naming.spi;
+
+import java.util.Hashtable;
+import javax.naming.Name;
+import javax.naming.Context;
+
+/**
+ * An <code>ObjectFactory</code> creates objects of a specified type. A variety
+ * of different objects may be used by a JNDI application; these objects are
+ * meaningful to the application and can be manipulated according to the
+ * methods available to the class of the object, such as a printer object.
+ * The class implementing this interface should be public, should also provide
+ * a public constructor taking no arguments, and should be thread-safe. Where
+ * URL is mentioned below, this refers to RFC 1738 and related RFCs.
+ *  
+ */
+public interface ObjectFactory {
+
+    /*
+     * -------------------------------------------------------------------
+     * Methods
+     * -------------------------------------------------------------------
+     */
+
+    /**
+     * Creates an object of the type specified by parameter <code>o</code>, 
+     * including any reference or location details, customised by the specified
+     * <code>envmt</code> parameter. 
+     * <p>
+     * Object factories are specified via environment properties from several
+     * sources including provider properties files (see the specification of 
+     * the <code>Context</code> interface) and may comprise a list of factories. 
+     * Each object factory in the list is used by 
+     * <code>NamingManager.getObjectInstance()</code> which invokes this method 
+     * on each of them until a non-null result is achieved or until the list is 
+     * exhausted. If an <code>ObjectFactory</code> throws an exception, it 
+     * should be passed back to the code that invoked
+     * <code>NamingManager.getObjectInstance()</code> and no further object 
+     * factories in the list are examined. An exception should only be thrown 
+     * by an object factory if it is intended that no other object factories 
+     * be examined. Usually, if an <code>ObjectFactory</code> is unable to 
+     * create an object, then null should be returned.</p>
+     * <p>
+     * A special case of <code>ObjectFactory</code> is a URL context factory 
+     * which is used either to create an object whose location is specified by 
+     * a URL passed as the object <code>o</code> or creates contexts for 
+     * resolving URLs. The <code>getObjectInstance()</code> method of a URL
+     * context factory must obey these rules:</p>
+     * <p>
+     * 1. When <code>Object o</code> is null, return a new Context object 
+     * suitable for resolving any URL of the scheme supported by this factory.</p>
+     * <p>
+     * 2. When <code>Object o</code> is a URL string, return a new object 
+     * (usually a context) identified by the URL, so that names relatively 
+     * lower than that context may be resolved. </p>
+     * <p>
+     * 3. When <code>Object o</code> is an <code>Array</code> object with more 
+     * than one URL string (order is not important), return a new object 
+     * (usually a context) identified by the URL as in rule 2, above. The URLs 
+     * in the array are considered to be equivalent in relation to the 
+     * associated context, but the object (context) factory can choose whether 
+     * or not to verify that they are truly equivalent.</p>
+     * <p>
+     * 4. Otherwise, the behaviour of this method depends on the context 
+     * factory implementation.</p>
+     * 
+     * @param o     may be null or may contain location or reference details
+     * @param n     the name relative to the context <code>c</code> of the 
+     *              object being created and may be null; the implementation 
+     *              may clone or copy this object, but will not modify the 
+     *              original.
+     * @param c     may be null when the name is relative to the default 
+     *              initial context, or specifies the context to which the 
+     *              name is relative (if a factory uses this context object, 
+     *              synchronization should be used as Context objects are not
+     *              thread-safe).
+     * @param envmt may be null; the implementation may clone or copy this 
+     *              object, but will not modify the original.
+     * @return      either an object of the specified type or null if no 
+     *              object could be created.
+     * @throws Exception causes no further object factory will be tried
+     */
+    Object getObjectInstance(
+        Object o,
+        Name n,
+        Context c,
+        Hashtable<?, ?> envmt)
+        throws Exception;
+
+}
+
+

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/ObjectFactoryBuilder.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/ObjectFactoryBuilder.java?rev=410836&r1=410835&r2=410836&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/ObjectFactoryBuilder.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/ObjectFactoryBuilder.java Thu Jun  1 04:04:07 2006
@@ -11,48 +11,48 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
-
-
-package javax.naming.spi;
-
-import java.util.Hashtable;
-import javax.naming.NamingException;
-
-/**
- * An object factory builder creates an object factory, and an object factory
- * creates objects of a specified type. A variety of different objects may be
- * used by a JNDI application; these objects are meaningful to the application
- * and can be manipulated according to the methods available to the class of
- * the object, such as a printer object. The application uses
- * <code>NamingManager.setObjectFactoryBuilder()</code> to specify its own or 
- * its preferred builder to override JNDI default policies; any such builder 
- * must implement the <code>ObjectFactoryBuilder</code> interface.
- * 
- */
-public interface ObjectFactoryBuilder {
-
-    /*
-     * -------------------------------------------------------------------
-     * Methods
-     * -------------------------------------------------------------------
-     */
-
-    /**
-     * Returns an <code>ObjectFactory</code> customised by the 
-     * <code>envmt</code> parameter that is capable of creating instances
-     * of the object <code>o</code>. 
-     * 
-     * @param o     may be null
-     * @param envmt may be null
-     * @return      an <code>ObjectFactory</code> customised by the 
-     *              <code>envmt</code> parameter that is capable of creating
-     *              instances of the object <code>o</code>. 
-     * @throws NamingException if an object factory could not be created.
-     */
-    ObjectFactory createObjectFactory(Object o, Hashtable envmt)
-        throws NamingException;
-
-}
-
-
+ */
+
+
+package javax.naming.spi;
+
+import java.util.Hashtable;
+import javax.naming.NamingException;
+
+/**
+ * An object factory builder creates an object factory, and an object factory
+ * creates objects of a specified type. A variety of different objects may be
+ * used by a JNDI application; these objects are meaningful to the application
+ * and can be manipulated according to the methods available to the class of
+ * the object, such as a printer object. The application uses
+ * <code>NamingManager.setObjectFactoryBuilder()</code> to specify its own or 
+ * its preferred builder to override JNDI default policies; any such builder 
+ * must implement the <code>ObjectFactoryBuilder</code> interface.
+ * 
+ */
+public interface ObjectFactoryBuilder {
+
+    /*
+     * -------------------------------------------------------------------
+     * Methods
+     * -------------------------------------------------------------------
+     */
+
+    /**
+     * Returns an <code>ObjectFactory</code> customised by the 
+     * <code>envmt</code> parameter that is capable of creating instances
+     * of the object <code>o</code>. 
+     * 
+     * @param o     may be null
+     * @param envmt may be null
+     * @return      an <code>ObjectFactory</code> customised by the 
+     *              <code>envmt</code> parameter that is capable of creating
+     *              instances of the object <code>o</code>. 
+     * @throws NamingException if an object factory could not be created.
+     */
+    ObjectFactory createObjectFactory(Object o, Hashtable<?, ?> envmt)
+        throws NamingException;
+
+}
+
+

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/Resolver.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/Resolver.java?rev=410836&r1=410835&r2=410836&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/Resolver.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/Resolver.java Thu Jun  1 04:04:07 2006
@@ -11,65 +11,67 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
-
-
-package javax.naming.spi;
-
-import javax.naming.Name;
-import javax.naming.NamingException;
-
-/**
- * The <code>Resolver</code> interface describes an intermediate context which
- * may be used in name resolution. In some context implementations, it is 
- * possible that subtypes of <code>Context</code> may not be supported; in such
- * cases, a class implementing the <code>Resolver</code> interface becomes 
- * useful to obtain a context which is of a specified subtype of 
- * <code>Context</code>.
- * 
- */
-public interface Resolver {
-
-    /*
-     * -------------------------------------------------------------------
-     * Methods
-     * -------------------------------------------------------------------
-     */
-
-    /**
-     * Partially resolves the name specified by name <code>n</code> stopping 
-     * at the first context object which is of the <code>Context</code> subtype 
-     * specified by class <code>c</code>.
-     * 
-     * @param n a name
-     * @param c a context
-     * @return  details of the resolved context object and the part of the name
-     *          remaining to be resolved in a non-null <code>ResolveResult</code>
-     *          object.
-     * @throws javax.naming.NotContextException if no context of the specified subtype is 
-     *          found.
-     * @throws NamingException if other naming errors occur
-     */
-    ResolveResult resolveToClass(Name n, Class c)
-        throws NamingException;
-
-    /**
-     * Partially resolves the name specified by name <code>n</code> stopping 
-     * at the first context object which is of the <code>Context</code> subtype 
-     * specified by class <code>c</code>.
-     * 
-     * @param n a name in string
-     * @param c a context
-     * @return  details of the resolved context object and the part of the name
-     *          remaining to be resolved in a non-null <code>ResolveResult</code>
-     *          object.
-     * @throws javax.naming.NotContextException if no context of the specified subtype is 
-     *          found.
-     * @throws NamingException if other naming errors occur
-     */
-    ResolveResult resolveToClass(String n, Class c)
-        throws NamingException;
-
-}
-
-
+ */
+
+
+package javax.naming.spi;
+
+import javax.naming.Name;
+import javax.naming.NamingException;
+
+/**
+ * The <code>Resolver</code> interface describes an intermediate context which
+ * may be used in name resolution. In some context implementations, it is 
+ * possible that subtypes of <code>Context</code> may not be supported; in such
+ * cases, a class implementing the <code>Resolver</code> interface becomes 
+ * useful to obtain a context which is of a specified subtype of 
+ * <code>Context</code>.
+ * 
+ */
+public interface Resolver {
+
+    /*
+     * -------------------------------------------------------------------
+     * Methods
+     * -------------------------------------------------------------------
+     */
+
+    /**
+     * Partially resolves the name specified by name <code>n</code> stopping 
+     * at the first context object which is of the <code>Context</code> subtype 
+     * specified by class <code>c</code>.
+     * 
+     * @param n a name
+     * @param c a context
+     * @return  details of the resolved context object and the part of the name
+     *          remaining to be resolved in a non-null <code>ResolveResult</code>
+     *          object.
+     * @throws javax.naming.NotContextException if no context of the specified subtype is 
+     *          found.
+     * @throws NamingException if other naming errors occur
+     */
+    ResolveResult resolveToClass(Name n,
+                                 Class<? extends javax.naming.Context> c)
+        throws NamingException;
+
+    /**
+     * Partially resolves the name specified by name <code>n</code> stopping 
+     * at the first context object which is of the <code>Context</code> subtype 
+     * specified by class <code>c</code>.
+     * 
+     * @param n a name in string
+     * @param c a context
+     * @return  details of the resolved context object and the part of the name
+     *          remaining to be resolved in a non-null <code>ResolveResult</code>
+     *          object.
+     * @throws javax.naming.NotContextException if no context of the specified subtype is 
+     *          found.
+     * @throws NamingException if other naming errors occur
+     */
+    ResolveResult resolveToClass(String n,
+                                 Class<? extends javax.naming.Context> c)
+        throws NamingException;
+
+}
+
+

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/StateFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/StateFactory.java?rev=410836&r1=410835&r2=410836&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/StateFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/StateFactory.java Thu Jun  1 04:04:07 2006
@@ -11,88 +11,88 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
-
-
-package javax.naming.spi;
-
-import java.util.Hashtable;
-import javax.naming.Name;
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-/**
- * The <code>StateFactory</code> interface describes a factory used to get 
- * the state of an object to be bound. Using a <code>lookup()</code> on a 
- * suitable context, an class may be found representing, say, a printer; 
- * an <code>ObjectFactory</code> may be used to create an instance of the 
- * printer object class and methods defined by the printer class may be used 
- * to inspect and manipulate the printer. There is a reverse mechanism in 
- * which a <code>StateFactory</code> is used by the service provider
- * to obtain the state of the (in this case) printer for storing in the 
- * naming system. In addition to implementing this interface, a 
- * <code>StateFactory</code> class must be public and have a public 
- * constructor taking no parameters.
- * <p>
- * Note that while <code>StateFactory</code> is meant to be used in 
- * <code>Context</code> service providers, whereas <code>DirStateFactory</code>
- * is meant to be used in <code>DirContext</code> service providers.</p>
- *
- */
-public interface StateFactory {
-
-    /*
-     * -------------------------------------------------------------------
-     * Methods
-     * -------------------------------------------------------------------
-     */
-
-    /**
-     * Returns a new instance of the specified object <code>o</code> 
-     * containing the state of the object to be bound, customised by the 
-     * specified <code>envmt</code> parameter. The name and context 
-     * parameters optionally specify the name of the object being created. 
-     * 
-     * Object and state factories are specified via environment properties 
-     * from several sources including provider properties files (see the 
-     * specification of the <code>Context</code> interface) and may comprise 
-     * a list of factories. When the service provider looks to obtain the list
-     * of state factories, the environment and provider properties files are 
-     * search for the property name specified by constant
-     * <code>Context.STATE_FACTORIES</code>. Each state factory in the
-     * resulting list is used by <code>NamingManager.getStateToBind()</code> 
-     * which invokes this method on each of them until a non-null result is 
-     * achieved or until the list is exhausted. If a <code>StatetFactory</code>
-     * throws an exception, it should be passed back to the code that 
-     * invoked <code>NamingManager.getStateToBind()</code> and no further 
-     * state factories in the list are examined. An exception should only be 
-     * thrown by a state factory if it is intended that no other state 
-     * factories be examined. Usually, if an state factory is unable to
-     * return the state of an object, then null should be returned.
-     * 
-     * @param o     may be null, or specifies the returning instance
-     * @param n     may be null, or specifies the name relative to the 
-     *              specified context <code>c</code>. The implementation 
-     *              may clone or copy this object, but will not modify the 
-     *              original.
-     * @param c     the context to which the name parameter is relative, or 
-     *              may be null when using a name relative the the default 
-     *              initial context. If a factory uses this context object, 
-     *              synchronization should be used as context objects are 
-     *              not thread-safe.
-     * @param envmt may be null; the implementation may clone or copy this 
-     *              object, but will not modify the original.
-     * @return      either a new instance of the specified object 
-     *              <code>o</code> containing the state of the object to be 
-     *              bound, customised by the specified 
-     *              <code>envmt</code> parameter. Or null if no object could 
-     *              be created.
-     * @throws NamingException if it is intended that no other state 
-     *              factories be examined.
-     */
-    Object getStateToBind(Object o, Name n, Context c, Hashtable envmt)
-        throws NamingException;
-
-}
-
-
+ */
+
+
+package javax.naming.spi;
+
+import java.util.Hashtable;
+import javax.naming.Name;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+/**
+ * The <code>StateFactory</code> interface describes a factory used to get 
+ * the state of an object to be bound. Using a <code>lookup()</code> on a 
+ * suitable context, an class may be found representing, say, a printer; 
+ * an <code>ObjectFactory</code> may be used to create an instance of the 
+ * printer object class and methods defined by the printer class may be used 
+ * to inspect and manipulate the printer. There is a reverse mechanism in 
+ * which a <code>StateFactory</code> is used by the service provider
+ * to obtain the state of the (in this case) printer for storing in the 
+ * naming system. In addition to implementing this interface, a 
+ * <code>StateFactory</code> class must be public and have a public 
+ * constructor taking no parameters.
+ * <p>
+ * Note that while <code>StateFactory</code> is meant to be used in 
+ * <code>Context</code> service providers, whereas <code>DirStateFactory</code>
+ * is meant to be used in <code>DirContext</code> service providers.</p>
+ *
+ */
+public interface StateFactory {
+
+    /*
+     * -------------------------------------------------------------------
+     * Methods
+     * -------------------------------------------------------------------
+     */
+
+    /**
+     * Returns a new instance of the specified object <code>o</code> 
+     * containing the state of the object to be bound, customised by the 
+     * specified <code>envmt</code> parameter. The name and context 
+     * parameters optionally specify the name of the object being created. 
+     * 
+     * Object and state factories are specified via environment properties 
+     * from several sources including provider properties files (see the 
+     * specification of the <code>Context</code> interface) and may comprise 
+     * a list of factories. When the service provider looks to obtain the list
+     * of state factories, the environment and provider properties files are 
+     * search for the property name specified by constant
+     * <code>Context.STATE_FACTORIES</code>. Each state factory in the
+     * resulting list is used by <code>NamingManager.getStateToBind()</code> 
+     * which invokes this method on each of them until a non-null result is 
+     * achieved or until the list is exhausted. If a <code>StatetFactory</code>
+     * throws an exception, it should be passed back to the code that 
+     * invoked <code>NamingManager.getStateToBind()</code> and no further 
+     * state factories in the list are examined. An exception should only be 
+     * thrown by a state factory if it is intended that no other state 
+     * factories be examined. Usually, if an state factory is unable to
+     * return the state of an object, then null should be returned.
+     * 
+     * @param o     may be null, or specifies the returning instance
+     * @param n     may be null, or specifies the name relative to the 
+     *              specified context <code>c</code>. The implementation 
+     *              may clone or copy this object, but will not modify the 
+     *              original.
+     * @param c     the context to which the name parameter is relative, or 
+     *              may be null when using a name relative the the default 
+     *              initial context. If a factory uses this context object, 
+     *              synchronization should be used as context objects are 
+     *              not thread-safe.
+     * @param envmt may be null; the implementation may clone or copy this 
+     *              object, but will not modify the original.
+     * @return      either a new instance of the specified object 
+     *              <code>o</code> containing the state of the object to be 
+     *              bound, customised by the specified 
+     *              <code>envmt</code> parameter. Or null if no object could 
+     *              be created.
+     * @throws NamingException if it is intended that no other state 
+     *              factories be examined.
+     */
+    Object getStateToBind(Object o, Name n, Context c, Hashtable<?, ?> envmt)
+        throws NamingException;
+
+}
+
+