public final class ConstrainableLandlordLease extends LandlordLease implements RemoteMethodControl
LandlordLease. Instances of this class can be verified using the
|Constructor and Description|
Create a new
|Modifier and Type||Method and Description|
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.
Creates a Map object that can contain leases whose renewal or cancellation can be batched, and adds the current lease to that map.
Returns the client constraints placed on this proxy.
Returns a new copy of this proxy with the client constraints set to the specified constraints.
cancel, doRenew, equals, getReferentUuid, hashCode, setLandlord, toString
getExpiration, getSerialFormat, renew, setSerialFormat
public ConstrainableLandlordLease(Uuid cookie, Landlord landlord, Uuid landlordUuid, long expiration, MethodConstraints methodConstraints)
Uuidthat universally and uniquely identifies the lease this object is to be a proxy for
Landlordobject that will be used to communicate renew and cancel requests to the granter of the lease.
landlordUuid- a universally unique id that has been assigned to the server granting of the lease. Ideally the
landlord.getUuidwould return if
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.
methodConstraints- the client method constraints to place on this proxy (may be
landlorddoes not implement
public RemoteMethodControl setConstraints(MethodConstraints constraints)
getConstraintsmethod of the copy returns the identical constraints instance. The original proxy is not modified. A
nullvalue is interpreted as mapping all methods to empty constraints (one that has no requirements and no preferences). For any given remote call, the specific client requirements and preferences to be satisfied are given by the return value of invoking the
getConstraintsmethod of the specified
MethodConstraintsinstance with a
Methodobject representing the remote method.
Client constraints placed on a proxy are included in the serialized state
of the proxy. This allows third-party services to be transparent to the client's needs. For
example, if remote object
s1 obtains a proxy for remote object
and passes that proxy to remote object
s3 to invoke a
remote method on
s1 can control that call by placing its
constraints directly on the proxy before passing it to
does not wish to be transparent in this way, then it should explicitly replace the client
constraints on received proxies with whatever constraints are appropriate to implement its
public MethodConstraints getConstraints()
null, which is interpreted as mapping all methods to empty constraints (one that has no requirements and no preferences).
public boolean canBatch(Lease lease)
public LeaseMap createLeaseMap(long duration)
Copyright © GigaSpaces.