|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.registry.LocateSecureRegistry
Used to create secure registries (that is, registries that support the
RemoteSecurity
interface) and obtain
references to them. To avoid requiring that clients know the details of how
a secure registry is exported, each secure registry is coupled with a
"bootstrap" non-secure read-only registry. The bootstrap registry contains
a single entry, binding the name "java.rmi.registry.Registry" to the stub
for the secure registry. The getRegistry
methods of this class
obtain the secure registry's stub by making a remote call to the bootstrap
registry and then verifying that the stub is in fact a secure RMI stub for
a unicast secure registry. As such, a client need not use
Security.verifyProxyTrust
on
the secure registry's stub before making further use of the stub.
Method Summary | |
static java.rmi.registry.Registry |
createRegistry(int port,
SecureExportDesc desc,
RemoteCallControl controller)
Creates and exports a default implementation of a secure registry using the specified export descriptor, and creates and exports a bootstrap registry at the specified port (or a dynamically allocated port if the specified port is zero), and returns the secure registry implementation object. |
static java.rmi.registry.Registry |
exportRegistry(java.rmi.registry.Registry impl,
int port,
SecureExportDesc desc)
Exports a custom implementation of a secure registry using the specified export descriptor, and creates and exports a bootstrap registry at the specified port (or a dynamically allocated port if the specified port is zero), and returns a stub for the secure registry. |
static java.rmi.registry.Registry |
getRegistry()
Returns a reference to a secure registry from the bootstrap registry on the current host at the default port ( Registry.REGISTRY_PORT ). |
static java.rmi.registry.Registry |
getRegistry(int port)
Returns a reference to a secure registry from the bootstrap registry on the current host at the specified port (or the default port Registry.REGISTRY_PORT if the specified port is less than
or equal to zero). |
static java.rmi.registry.Registry |
getRegistry(java.lang.String host)
Returns a reference to a secure registry from the bootstrap registry on the specified host (or the current host if the specified host is null or of zero length) at the default port
(Registry.REGISTRY_PORT ). |
static java.rmi.registry.Registry |
getRegistry(java.lang.String host,
int port)
Returns a reference to a secure registry from the bootstrap registry on the specified host (or the current host if the specified host is null or of zero length) at the specified port (or the
default port Registry.REGISTRY_PORT if the specified port
is less than or equal to zero). |
static boolean |
unexportRegistry(java.rmi.registry.Registry impl,
boolean force)
Unexports a secure registry. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.rmi.registry.Registry getRegistry() throws java.rmi.RemoteException, java.rmi.NotBoundException
Registry.REGISTRY_PORT
).java.rmi.RemoteException
- if a communication-related exception occursjava.rmi.NotBoundException
- if the entry in the bootstrap registry is not
bound, or the entry is bound to something other than a secure RMI stub
for a unicast secure registrypublic static java.rmi.registry.Registry getRegistry(int port) throws java.rmi.RemoteException, java.rmi.NotBoundException
Registry.REGISTRY_PORT
if the specified port is less than
or equal to zero).port
- bootstrap registry portjava.rmi.RemoteException
- if a communication-related exception occursjava.rmi.NotBoundException
- if the entry in the bootstrap registry is not
bound, or the entry is bound to something other than a secure RMI stub
for a unicast secure registrypublic static java.rmi.registry.Registry getRegistry(java.lang.String host) throws java.rmi.RemoteException, java.rmi.NotBoundException
null
or of zero length) at the default port
(Registry.REGISTRY_PORT
).host
- host the registry is onnull
or of zero length) at the default portjava.rmi.RemoteException
- if a communication-related exception occursjava.rmi.NotBoundException
- if the entry in the bootstrap registry is not
bound, or the entry is bound to something other than a secure RMI stub
for a unicast secure registrypublic static java.rmi.registry.Registry getRegistry(java.lang.String host, int port) throws java.rmi.RemoteException, java.rmi.NotBoundException
null
or of zero length) at the specified port (or the
default port Registry.REGISTRY_PORT
if the specified port
is less than or equal to zero).host
- host the registry is onport
- bootstrap registry portnull
or of zero length) at the specified port (or the
default port if the specified port is less than or equal to zero)java.rmi.RemoteException
- if a communication-related exception occursjava.rmi.NotBoundException
- if the entry in the bootstrap registry is not
bound, or the entry is bound to something other than a secure RMI stub
for a unicast secure registrypublic static java.rmi.registry.Registry createRegistry(int port, SecureExportDesc desc, RemoteCallControl controller) throws java.rmi.server.ExportException
null
instance of
RemoteCallControl
is
specified, then it is responsible for implementing the remote call
control policy for the secure registry, and the
RemoteCallControl
methods of that instance will be
called for each remote method invocation on the secure registry. If a
null
instance is specified, then a default
RemoteCallControl
implementation is used that has semantics
equivalent to
BasicCallController
used
with the RegistryPermission
class. The
default implementation of the controlRemoteCall
method
throws an AccessControlException
if the client subject has
not been granted a RegistryPermission
with a name that
equals the name of the remote method being invoked, and never executes
the parameter unmarshalling action. The default implementation of the
controlRemoteResult
method does nothing.port
- bootstrap registry port, or zero if a dynamically
allocated port should be useddesc
- the export descriptor to usecontroller
- the remote call controller to use, or
null
if the default controller should be usedjava.rmi.server.ExportException
- if a communication-related exception occursNullPointerException
- if the export descriptor is
null
public static java.rmi.registry.Registry exportRegistry(java.rmi.registry.Registry impl, int port, SecureExportDesc desc) throws java.rmi.server.ExportException
impl
- the secure registry implementation objectport
- bootstrap registry port, or zero if a dynamically
allocated port should be useddesc
- the export descriptor to usejava.rmi.server.ExportException
- if a communication-related exception occursNullPointerException
- if the secure registry implementation
object or the export descriptor is null
public static boolean unexportRegistry(java.rmi.registry.Registry impl, boolean force) throws java.rmi.NoSuchObjectException
force
parameter is
true
, the registry is forcibly unexported even if there
are pending calls to the registry or the registry still has calls in
progress. If the force
parameter is false
,
the registry is only unexported if there are no pending or in progress
calls to the registry. If the secure registry is successfully unexported
then the bootstrap registry is also unexported. Returns
true
if the registry was unexported, and
false
otherwise.impl
- the secure registry implementation objectforce
- true
if the registry should be forcibly
unexported, and false
otherwisetrue
if the registry was unexported;
false
otherwisejava.rmi.NoSuchObjectException
- if the registry is not exported
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |