class ServiceLease extends RegistrarLease
| Modifier and Type | Field and Description |
|---|---|
private static String |
LEASE_TYPE
The type of the lease used in toString() calls.
|
private static long |
serialVersionUID |
(package private) ServiceID |
serviceID
The service id assigned at registration.
|
leaseID, registrarID, serverexpiration, serialFormat| Constructor and Description |
|---|
ServiceLease(Registrar server,
ServiceID registrarID,
ServiceID serviceID,
Uuid leaseID,
long expiration)
Constructor for use by getInstance(), ConstrainableServiceLease.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Used by the lease holder to indicate that it is no longer interested
in the resource or information held by the lease.
|
protected long |
doRenew(long duration)
Do the actual renew.
|
(package private) static ServiceLease |
getInstance(Registrar server,
ServiceID registrarID,
ServiceID serviceID,
Uuid leaseID,
long expiration)
Returns ServiceLease or ConstrainableServiceLease instance, depending on
whether given server implements RemoteMethodControl.
|
(package private) String |
getLeaseType()
Returns the type of the lease.
|
(package private) Object |
getRegID()
Returns the service ID, or the event ID as a Long.
|
(package private) ServiceID |
getServiceID()
Returns the service ID
|
private void |
readObject(ObjectInputStream in)
Reads the service ID, encoded as specified by the ServiceID.writeBytes
method.
|
private void |
readObjectNoData()
Throws InvalidObjectException, since data for this class is required.
|
private void |
writeObject(ObjectOutputStream out)
Writes the service ID, encoded as specified by the ServiceID.writeBytes
method.
|
canBatch, createLeaseMap, equals, getReferentUuid, getRegistrar, getRegistrarID, hashCode, identity, setExpiration, toStringgetExpiration, getSerialFormat, renew, setSerialFormatprivate static final long serialVersionUID
private static final String LEASE_TYPE
transient ServiceID serviceID
static ServiceLease getInstance(Registrar server, ServiceID registrarID, ServiceID serviceID, Uuid leaseID, long expiration)
public void cancel()
throws UnknownLeaseException,
RemoteException
LeaseUnknownLeaseException - the lease being cancelled is unknown
to the lease grantorRemoteExceptionprotected long doRenew(long duration)
throws UnknownLeaseException,
RemoteException
doRenew in class AbstractLeaseUnknownLeaseExceptionRemoteExceptionServiceID getServiceID()
Object getRegID()
RegistrarLeasegetRegID in class RegistrarLeaseString getLeaseType()
RegistrarLeasegetLeaseType in class RegistrarLeaseprivate void writeObject(ObjectOutputStream out) throws IOException
IOExceptionprivate void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionprivate void readObjectNoData()
throws ObjectStreamException
ObjectStreamExceptionCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.