|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jini.lease.AbstractLease
com.sun.jini.landlord.LandlordLease
public class LandlordLease
Basic implementation of net.jini.core.lease.Lease
that works
with the the Landlord protocol.
Landlord
,
Serialized FormField Summary | |
---|---|
private Uuid |
cookie
A universally unique ID that identifies the lease this object represents. |
private Landlord |
landlord
Owner of the resource associated with this lease. |
private Uuid |
landlordUuid
The Uuid of the landlord . |
(package private) static long |
serialVersionUID
|
Fields inherited from class com.sun.jini.lease.AbstractLease |
---|
expiration, serialFormat |
Fields inherited from interface net.jini.core.lease.Lease |
---|
ABSOLUTE, ANY, DURATION, FOREVER |
Constructor Summary | |
---|---|
LandlordLease(Uuid cookie,
Landlord landlord,
Uuid landlordUuid,
long expiration)
Create a new LandlordLease . |
Method Summary | |
---|---|
boolean |
canBatch(Lease lease)
Returns a boolean indicating whether or not the lease given as a parameter can be batched (placed in the same LeaseMap) with the current lease. |
void |
cancel()
Used by the lease holder to indicate that it is no longer interested in the resource or information held by the lease. |
(package private) Uuid |
cookie()
Return the cookie. |
LeaseMap |
createLeaseMap(long duration)
Creates a Map object that can contain leases whose renewal or cancellation can be batched, and adds the current lease to that map. |
protected long |
doRenew(long renewDuration)
Renew the lease for a duration relative to now, and return the duration actually granted. |
boolean |
equals(Object other)
|
Uuid |
getReferentUuid()
Return the Uuid that has been assigned to the
resource this proxy represents. |
int |
hashCode()
|
(package private) Landlord |
landlord()
Return the landlord. |
(package private) Uuid |
landlordUuid()
Return the landlord's Uuid. |
private void |
readObject(ObjectInputStream in)
Read this object back validating state. |
private void |
readObjectNoData()
We should always have data in the stream, if this method gets called there is something wrong. |
(package private) void |
setExpiration(long expiration)
Set the expiration. |
String |
toString()
|
Methods inherited from class com.sun.jini.lease.AbstractLease |
---|
getExpiration, getSerialFormat, renew, setSerialFormat |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
static final long serialVersionUID
private final Uuid cookie
private final Landlord landlord
private final Uuid landlordUuid
Uuid
of the landlord
. Used
to determine if two leases can be batched together.
Constructor Detail |
---|
public LandlordLease(Uuid cookie, Landlord landlord, Uuid landlordUuid, long expiration)
LandlordLease
.
cookie
- a Uuid
that universally and uniquely
identifies the lease this object is to be a proxy forlandlord
- Landlord
object that will be used to
communicate renew and cancel requests to the granter
of the leaselandlordUuid
- a universally unique id that has been
assigned to the server granting of the lease.
Ideally the Uuid
landlord.getUuid
would
return if landlord
implemented
ReferentUuid
. Used to determine when
two leases can be batched together.expiration
- the initial expiration time of the lease in
milliseconds since the beginning of the epoch
NullPointerException
- if landlord
,
landlordUuid
or cookie
is nullMethod Detail |
---|
public void cancel() throws UnknownLeaseException, RemoteException
Lease
cancel
in interface Lease
UnknownLeaseException
- the lease being cancelled is unknown
to the lease grantor
RemoteException
protected long doRenew(long renewDuration) throws LeaseDeniedException, UnknownLeaseException, RemoteException
AbstractLease
doRenew
in class AbstractLease
LeaseDeniedException
UnknownLeaseException
RemoteException
public Uuid getReferentUuid()
ReferentUuid
Uuid
that has been assigned to the
resource this proxy represents.
getReferentUuid
in interface ReferentUuid
Uuid
associated with the
resource this proxy represents. Will not
return null
.public boolean equals(Object other)
equals
in class Object
public boolean canBatch(Lease lease)
Lease
canBatch
in interface Lease
lease
- the Lease to be evaluated
Landlord landlord()
Uuid landlordUuid()
Uuid cookie()
void setExpiration(long expiration)
public LeaseMap createLeaseMap(long duration)
Lease
createLeaseMap
in interface Lease
duration
- the duration to put into a Long and use as the
value for the current lease in the created LeaseMap
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
private void readObjectNoData() throws InvalidObjectException
InvalidObjectException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |