public class FiddlerImpl extends Object implements net.jini.security.proxytrust.ServerProxyTrust, net.jini.export.ProxyAccessor, Fiddler, org.apache.river.api.util.Startable, net.jini.export.CodebaseAccessor, net.jini.lookup.ServiceProxyAccessor, net.jini.lookup.ServiceAttributesAccessor, net.jini.lookup.ServiceIDAccessor
FiddlerProxy (the proxy for the
LookupDiscoveryService interface which defines how clients
register with the lookup discovery service), FiddlerAdminProxy
(the proxy for the FiddlerAdmin interface which specifies
the methods through which administration duties such as joining, persistent
state logging policy, and shutting down the lookup discovery service can
be performed), and FiddlerRegistration (the proxy for the
LookupDiscoveryRegistration interface which defines the
methods through which clients can perform duties such as group and
locator management, state retrieval, and discarding discovered but
unavailable lookup services so they are eligible for re-discovery).
It is through the proxies that communicate with this class that clients
interact with the lookup discovery service. When a client makes a method
invocation on one of the proxies, the proxy makes a corresponding call
on the methods specified in the Fiddler interface which
are implemented in this class, ultimately executing on the backend server.
This implementation of the lookup discovery service employs a number of
Loggers. The details of each such
Logger are described
here.
The configuration entries supported by this implementation are described here.
| Modifier and Type | Method and Description |
|---|---|
void |
addGroups(net.jini.id.Uuid registrationID,
String[] groups)
This method is the "backend" server counterpart to the method of
the same name provided by the
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration. |
void |
addLocators(net.jini.id.Uuid registrationID,
net.jini.core.discovery.LookupLocator[] locators)
This method is the "backend" server counterpart to the method of
the same name provided by the
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration. |
void |
addLookupAttributes(net.jini.core.entry.Entry[] attrSets)
Adds attribute sets to the current set of attributes associated
with the lookup discovery service.
|
void |
addLookupGroups(String[] groups)
Add new names to the set consisting of the names of groups whose
members are lookup services the lookup discovery service wishes
to register with (join).
|
void |
addLookupLocators(net.jini.core.discovery.LookupLocator[] locators)
Add a set of LookupLocator objects to the lookup discovery service's
managed set of locators.
|
void |
cancelLease(net.jini.id.Uuid registrationID,
net.jini.id.Uuid leaseID)
This method is the "backend" server counterpart to the
cancel method specified by the Lease
interface and implemented in the FiddlerLease class; an
instance of which is returned by the getLease method
of the LookupDiscoveryRegistration proxy (an instance of
FiddlerRegistration) that is returned by this service
when a client requests a registration. |
Exception[] |
cancelLeases(net.jini.id.Uuid[] registrationIDs,
net.jini.id.Uuid[] leaseIDs)
Cancels all leases from a
LeaseMap. |
void |
destroy()
Destroy the lookup discovery service, if possible, including its
persistent storage.
|
void |
discard(net.jini.id.Uuid registrationID,
net.jini.core.lookup.ServiceRegistrar registrar)
This method is the "backend" server counterpart to the method of
the same name provided by the
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration. |
Object |
getAdmin()
Returns a proxy to the current instance of this class through which
a client may administer the lookup discovery service
|
String |
getCertFactoryType() |
String |
getCertPathEncoding() |
String |
getClassAnnotation() |
byte[] |
getEncodedCerts() |
String[] |
getGroups(net.jini.id.Uuid registrationID)
This method is the "backend" server counterpart to the method of
the same name provided by the
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration. |
long |
getLeaseBound()
Retrieves the least upper bound applied to all lease durations granted
by the lookup discovery service.
|
net.jini.core.discovery.LookupLocator[] |
getLocators(net.jini.id.Uuid registrationID)
This method is the "backend" server counterpart to the method of
the same name provided by the
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration. |
net.jini.core.entry.Entry[] |
getLookupAttributes()
Returns the current attribute sets for the lookup discovery service.
|
String[] |
getLookupGroups()
Get the names of the groups whose members are lookup services the
lookup discovery services wishes to register with (join).
|
net.jini.core.discovery.LookupLocator[] |
getLookupLocators()
Get the lookup discovery service's managed set of locators.
|
int |
getPersistenceSnapshotThreshold()
Retrieve the value of the size threshold of the snapshot; which is
employed by the lookup discovery service in the test to determine
whether or not to take a "snapshot" of the system state.
|
float |
getPersistenceSnapshotWeight()
Retrieve the weight factor applied by the lookup discovery service
to the snapshot size during the test to determine whether or not to
take a "snapshot" of the system state.
|
Object |
getProxy()
Public method that facilitates the use of the mechanism provided by
ServiceStarter to create an activatable
instance of this server. |
net.jini.id.Uuid |
getProxyID()
Returns the unique identifier generated (or recovered) by the backend
implementation of the lookup discovery service when an instance of
that service is constructed.
|
net.jini.security.TrustVerifier |
getProxyVerifier()
Returns a
TrustVerifier specific to this service which
can be used to verify that a given proxy to this service can be
trusted. |
MarshalledObject[] |
getRegistrars(net.jini.id.Uuid registrationID)
This method is the "backend" server counterpart to the method of
the same name provided by the
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration. |
net.jini.core.entry.Entry[] |
getServiceAttributes() |
Object |
getServiceProxy()
Public method that facilitates the use of the mechanism provided by
ServiceStarter to create an activatable
instance of this server. |
void |
modifyLookupAttributes(net.jini.core.entry.Entry[] attrSetTemplates,
net.jini.core.entry.Entry[] attrSets)
Modifies the current set of attributes associated with the lookup
discovery service.
|
net.jini.discovery.LookupDiscoveryRegistration |
register(String[] groups,
net.jini.core.discovery.LookupLocator[] locators,
net.jini.core.event.RemoteEventListener listener,
MarshalledObject handback,
long leaseDuration)
Registers with the lookup discovery service.
|
void |
removeGroups(net.jini.id.Uuid registrationID,
String[] groups)
This method is the "backend" server counterpart to the method of
the same name provided by the
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration. |
void |
removeLocators(net.jini.id.Uuid registrationID,
net.jini.core.discovery.LookupLocator[] locators)
This method is the "backend" server counterpart to the method of
the same name provided by the
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration. |
void |
removeLookupGroups(String[] groups)
Remove a set of group names from lookup discovery service's managed
set of groups (the set consisting of the names of groups whose
members are lookup services the lookup discovery service wishes
to join).
|
void |
removeLookupLocators(net.jini.core.discovery.LookupLocator[] locators)
Remove a set of LookupLocator objects from the lookup discovery
service's managed set of locators.
|
long |
renewLease(net.jini.id.Uuid registrationID,
net.jini.id.Uuid leaseID,
long duration)
This method is the "backend" server counterpart to the
renew method specified by the Lease interface,
implemented in the org.apache.river.lease.AbstractLease class,
and invoked by way of the doRenew method of the
FiddlerLease class; an instance of which is
returned by the getLease method of the
LookupDiscoveryRegistration proxy (an instance of
FiddlerRegistration) that is returned by this service
when a client requests a registration. |
FiddlerRenewResults |
renewLeases(net.jini.id.Uuid[] registrationIDs,
net.jini.id.Uuid[] leaseIDs,
long[] durations)
This methods renews all leases from a
LeaseMap,
where each element of the map is a lease on a registration with
ID corresponding to an element of the registrationIDs
parameter. |
net.jini.core.lookup.ServiceID |
serviceID() |
void |
setGroups(net.jini.id.Uuid registrationID,
String[] groups)
This method is the "backend" server counterpart to the method of
the same name provided by the
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration. |
void |
setLeaseBound(long newBound)
Changes the least upper bound applied to all lease durations granted
by the lookup discovery service.
|
void |
setLocators(net.jini.id.Uuid registrationID,
net.jini.core.discovery.LookupLocator[] locators)
This method is the "backend" server counterpart to the method of
the same name provided by the
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration. |
void |
setLookupGroups(String[] groups)
Replace the lookup discovery service's managed set of groups with a
new set of group names.
|
void |
setLookupLocators(net.jini.core.discovery.LookupLocator[] locators)
Replace the lookup discovery service's managed set of locators with
a new set of locators.
|
void |
setPersistenceSnapshotThreshold(int threshold)
Change the value of the size threshold of the snapshot; which is
employed by the lookup discovery service in the test to determine
whether or not to take a "snapshot" of the system state.
|
void |
setPersistenceSnapshotWeight(float weight)
Change the weight factor applied by the lookup discovery service
to the snapshot size during the test to determine whether or not
to take a "snapshot" of the system state.
|
void |
start() |
public net.jini.core.entry.Entry[] getServiceAttributes()
throws IOException
getServiceAttributes in interface net.jini.lookup.ServiceAttributesAccessorIOExceptionpublic net.jini.core.lookup.ServiceID serviceID()
throws IOException
serviceID in interface net.jini.lookup.ServiceIDAccessorIOExceptionpublic String getClassAnnotation() throws IOException
getClassAnnotation in interface net.jini.export.CodebaseAccessorIOExceptionpublic String getCertFactoryType() throws IOException
getCertFactoryType in interface net.jini.export.CodebaseAccessorIOExceptionpublic String getCertPathEncoding() throws IOException
getCertPathEncoding in interface net.jini.export.CodebaseAccessorIOExceptionpublic byte[] getEncodedCerts()
throws IOException
getEncodedCerts in interface net.jini.export.CodebaseAccessorIOExceptionpublic net.jini.security.TrustVerifier getProxyVerifier()
throws NoSuchObjectException
TrustVerifier specific to this service which
can be used to verify that a given proxy to this service can be
trusted.
The verifier returned by this method contains the method
isTrustedObject. That method
can be called with a candidate proxy as the first argument, and
TrustVerifier.Context
as the second argument. When called in this way, the
isTrustedObject determines whether or not the input
proxy is trusted. Thus, the verifier returned by this method should
be able to verify as trusted, all proxies to this service; including
proxies such as leases, event registrations, and administrative
proxies.
getProxyVerifier in interface net.jini.security.proxytrust.ServerProxyTrustTrustVerifier which can be used to verify that
a given proxy to this service can be trusted.NoSuchObjectException - if this method is called during
service initialization or shutdown processingUnsupportedOperationException - if the server proxy does not
implement both
RemoteMethodControl
and TrustEquivalenceServerProxyTrust.getProxyVerifier()public Object getProxy()
ServiceStarter to create an activatable
instance of this server.getProxy in interface net.jini.export.ProxyAccessorpublic Object getAdmin() throws NoSuchObjectException, RemoteException
getAdmin in interface net.jini.admin.AdministrableNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
server.
see org.apache.river.fiddler.proxy.FiddlerAdminProxy#getAdmin (?)Administrable.getAdmin()public net.jini.core.entry.Entry[] getLookupAttributes()
throws NoSuchObjectException,
RemoteException
getLookupAttributes in interface net.jini.admin.JoinAdminNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service.FiddlerAdminProxy.getLookupAttributes(),
JoinAdmin.getLookupAttributes()public void addLookupAttributes(net.jini.core.entry.Entry[] attrSets)
throws NoSuchObjectException,
RemoteException
addLookupAttributes in interface net.jini.admin.JoinAdminattrSets - array of net.jini.core.entry.Entry containing the
attribute sets to addNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
attributes may or may not have been added successfully.FiddlerAdminProxy.addLookupAttributes(net.jini.core.entry.Entry[]),
JoinAdmin.addLookupAttributes(net.jini.core.entry.Entry[])public void modifyLookupAttributes(net.jini.core.entry.Entry[] attrSetTemplates,
net.jini.core.entry.Entry[] attrSets)
throws NoSuchObjectException,
RemoteException
modifyLookupAttributes in interface net.jini.admin.JoinAdminattrSetTemplates - array of net.jini.core.entry.Entry containing
the templates to use for selecting the attributes (contained
within the set of existing attributes) that are to be
modifiedattrSets - array of net.jini.core.entry.Entry containing the
modifications to make to matching setsNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
attributes may or may not have been modified successfully.FiddlerAdminProxy.modifyLookupAttributes(net.jini.core.entry.Entry[], net.jini.core.entry.Entry[]),
JoinAdmin.modifyLookupAttributes(net.jini.core.entry.Entry[], net.jini.core.entry.Entry[])public String[] getLookupGroups() throws NoSuchObjectException, RemoteException
getLookupGroups in interface net.jini.admin.JoinAdminIf the array returned is empty, the lookup discovery service is configured to join no groups. If null is returned, the lookup discovery service is configured to join all groups.
NoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service.FiddlerAdminProxy.getLookupGroups(),
JoinAdmin.getLookupGroups()public void addLookupGroups(String[] groups) throws NoSuchObjectException, RemoteException
addLookupGroups in interface net.jini.admin.JoinAdmingroups - String array containing the names of the groups to addNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
group names may or may not have been added successfully.FiddlerAdminProxy.addLookupGroups(java.lang.String[]),
JoinAdmin.addLookupGroups(java.lang.String[])public void removeLookupGroups(String[] groups) throws NoSuchObjectException, RemoteException
removeLookupGroups in interface net.jini.admin.JoinAdmingroups - String array containing the names of the groups to removeNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
group names may or may not have been removed successfully.FiddlerAdminProxy.removeLookupGroups(java.lang.String[]),
JoinAdmin.removeLookupGroups(java.lang.String[])public void setLookupGroups(String[] groups) throws NoSuchObjectException, RemoteException
setLookupGroups in interface net.jini.admin.JoinAdmingroups - String array containing the names of the new groupsNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
group names may or may not have been replaced successfully.FiddlerAdminProxy.setLookupGroups(java.lang.String[]),
JoinAdmin.setLookupGroups(java.lang.String[])public net.jini.core.discovery.LookupLocator[] getLookupLocators()
throws NoSuchObjectException,
RemoteException
getLookupLocators in interface net.jini.admin.JoinAdminNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service.FiddlerAdminProxy.getLookupLocators(),
JoinAdmin.getLookupLocators()public void addLookupLocators(net.jini.core.discovery.LookupLocator[] locators)
throws NoSuchObjectException,
RemoteException
Any lookup services corresponding to the new locators that the lookup discovery service has not yet joined, will be discovered and joined.
addLookupLocators in interface net.jini.admin.JoinAdminlocators - array of net.jini.core.discovery.LookupLocator objects to add
to the managed set of locatorsNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
new locators may or may not have been added successfully.FiddlerAdminProxy.addLookupLocators(net.jini.core.discovery.LookupLocator[]),
JoinAdmin.addLookupLocators(net.jini.core.discovery.LookupLocator[])public void removeLookupLocators(net.jini.core.discovery.LookupLocator[] locators)
throws NoSuchObjectException,
RemoteException
Note that any leases granted to the lookup discovery service by lookup services that do not correspond to any of the locators remaining in the managed set will be cancelled at those lookup services.
removeLookupLocators in interface net.jini.admin.JoinAdminlocators - array of net.jini.core.discovery.LookupLocator objects to
remove from the managed set of locatorsNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
new locators may or may not have been removed successfully.FiddlerAdminProxy.removeLookupLocators(net.jini.core.discovery.LookupLocator[]),
JoinAdmin.removeLookupLocators(net.jini.core.discovery.LookupLocator[])public void setLookupLocators(net.jini.core.discovery.LookupLocator[] locators)
throws NoSuchObjectException,
RemoteException
Note that any leases granted to the lookup discovery service by lookup services whose corresponding locator is removed from the managed set will be cancelled at those lookup services. The lookup services corresponding to the new locators in the managed set will be discovered and joined.
setLookupLocators in interface net.jini.admin.JoinAdminlocators - array of net.jini.core.discovery.LookupLocator objects with
which to replace the current managed set of locators
remove from the managed set of locatorsNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
locators in the managed set may or may not have been replaced
successfully.FiddlerAdminProxy.setLookupLocators(net.jini.core.discovery.LookupLocator[]),
JoinAdmin.setLookupLocators(net.jini.core.discovery.LookupLocator[])public void destroy()
throws NoSuchObjectException,
RemoteException
destroy in interface org.apache.river.admin.DestroyAdminNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
lookup discovery service may or may not have been successfully
destroyed.FiddlerAdminProxy.destroy(),
DestroyAdmin.destroy()public void setLeaseBound(long newBound)
throws NoSuchObjectException,
RemoteException
This method is a mechanism for an entity with the appropriate privileges to administratively change the value of the least upper bound that will be applied by the Fiddler implementation of the lookup discovery service when determining the duration to assign to the lease on a requested registration.
setLeaseBound in interface org.apache.river.admin.FiddlerAdminnewBound - long value representing the new least
upper bound (in milliseconds) on the set of all possible
lease durations that may be grantedNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
bound value may or may not have been changed successfully.FiddlerAdminProxy.setLeaseBound(long),
FiddlerAdmin.setLeaseBound(long)public long getLeaseBound()
throws NoSuchObjectException,
RemoteException
getLeaseBound in interface org.apache.river.admin.FiddlerAdminlong value representing the current least
upper bound (in milliseconds) on the set of all possible
lease durations that may be grantedNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service.FiddlerAdminProxy.getLeaseBound(),
FiddlerAdmin.getLeaseBound()public void setPersistenceSnapshotWeight(float weight)
throws NoSuchObjectException,
RemoteException
setPersistenceSnapshotWeight in interface org.apache.river.admin.FiddlerAdminweight - weight factor for snapshot sizeNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
weight factor may or may not have been changed successfully.FiddlerAdminProxy.setPersistenceSnapshotWeight(float),
FiddlerAdmin.setPersistenceSnapshotWeight(float)public float getPersistenceSnapshotWeight()
throws NoSuchObjectException,
RemoteException
getPersistenceSnapshotWeight in interface org.apache.river.admin.FiddlerAdminNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service.FiddlerAdminProxy.getPersistenceSnapshotWeight(),
FiddlerAdmin.getPersistenceSnapshotWeight()public void setPersistenceSnapshotThreshold(int threshold)
throws NoSuchObjectException,
RemoteException
setPersistenceSnapshotThreshold in interface org.apache.river.admin.FiddlerAdminthreshold - size threshold for taking a snapshotNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
threshold may or may not have been changed successfully.#setPersistenceSnapshotThreshold,
FiddlerAdmin.setPersistenceSnapshotThreshold(int)public int getPersistenceSnapshotThreshold()
throws NoSuchObjectException,
RemoteException
getPersistenceSnapshotThreshold in interface org.apache.river.admin.FiddlerAdminNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service.#getPersistenceSnapshotThreshold,
FiddlerAdmin.getPersistenceSnapshotThreshold()public Object getServiceProxy() throws NoSuchObjectException
ServiceStarter to create an activatable
instance of this server.getServiceProxy in interface net.jini.lookup.ServiceProxyAccessorNoSuchObjectException - if this method is called during
service initialization or shutdown processingpublic net.jini.id.Uuid getProxyID()
throws NoSuchObjectException,
RemoteException
getProxyID in interface FiddlerNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
server. When this exception does occur, the registration may
or may not have completed successfully.public net.jini.discovery.LookupDiscoveryRegistration register(String[] groups, net.jini.core.discovery.LookupLocator[] locators, net.jini.core.event.RemoteEventListener listener, MarshalledObject handback, long leaseDuration) throws NoSuchObjectException, RemoteException
register in interface Fiddlergroups - String array, none of whose elements may be null,
consisting of zero or more names of groups to
which lookup services to discover belong.
A null value or an empty array
(DiscoveryGroupManagement.ALL_GROUPS or
DiscoveryGroupManagement.NO_GROUPS) are both
acceptable.locators - array of zero or more non-null LookupLocator
objects, each corresponding to a specific lookup
service to discover. If either the empty array
or null is passed to this argument, then no
locator discovery will be performed for the
associated registration.listener - a non-null instance of RemoteEventListener. This
argument specifies the entity that will receive
events notifying the registration that a lookup
service of interest has been discovered. A
non-null value must be passed to this argument,
otherwise a NullPointerException will be thrown
and the registration.handback - null or an instance of MarshalledObject. This
argument specifies an object that will be
included in the notification event that the
lookup discovery service sends to the registered
listener.leaseDuration - long value representing the amount of time (in
milliseconds) for which the resources of the
lookup discovery service are being requested.NoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
server. When this exception does occur, the registration may
or may not have completed successfully.NullPointerException - this exception occurs when
null is input to the listener parameter, as well
as when one or more of the elements of the groups
parameter is null.IllegalArgumentException - this exception occurs when
the value input to the leaseDuration parameter
is neither positive, Lease.FOREVER, nor Lease.ANY.LookupDiscoveryServicepublic MarshalledObject[] getRegistrars(net.jini.id.Uuid registrationID) throws NoSuchObjectException, RemoteException, org.apache.river.proxy.ThrowThis
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration.
This method returns an array consisting of proxies to the lookup
service(s) that have already been discovered for the registration
corresponding to the registrationID input parameter.
Each element of the return set is a marshalled instance of the
ServiceRegistrar interface.
getRegistrars in interface FiddlerregistrationID - unique identifier assigned to the registration
from which the set of registrars is being
retrievedNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service.org.apache.river.proxy.ThrowThis - which is a non-remote "wrapper"
class used to wrap various remote exceptions (for example,
NoSuchObjectException) that this method wishes to throw.
When a service is implemented as a smart proxy with a
backend server, and a method on the backend which was invoked
through the proxy wishes to explicitly throw a particular
remote exception, it cannot simply throw that exception if
it wishes that exception to be visible to the proxy running
on the "client side". This is because when the backend throws
any remote exception, the RMI sub-system automatically wraps
that exception in a java.rmi.ServerException. Thus, the proxy
will only be able to "see" the ServerException (the actual
exception that the backend tried to throw is "buried" in the
detail field of the ServerException). Thus, in order to allow
the proxy access to the actual remote exception this method
throws, that exception wraps the desired remote exception in
the non-remote exception ThrowThis; which will not be wrapped
in a ServerException.
This method throws a NoSuchObjectException wrapped in a
ThrowThis exception whenever the registrationID
parameter references an invalid or non-existent registration.FiddlerRegistration.getRegistrars(),
LookupDiscoveryRegistration.getRegistrars()public String[] getGroups(net.jini.id.Uuid registrationID) throws NoSuchObjectException, RemoteException, org.apache.river.proxy.ThrowThis
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration.
This method returns an array consisting of the names of the groups whose members are lookup services the lookup discovery service will attempt to discover for the registration corresponding to the current instance of this class. This set of group names is referred to as the registration's 'managed set of groups'.
If the registration's managed set of groups is currently empty, then the empty array is returned. If the lookup discovery service currently has no managed set of groups for the registration through which the request is being made, then null will be returned.
getGroups in interface FiddlerregistrationID - unique identifier assigned to the registration
from which the set of groups is being retrievedNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service.NoSuchObjectException - wrapped in an instance of
org.apache.river.proxy.ThrowThis exception whenever the
registrationID parameter references an invalid
or non-existent registration. Refer to the description of the
getRegistrars method for more information on
this exception.org.apache.river.proxy.ThrowThisFiddlerRegistration.getGroups(),
LookupDiscoveryRegistration.getGroups()public net.jini.core.discovery.LookupLocator[] getLocators(net.jini.id.Uuid registrationID)
throws NoSuchObjectException,
RemoteException,
org.apache.river.proxy.ThrowThis
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration.
This method returns an array consisting of the the LookupLocator objects corresponding to specific lookup services the lookup discovery service will attempt to discover for for the registration corresponding to the current instance of this class. This set of locators is referred to as the registration's 'managed set of locators'.
If the registration's managed set of locators is currently empty, then the empty array is returned. If the lookup discovery service currently has no managed set of locators for the registration through which the request is being made, then null will be returned.
getLocators in interface FiddlerregistrationID - unique identifier assigned to the registration
from which the set of locators is being retrievedNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service.NoSuchObjectException - wrapped in an instance of
org.apache.river.proxy.ThrowThis exception whenever the
registrationID parameter references an invalid
or non-existent registration. Refer to the description of the
getRegistrars method for more information on
this exception.org.apache.river.proxy.ThrowThisFiddlerRegistration.getLocators(),
LookupDiscoveryRegistration.getLocators()public void addGroups(net.jini.id.Uuid registrationID,
String[] groups)
throws NoSuchObjectException,
RemoteException,
org.apache.river.proxy.ThrowThis
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration.
This method first tests the input set of group names for validity and throws the appropriate exception should any irregularities be found. It then adds the input set of group names to the managed set of groups associated with the registration.
addGroups in interface FiddlerregistrationID - unique identifier assigned to the registration
to which the set of groups being augmented
correspondsgroups - a String array, none of whose elements may be
null, consisting of the group names with which to
augment the registration's managed set of groups.
If any element of this parameter duplicates any other element of this parameter, the duplicate will be ignored. If any element of this parameter duplicates any element of the registration's current managed set of groups, the duplicate will be ignored.
If the empty set is input, then the registration's
managed set of groups will not change. If null is
input, this method will throw a
NullPointerException.
IllegalStateException - this exception occurs when
the addGroups method of the discovery
manager is invoked after the terminate method
of that manager is called. When this happens, in addition to
propagating this exception, this method also registers an
ERROR status attribute (along with a Comment attribute
describing the nature of the problem) with all lookup services
with which this service is registered. Administrative clients,
as well as clients that use this service should register
for notification of the existence of this attribute.UnsupportedOperationException - this exception
occurs when the registration corresponding to the
registrationID parameter has no managed set of
groups to which to add the elements of the input parameter.
That is, the registration's current managed set of groups is
null. When a registration's managed set of groups is null,
it means that all groups are being discovered for that
registration; thus, requesting that a set of groups be added
to the set of all groups makes no sense.NullPointerException - this exception occurs when
either null is input to the groups parameter,
or one or more of the elements of the groups
parameter is null. If a null groups parameter
is input, the registration is requesting that all groups be
added to its current managed set of groups; which is not
allowed. (Note that if a registration wishes to change its
managed set of groups from a finite set of names to "all
groups", it should invoke setGroups with a null input.)NoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
registration's managed set of groups may or may not have been
successfully augmented.NoSuchObjectException - wrapped in an instance of
org.apache.river.proxy.ThrowThis exception whenever the
registrationID parameter references an invalid
or non-existent registration. Refer to the description of the
getRegistrars method for more information on
this exception.org.apache.river.proxy.ThrowThisFiddlerRegistration.addGroups(java.lang.String[]),
LookupDiscoveryRegistration.addGroups(java.lang.String[])public void setGroups(net.jini.id.Uuid registrationID,
String[] groups)
throws NoSuchObjectException,
RemoteException,
org.apache.river.proxy.ThrowThis
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration.
This method first tests the input set of group names for validity and
throws the appropriate exception should any irregularities be found.
It then queues a SetGroupsTask which performs the
actual replacement.
setGroups in interface FiddlerregistrationID - unique identifier assigned to the registration
to which the set of groups being replaced
correspondsgroups - a String array, none of whose elements may be
null, consisting of the group names with which to
replace the names in this registration's managed
set of groups.
If any element of this parameter duplicates any other element of this parameter, the duplicate will be ignored.
If the empty set is input, then group discovery for the registration will cease. If null is input, the lookup discovery service will attempt to discover all as yet undiscovered lookup services located within its multicast radius and, upon discovery of any such lookup service, will send to the registration's listener an event signaling that discovery.
NullPointerException - this exception occurs when one
or more of the elements of the groups parameter is null.NoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
registration's managed set of groups may or may not have been
successfully replaced.NoSuchObjectException - wrapped in an instance of
org.apache.river.proxy.ThrowThis exception whenever the
registrationID parameter references an invalid
or non-existent registration. Refer to the description of the
getRegistrars method for more information on
this exception.org.apache.river.proxy.ThrowThisFiddlerRegistration.setGroups(java.lang.String[]),
LookupDiscoveryRegistration.setGroups(java.lang.String[])public void removeGroups(net.jini.id.Uuid registrationID,
String[] groups)
throws NoSuchObjectException,
RemoteException,
org.apache.river.proxy.ThrowThis
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration.
This method first tests the input set of group names for validity and
throws the appropriate exception should any irregularities be found.
It then queues a RemoveGroupsTask which performs the
actual removal.
removeGroups in interface FiddlerregistrationID - unique identifier assigned to the registration
to which the set of groups being removed
correspondsgroups - a String array, none of whose elements may be
null, consisting of the group names to delete
from the registration's managed set of groups.
If any element of this parameter duplicates any other element of this parameter, the duplicate will be ignored. If any element of this parameter is not currently contained in the registration's managed set, no action is taken with respect to that element.
If the empty set is input, the registration's
managed set of groups will not change. If null is
input, this method will throw a
NullPointerException.
UnsupportedOperationException - this exception
occurs when the registration corresponding to the
registrationID parameter has no managed set
of groups from which to remove elements of the input parameter.
That is, the registration's current managed set of groups is
null. Thus, requesting that a set of groups be removed from
null set makes no sense.NullPointerException - this exception occurs when
either null is input to the groups parameter,
or one or more of the elements of the groups
parameter is null. If a null groups parameter
is input, the registration is requesting that all groups be
removed from its current managed set of groups; which is not
allowed. (Note that if a registration wishes to change its
managed set of groups from "all groups" to "no groups", it
it should invoke setGroups with a zero length
String input.)NoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
registration's managed set of groups may or may not have been
successfully modified.NoSuchObjectException - wrapped in an instance of
org.apache.river.proxy.ThrowThis exception whenever the
registrationID parameter references an invalid
or non-existent registration. Refer to the description of the
getRegistrars method for more information on
this exception.org.apache.river.proxy.ThrowThisFiddlerRegistration.removeGroups(java.lang.String[]),
LookupDiscoveryRegistration.removeGroups(java.lang.String[])public void addLocators(net.jini.id.Uuid registrationID,
net.jini.core.discovery.LookupLocator[] locators)
throws NoSuchObjectException,
RemoteException,
org.apache.river.proxy.ThrowThis
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration.
This method first tests the input set of group names for validity and throws the appropriate exception should any irregularities be found. It then adds the input set of LookupLocator objects to the managed set of locators associated with the registration.
addLocators in interface FiddlerregistrationID - unique identifier assigned to the registration
to which the set of locators being augmented
correspondslocators - an array, none of whose elements may be null,
consisting of the LookupLocator objects with
which to augment the registration's managed set
of locators.
If any element of this parameter duplicates any other element of this parameter, the duplicate will be ignored. If any element of this parameter duplicates any element of the registration's managed set of locators, the duplicate will be ignored.
If the empty set is input, then the registration's
managed set of locators will not change. If null
is input, this method will throw a
NullPointerException.
IllegalStateException - this exception occurs when
the addLocators method of the discovery
manager is invoked after the terminate method
of that manager is called. When this happens, in addition to
propagating this exception, this method also registers an
ERROR status attribute (along with a Comment attribute
describing the nature of the problem) with all lookup services
with which this service is registered. Administrative clients,
as well as clients that use this service should register
for notification of the existence of this attribute.NullPointerException - this exception occurs when
either null is input to the locators parameter,
or one or more of the elements of the locators
parameter is null.NoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
registration's managed set of locators may or may not have
been successfully augmented.NoSuchObjectException - wrapped in an instance of
org.apache.river.proxy.ThrowThis exception whenever the
registrationID parameter references an invalid
or non-existent registration. Refer to the description of the
getRegistrars method for more information on
this exception.org.apache.river.proxy.ThrowThisFiddlerRegistration.addLocators(net.jini.core.discovery.LookupLocator[]),
LookupDiscoveryRegistration.addLocators(net.jini.core.discovery.LookupLocator[])public void setLocators(net.jini.id.Uuid registrationID,
net.jini.core.discovery.LookupLocator[] locators)
throws NoSuchObjectException,
RemoteException,
org.apache.river.proxy.ThrowThis
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration.
This method first tests the input set of locators for validity and
throws the appropriate exception should any irregularities be found.
It then queues a SetLocatorsTask which performs the
actual replacement.
setLocators in interface FiddlerregistrationID - unique identifier assigned to the registration
to which the set of locators being replaced
correspondslocators - an array, none of whose elements may be null,
consisting of the LookupLocator objects with
which to replace the locators in the
registration's managed set of locators.
If any element of this parameter duplicates any other element of this parameter, the duplicate will be ignored.
If the empty array is input, then locator
discovery for the registration will cease. If
null is input, this method will throw a
NullPointerException.
NullPointerException - this exception occurs when
either null is input to the locators parameter,
or one or more of the elements of the locators
parameter is null.NoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
registration's managed set of locators may or may not have
been successfully replaced.NoSuchObjectException - wrapped in an instance of
org.apache.river.proxy.ThrowThis exception whenever the
registrationID parameter references an invalid
or non-existent registration. Refer to the description of the
getRegistrars method for more information on
this exception.org.apache.river.proxy.ThrowThisFiddlerRegistration.setLocators(net.jini.core.discovery.LookupLocator[]),
LookupDiscoveryRegistration.setLocators(net.jini.core.discovery.LookupLocator[])public void removeLocators(net.jini.id.Uuid registrationID,
net.jini.core.discovery.LookupLocator[] locators)
throws NoSuchObjectException,
RemoteException,
org.apache.river.proxy.ThrowThis
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration.
This method first tests the input set of locators for validity and
throws the appropriate exception should any irregularities be found.
It then queues a RemoveLocatorsTask which performs the
actual removal.
removeLocators in interface FiddlerregistrationID - unique identifier assigned to the registration
to which the set of locators being removed
correspondslocators - an array, none of whose elements may be null,
consisting of the LookupLocator objects to remove
from the registration's managed set of locators.
If any element of this parameter duplicates any other element of this parameter, the duplicate will be ignored.
If the empty set is input, the managed set of
locators will not change. If null is input,
this method will throw a
NullPointerException.
NullPointerException - this exception occurs when
either null is input to the locators parameter,
or one or more of the elements of the locators
parameter is null.NoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur, the
registration's managed set of locators may or may not have
been successfully modified.NoSuchObjectException - wrapped in an instance of
org.apache.river.proxy.ThrowThis exception whenever the
registrationID parameter references an invalid
or non-existent registration. Refer to the description of the
getRegistrars method for more information on
this exception.org.apache.river.proxy.ThrowThisFiddlerRegistration.removeLocators(net.jini.core.discovery.LookupLocator[]),
LookupDiscoveryRegistration.removeLocators(net.jini.core.discovery.LookupLocator[])public void discard(net.jini.id.Uuid registrationID,
net.jini.core.lookup.ServiceRegistrar registrar)
throws NoSuchObjectException,
RemoteException,
org.apache.river.proxy.ThrowThis
LookupDiscoveryRegistration
proxy (an instance of FiddlerRegistration) that is
returned by this service when a client requests a registration.
This method informs the lookup discovery service of the existence of an unavailable lookup service and requests that the lookup discovery service discard the unavailable lookup service and make it eligible to be re-discovered.
discard in interface FiddlerregistrationID - unique identifier assigned to the registration
making the current discard requestregistrar - a reference to the lookup service that the lookup
discovery service is being asked to discard.
If this parameter equals none of the lookup services contained in the managed set of lookup services for this registration, no action will be taken.
NullPointerException - this exception occurs when
null is input to the registrar parameter.NoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
lookup discovery service. When this exception does occur,
the lookup service may or may not have been successfully
discarded.NoSuchObjectException - wrapped in an instance of
org.apache.river.proxy.ThrowThis exception whenever the
registrationID parameter references an invalid
or non-existent registration. Refer to the description of the
getRegistrars method for more information on
this exception.org.apache.river.proxy.ThrowThisFiddlerRegistration.discard(net.jini.core.lookup.ServiceRegistrar),
LookupDiscoveryRegistration.discard(net.jini.core.lookup.ServiceRegistrar)public long renewLease(net.jini.id.Uuid registrationID,
net.jini.id.Uuid leaseID,
long duration)
throws net.jini.core.lease.UnknownLeaseException,
NoSuchObjectException,
RemoteException
renew method specified by the Lease interface,
implemented in the org.apache.river.lease.AbstractLease class,
and invoked by way of the doRenew method of the
FiddlerLease class; an instance of which is
returned by the getLease method of the
LookupDiscoveryRegistration proxy (an instance of
FiddlerRegistration) that is returned by this service
when a client requests a registration.
This method renews the lease corresponding to the given
registrationID and leaseID parameters,
granting a new duration that is less than or equal to the requested
duration value contained in the duration parameter.
renewLease in interface FiddlerregistrationID - unique identifier assigned to the registration
to which the lease being renewed correspondsleaseID - identifier assigned by the lease grantor to the
lease being renewedduration - the requested duration for the lease being renewedlong value representing the actual duration that
was granted for the renewed lease. Note that the actual
duration granted and returned by this method may be less than
the duration requested.net.jini.core.lease.UnknownLeaseException - this exception occurs
when the lease being renewed does not exist, or is unknown
to the lease grantor; typically because the lease has expired.NoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
server. When this exception does occur, the lease may or may
not have been renewed successfully.Lease.renew(long),
AbstractLease.renew(long),
AbstractLease.doRenew(long),
FiddlerLease.doRenew(long)public FiddlerRenewResults renewLeases(net.jini.id.Uuid[] registrationIDs, net.jini.id.Uuid[] leaseIDs, long[] durations) throws NoSuchObjectException, RemoteException
LeaseMap,
where each element of the map is a lease on a registration with
ID corresponding to an element of the registrationIDs
parameter.
This method is the "backend" server counterpart to the
renewAll method specified by the
LeaseMap interface, implemented in the
org.apache.river.lease.AbstractLeaseMap class, and
invoked by way of the renewAll method of the
FiddlerLease class; an instance of which is
returned by the getLease method of the
LookupDiscoveryRegistration proxy (an instance of
FiddlerRegistration) that is returned by this service
when a client requests a registration.
renewLeases in interface FiddlerregistrationIDs - array containing the unique identifiers assigned
to the each registration to which each lease
to be renewed correspondsleaseIDs - array containing the identifiers assigned by the
lease grantor to each lease being reneweddurations - array containing the requested durations for
each lease being renewedNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
server. When this exception does occur, this method may or
may not have complete its processing successfully.LeaseMap.renewAll()public void cancelLease(net.jini.id.Uuid registrationID,
net.jini.id.Uuid leaseID)
throws net.jini.core.lease.UnknownLeaseException,
NoSuchObjectException,
RemoteException
cancel method specified by the Lease
interface and implemented in the FiddlerLease class; an
instance of which is returned by the getLease method
of the LookupDiscoveryRegistration proxy (an instance of
FiddlerRegistration) that is returned by this service
when a client requests a registration.
This method cancels the lease corresponding to the given
registrationID and leaseID parameters.
The cancellation of a lease typically involves the modification of the
managed sets in the discovery manager, which usually involves starting
the discovery protocol. An IOException can occur when the discovery
protocol fails to start. When such an exception does occur, this
method registers an ERROR status attribute (along with a Comment
attribute describing the nature of the problem) to all lookup services
with which this service is registered.
Administrative clients, as well as clients that use this service should
have registered for notification of the existence of this attribute.
cancelLease in interface FiddlerregistrationID - unique identifier assigned to the registration
to which the lease being cancelled correspondsleaseID - identifier assigned by the lease grantor to the
lease that is to be cancellednet.jini.core.lease.UnknownLeaseException - this exception occurs
when the lease being cancelled is unknown to the lease grantor.NoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
server. When this exception does occur, the lease may or may
not have been cancelled successfully.Lease.cancel()public Exception[] cancelLeases(net.jini.id.Uuid[] registrationIDs, net.jini.id.Uuid[] leaseIDs) throws NoSuchObjectException, RemoteException
LeaseMap.
For each element in the registrationIDs parameter,
this method will cancel the corresponding element in the
leaseIDs parameter.
cancelLeases in interface FiddlerregistrationIDs - array containing the unique identifiers assigned
to the each registration to which each lease
to be cancelled correspondsleaseIDs - array containing the identifiers assigned by the
lease grantor to each lease being cancelledNoSuchObjectException - if this method is called during
service initialization or shutdown processingRemoteException - typically, this exception occurs when
there is a communication failure between the client and the
server. When this exception does occur, this method may or
may not have complete its processing successfully.LeaseMap.cancelAll()public void start()
throws IOException,
ActivationException,
net.jini.config.ConfigurationException,
LoginException,
ClassNotFoundException
start in interface org.apache.river.api.util.StartableIOExceptionActivationExceptionnet.jini.config.ConfigurationExceptionLoginExceptionClassNotFoundExceptionCopyright © 2016–2019. All rights reserved.