APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.naming.internal

public final Class VersionHelper

extends Object
Class Inheritance
Imports
javax.naming.NamingEnumeration, java.io.IOException, .InputStream, java.net.URL, java.nio.file.Files, .Path, java.util.*

VersionHelper was used by JNDI to accommodate differences between JDK 1.1.x and the Java 2 platform. As this is no longer necessary since JNDI's inclusion in the platform, this class currently serves as a set of utilities for performing system-level things, such as class-loading and reading system properties.
Authors
Rosanna Lee, Scott Seligman

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
VersionHelper.InputStreamEnumeration

Given an enumeration of URLs, an instance of this class represents an enumeration of their InputStreams.

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
private static final VersionHelper
public static final int
public static final int
pack-priv static final String[]
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv ClassLoader
getContextClassLoader()

Package private.

pack-priv InputStream
pack-priv String[]
pack-priv String
pack-priv InputStream
pack-priv NamingEnumeration<InputStream>
public static VersionHelper
public Class<?>
loadClass(String className)

pack-priv Class<?>
loadClass(String className, boolean initialize, ClassLoader cl)

Package private.

pack-priv Class<?>
loadClass(String className, ClassLoader cl)

public Class<?>
private static String
resolveName(Class<?> c, String name)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONTROL_FACTORIESback to summary
public static final int CONTROL_FACTORIES
DNS_URLback to summary
public static final int DNS_URL
helperback to summary
private static final VersionHelper helper
INITIAL_CONTEXT_FACTORYback to summary
public static final int INITIAL_CONTEXT_FACTORY
OBJECT_FACTORIESback to summary
public static final int OBJECT_FACTORIES
PROPSback to summary
pack-priv static final String[] PROPS
PROVIDER_URLback to summary
public static final int PROVIDER_URL
STATE_FACTORIESback to summary
public static final int STATE_FACTORIES
URL_PKG_PREFIXESback to summary
public static final int URL_PKG_PREFIXES

Constructor Detail

VersionHelperback to summary
private VersionHelper()

Method Detail

getContextClassLoaderback to summary
pack-priv ClassLoader getContextClassLoader()

Package private.

This internal method returns Thread Context Class Loader (TCCL), if null, returns the system Class Loader.

Please don't expose this method as public.

Exceptions
SecurityException:
if the class loader is not accessible
getJavaHomeConfStreamback to summary
pack-priv InputStream getJavaHomeConfStream(String filename)
getJndiPropertiesback to summary
pack-priv String[] getJndiProperties()
getJndiPropertyback to summary
pack-priv String getJndiProperty(int i)
getResourceAsStreamback to summary
pack-priv InputStream getResourceAsStream(Class<?> c, String name)
getResourcesback to summary
pack-priv NamingEnumeration<InputStream> getResources(ClassLoader cl, String name) throws IOException
getVersionHelperback to summary
public static VersionHelper getVersionHelper()
loadClassback to summary
public Class<?> loadClass(String className) throws ClassNotFoundException
loadClassback to summary
pack-priv Class<?> loadClass(String className, boolean initialize, ClassLoader cl) throws ClassNotFoundException

Package private.

This internal method is used with Thread Context Class Loader (TCCL), please don't expose this method as public.

loadClassback to summary
pack-priv Class<?> loadClass(String className, ClassLoader cl) throws ClassNotFoundException
loadClassWithoutInitback to summary
public Class<?> loadClassWithoutInit(String className) throws ClassNotFoundException
resolveNameback to summary
private static String resolveName(Class<?> c, String name)
com.sun.naming.internal back to summary

private Class VersionHelper.InputStreamEnumeration

extends Object
implements NamingEnumeration<InputStream>
Class Inheritance
All Implemented Interfaces
javax.naming.NamingEnumeration, java.util.Enumeration

Given an enumeration of URLs, an instance of this class represents an enumeration of their InputStreams.

Field Summary

Modifier and TypeField and Description
private InputStream
private final Enumeration<URL>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements javax.naming.NamingEnumeration.close.

Closes this enumeration.

private InputStream
public boolean
hasMore()

Implements javax.naming.NamingEnumeration.hasMore.

Determines whether there are any more elements in the enumeration.

public boolean
hasMoreElements()

Implements java.util.Enumeration.hasMoreElements.

Tests if this enumeration contains more elements.

public InputStream
next()

Implements javax.naming.NamingEnumeration.next.

Retrieves the next element in the enumeration.

public InputStream
nextElement()

Implements java.util.Enumeration.nextElement.

Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nextElementback to summary
private InputStream nextElement
urlsback to summary
private final Enumeration<URL> urls

Constructor Detail

InputStreamEnumerationback to summary
pack-priv InputStreamEnumeration(Enumeration<URL> urls)

Method Detail

closeback to summary
public void close()

Implements javax.naming.NamingEnumeration.close.

Doc from javax.naming.NamingEnumeration.close.

Closes this enumeration. After this method has been invoked on this enumeration, the enumeration becomes invalid and subsequent invocation of any of its methods will yield undefined results. This method is intended for aborting an enumeration to free up resources. If an enumeration proceeds to the end--that is, until hasMoreElements() or hasMore() returns false-- resources will be freed up automatically and there is no need to explicitly call close().

This method indicates to the service provider that it is free to release resources associated with the enumeration, and can notify servers to cancel any outstanding requests. The close() method is a hint to implementations for managing their resources. Implementations are encouraged to use appropriate algorithms to manage their resources when client omits the close() calls.

getNextElementback to summary
private InputStream getNextElement()
hasMoreback to summary
public boolean hasMore()

Implements javax.naming.NamingEnumeration.hasMore.

Doc from javax.naming.NamingEnumeration.hasMore.

Determines whether there are any more elements in the enumeration. This method allows naming exceptions encountered while determining whether there are more elements to be caught and handled by the application.

hasMoreElementsback to summary
public boolean hasMoreElements()

Implements java.util.Enumeration.hasMoreElements.

Doc from java.util.Enumeration.hasMoreElements.

Tests if this enumeration contains more elements.

nextback to summary
public InputStream next()

Implements javax.naming.NamingEnumeration.next.

Doc from javax.naming.NamingEnumeration.next.

Retrieves the next element in the enumeration. This method allows naming exceptions encountered while retrieving the next element to be caught and handled by the application.

Note that next() can also throw the runtime exception NoSuchElementException to indicate that the caller is attempting to enumerate beyond the end of the enumeration. This is different from a NamingException, which indicates that there was a problem in obtaining the next element, for example, due to a referral or server unavailability, etc.

nextElementback to summary
public InputStream nextElement()

Implements java.util.Enumeration.nextElement.

Doc from java.util.Enumeration.nextElement.

Returns the next element of this enumeration if this enumeration object has at least one more element to provide.