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, server
expiration, 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, setExpiration, toString
getExpiration, getSerialFormat, renew, setSerialFormat
private 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
Lease
UnknownLeaseException
- the lease being cancelled is unknown
to the lease grantorRemoteException
protected long doRenew(long duration) throws UnknownLeaseException, RemoteException
doRenew
in class AbstractLease
UnknownLeaseException
RemoteException
ServiceID getServiceID()
Object getRegID()
RegistrarLease
getRegID
in class RegistrarLease
String getLeaseType()
RegistrarLease
getLeaseType
in class RegistrarLease
private void writeObject(ObjectOutputStream out) throws IOException
IOException
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
private void readObjectNoData() throws ObjectStreamException
ObjectStreamException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.