Package com.sun.jini.reggie
Class EventLease
java.lang.Object
com.sun.jini.lease.AbstractLease
com.sun.jini.reggie.EventLease
- All Implemented Interfaces:
Serializable,Lease,ReferentUuid
- Direct Known Subclasses:
ConstrainableEventLease
When a registrar (lookup service) grants a lease on an event registration on behalf of some
object (client), a proxy is employed to allow the client to interact with the lease; this class
is the implementation of that proxy. Clients only see instances of this class via the Lease
interface.
- Author:
- Sun Microsystems, Inc.
- See Also:
-
Field Summary
Fields inherited from class com.sun.jini.lease.AbstractLease
expiration, serialFormat -
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo leases can be batched if they are both RegistrarLeases and have the same server.voidcancel()Used by the lease holder to indicate that it is no longer interested in the resource or information held by the lease.createLeaseMap(long duration) Creates a lease map.protected longdoRenew(long duration) Renews the event lease associated with an instance of this class.booleanReturns true if lease Uuids match, false otherwise.Returns the lease Uuid.inthashCode()Returns the lease Uuid's hash code.toString()Returns a string created from the proxy class name, the registrar's service ID, the id of the lessee or event (depending on the subclass), and the result of the underlying server proxy's toString method.Methods inherited from class com.sun.jini.lease.AbstractLease
getExpiration, getSerialFormat, renew, setSerialFormat
-
Method Details
-
cancel
Description copied from interface:LeaseUsed by the lease holder to indicate that it is no longer interested in the resource or information held by the lease. If the leased information or resource could cause a callback to the lease holder (or some other object on behalf of the lease holder), the lease grantor should not issue such a callback after the lease has been cancelled. The overall effect of a cancel call is the same as lease expiration, but instead of happening at the end of a pre-agreed duration it happens immediately.- Throws:
UnknownLeaseException- the lease being cancelled is unknown to the lease grantorRemoteException
-
doRenew
Renews the event lease associated with an instance of this class. Each instance of this class corresponds to a lease on an event registration for a particular client. This method renews that lease on behalf of the client.- Specified by:
doRenewin classAbstractLease- Parameters:
duration- the requested duration for the lease being renewed- Returns:
- long value representing the new duration that was granted for the renewed lease. Note that the duration returned may be less than the duration requested.
- Throws:
UnknownLeaseException- indicates the lease does not exist; typically because the lease has expired.RemoteException
-
createLeaseMap
Creates a lease map.- Specified by:
createLeaseMapin interfaceLease- Parameters:
duration- the duration to put into a Long and use as the value for the current lease in the created LeaseMap- Returns:
- the created LeaseMap object
-
canBatch
Two leases can be batched if they are both RegistrarLeases and have the same server. -
getReferentUuid
Returns the lease Uuid.- Specified by:
getReferentUuidin interfaceReferentUuid- Returns:
- the
Uuidassociated with the resource this proxy represents. Will not returnnull.
-
hashCode
public int hashCode()Returns the lease Uuid's hash code. -
equals
Returns true if lease Uuids match, false otherwise. -
toString
Returns a string created from the proxy class name, the registrar's service ID, the id of the lessee or event (depending on the subclass), and the result of the underlying server proxy's toString method.
-