|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines the interface to lease renewal sets. The interface is not
a remote interface; each implementation of the renewal service
exports proxy objects that implement the LeaseRenewalSet interface
that use an implementation-specific protocol to communicate with
the actual remote server. All of the proxy methods obey normal RMI
remote interface semantics except where explicitly noted. Two
proxy objects are equal if they are proxies for the same set
created by the same renewal service. Every method invocation (on
both LeaseRenewalService and LeaseRenewalSet) is atomic with
respect to other invocations.
A number of the methods in this class throw
RemoteException
, each of these may throw the
java.rmi.NoSuchObjectException
subclass. If a client
receives a NoSuchObjectException
when calling a method
on a renewal set the client can infer that the set has been
destroyed; however, it should not infer that the renewal service
has been destroyed.
LeaseRenewalSet
Method Summary | |
void |
clearExpirationWarningListener()
Remove the listener currently registered for the expiration warning. |
void |
clearRenewalFailureListener()
Remove the listener currently registered for the renewal failure event. |
Lease |
getRenewalSetLease()
Returns the lease that controls the lifetime of this set. |
Lease |
remove(Lease leaseToRemove)
Removes the specified lease from set. |
void |
renewFor(Lease leaseToRenew,
long membershipDuration)
Add a lease to the set. |
EventRegistration |
setExpirationWarningListener(RemoteEventListener listener,
long minWarning,
java.rmi.MarshalledObject handback)
Register for the expiration warning event associated with this set. |
EventRegistration |
setRenewalFailureListener(RemoteEventListener listener,
java.rmi.MarshalledObject handback)
Register for the renewal failure event associated with this set. |
Method Detail |
public void renewFor(Lease leaseToRenew, long membershipDuration) throws java.rmi.RemoteException
Lease.ANY
is passed for membership
duration the set will continue to renew the lease until it
receives a definite exception, each time it will use
Lease.ANY
for the duration. If
Lease.FOREVER
is passed for the membership
duration the set will continue to renew the lease until it
receives a definite exception each time it will use
Lease.FOREVER
for the duration.
If the passed lease is already in the set this call will have the effect of associating the old lease with the new membership duration.
leaseToRenew
- The lease to be added to the renewal setmembershipDuration
- Value for membership duration in millisecondsmembershipDuration
is not positive,
Lease.ANY
, or Lease.FOREVER
. Will
also throw IllegalArgumentException
if
leaseToRenew
is in another set created by the same
renewal server.leaseToRenew
is
null
.public Lease remove(Lease leaseToRemove) throws java.rmi.RemoteException
null
will
be returned.leaseToRemove
- Lease to be removed from the set.null
if it was notleaseToRemove
is
null
.public EventRegistration setExpirationWarningListener(RemoteEventListener listener, long minWarning, java.rmi.MarshalledObject handback) throws java.rmi.RemoteException
If there is already a listener registered for this event, the new listener will replace it. Events sent the new listener will be in the same sequence and have the same event type id as those sent to the old listener.
listener
- The listener to be notified when this event occurs.minWarning
- How long be for the lease on the expires
should the event be sent.handback
- An object to be handed back to the listener
when the warning event occurs.EventRegistration
describing the event
registration.minWarning
negative.listener
is
null
.public void clearExpirationWarningListener() throws java.rmi.RemoteException
public EventRegistration setRenewalFailureListener(RemoteEventListener listener, java.rmi.MarshalledObject handback) throws java.rmi.RemoteException
If there is already a listener registered for this event, the new listener will replace it. Events sent the new listener will be in the same sequence and have the same event type id as those sent to the old listener.
listener
- The listener to be notified when this event occurs.handback
- An object to be handed back to the listener
when the warning event occurs.EventRegistration
describing the event
registration.listener
is
null
.public void clearRenewalFailureListener() throws java.rmi.RemoteException
public Lease getRenewalSetLease()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |