|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcasa.JION.lease.Lease
public class Lease
The Lease interface defines a type of object that is returned to the lease holder and issued by the lease grantor. Particular instances of the Lease type will be created by the grantors of a lease, and returned to the holder of the lease as part of the return value from a call that allocates a leased resource. The call that requests a leased resource will typically include a requested duration for the lease. If the request is for a particular duration, the lease grantor is required to grant a lease of no more than the requested period of time. A lease may be granted for a period of time shorter than that requested.
Field Summary |
---|
Fields inherited from interface net.jini.core.lease.Lease |
---|
ABSOLUTE, ANY, DURATION, FOREVER |
Constructor Summary | |
---|---|
Lease(casa.dodwan.docware.Descriptor desc)
Instantiates a new lease. |
|
Lease(java.lang.String entryID,
long duration)
Instantiates a new lease. |
Method Summary | |
---|---|
boolean |
canBatch(net.jini.core.lease.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. |
net.jini.core.lease.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. |
java.lang.String |
getEntryID()
Gets the entry id. |
long |
getExpiration()
|
int |
getSerialFormat()
Returns the format that will be used to serialize the lease. |
casa.dodwan.docware.Descriptor |
leaseToDescriptor()
Lease to descriptor. |
static void |
main(java.lang.String[] args)
The main method. |
void |
renew(long duration)
Used to renew a lease for an additional period of time, specified in milliseconds. |
void |
setSerialFormat(int format)
Sets the format to use when serializing the lease. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Lease(java.lang.String entryID, long duration)
entryID
- the entry idduration
- the durationpublic Lease(casa.dodwan.docware.Descriptor desc)
desc
- the descMethod Detail |
---|
public boolean canBatch(net.jini.core.lease.Lease lease)
canBatch
in interface net.jini.core.lease.Lease
lease
- the Lease to be evaluated
public net.jini.core.lease.LeaseMap createLeaseMap(long duration)
createLeaseMap
in interface net.jini.core.lease.Lease
duration
- the duration to put into a Long and use as the
value for the current lease in the created LeaseMap
public long getExpiration()
getExpiration
in interface net.jini.core.lease.Lease
public int getSerialFormat()
getSerialFormat
in interface net.jini.core.lease.Lease
setSerialFormat(int)
public void cancel() throws net.jini.core.lease.UnknownLeaseException, java.rmi.RemoteException
cancel
in interface net.jini.core.lease.Lease
net.jini.core.lease.UnknownLeaseException
- the lease being cancelled is unknown
to the lease grantor
java.rmi.RemoteException
public void renew(long duration) throws net.jini.core.lease.LeaseDeniedException, net.jini.core.lease.UnknownLeaseException, java.rmi.RemoteException
renew
in interface net.jini.core.lease.Lease
duration
- the requested duration in milliseconds
net.jini.core.lease.LeaseDeniedException
- the lease grantor is unable or
unwilling to renew the lease
net.jini.core.lease.UnknownLeaseException
- the lease being renewed is unknown
to the lease grantor
java.rmi.RemoteException
public void setSerialFormat(int format)
setSerialFormat
in interface net.jini.core.lease.Lease
format
- DURATION or ABSOLUTEgetSerialFormat()
public java.lang.String toString()
toString
in class java.lang.Object
public casa.dodwan.docware.Descriptor leaseToDescriptor()
public java.lang.String getEntryID()
public static void main(java.lang.String[] args)
args
- the arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |