When an initial context is being created, the environment property "java.naming.provider.url" should contain the RMI URL of the appropriate registry. Otherwise, the default URL "rmi:" is used.
An RMI registry reference contains one or more StringRefAddrs of type "URL", each containing a single RMI URL. Other addresses are ignored. Multiple URLs represent alternative addresses for the same logical resource. The order of the addresses is not significant.
Modifier and Type | Field and Description |
---|---|
public static final String | ADDRESS_TYPE
The type of each address in an RMI registry reference. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
private static String | |
public Context | getInitialContext(Hashtable<?, ?>
The possibly null environment
specifying information to be used in the creation
of the initial context. env)Implements javax. |
public Object | getObjectInstance(Object
The possibly null object containing location or reference
information that can be used in creating an object. ref, Name The name of this object relative to name, Context nameCtx ,
or null if no name is specified.The context relative to which the nameCtx, Hashtable<?, ?> name
parameter is specified, or null if name is
relative to the default initial context.The possibly null environment that is used in
creating the object. env)Implements javax. |
private static String[] | |
private static boolean | |
private static Object | |
private static Context |
ADDRESS_TYPE | back to summary |
---|---|
public static final String ADDRESS_TYPE The type of each address in an RMI registry reference. |
RegistryContextFactory | back to summary |
---|---|
public RegistryContextFactory() |
getInitCtxURL | back to summary |
---|---|
private static String getInitCtxURL(Hashtable<?, ?> env) Reads environment to find URL of initial context. The default URL is "rmi:". |
getInitialContext | back to summary |
---|---|
public Context getInitialContext(Hashtable<?, ?> env) throws NamingException Implements javax. Doc from javax. Creates an Initial Context for beginning name resolution.
Special requirements of this context are supplied
using The environment parameter is owned by the caller. The implementation will not modify the object or keep a reference to it, although it may keep a reference to a clone or copy.
|
getObjectInstance | back to summary |
---|---|
public Object getObjectInstance(Object ref, Name name, Context nameCtx, Hashtable<?, ?> env) throws NamingException Implements javax. Doc from javax. Creates an object using the location or reference information specified.
Special requirements of this object are supplied
using
A URL context factory is a special ObjectFactory that
creates contexts for resolving URLs or objects whose locations
are specified by URLs. The
The
Name and Context Parameters.
The
|
getURLs | back to summary |
---|---|
private static String[] getURLs(Reference ref) throws NamingException Returns the URLs contained within an RMI registry reference. |
isRegistryRef | back to summary |
---|---|
private static boolean isRegistryRef(Object obj) Returns true if argument is an RMI registry reference. |
URLsToObject | back to summary |
---|---|
private static Object URLsToObject(String[] urls, Hashtable<?, ?> env) throws NamingException |
URLToContext | back to summary |
---|---|
private static Context URLToContext(String url, Hashtable<?, ?> env) throws NamingException |