Package com.sun.jini.reggie
Class ConstrainableEventLease
java.lang.Object
com.sun.jini.lease.AbstractLease
com.sun.jini.reggie.EventLease
com.sun.jini.reggie.ConstrainableEventLease
- All Implemented Interfaces:
Serializable,RemoteMethodControl,Lease,ReferentUuid
EventLease subclass that supports constraints.
- Author:
- Sun Microsystems, Inc.
- See Also:
-
Field Summary
Fields inherited from class com.sun.jini.lease.AbstractLease
expiration, serialFormat -
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo leases can be batched if they are both RegistrarLeases, share the same server, and have compatible constraints.createLeaseMap(long duration) Creates a constraint-aware lease map.booleanReturns true if lease Uuids match, false otherwise.Returns the client constraints placed on this proxy.Returns the lease Uuid.inthashCode()Returns the lease Uuid's hash code.setConstraints(MethodConstraints constraints) Returns a new copy of this proxy with the client constraints set to the specified constraints.toString()Returns a string created from the proxy class name, the registrar's service ID, the id of the lessee or event (depending on the subclass), and the result of the underlying server proxy's toString method.Methods inherited from class com.sun.jini.reggie.EventLease
cancel, doRenewMethods inherited from class com.sun.jini.lease.AbstractLease
getExpiration, getSerialFormat, renew, setSerialFormat
-
Method Details
-
createLeaseMap
Creates a constraint-aware lease map.- Specified by:
createLeaseMapin interfaceLease- Parameters:
duration- the duration to put into a Long and use as the value for the current lease in the created LeaseMap- Returns:
- the created LeaseMap object
-
canBatch
Two leases can be batched if they are both RegistrarLeases, share the same server, and have compatible constraints. -
setConstraints
Description copied from interface:RemoteMethodControlReturns a new copy of this proxy with the client constraints set to the specified constraints. These constraints completely replace (in the copy) any client constraints previously placed on this proxy; calling thegetConstraintsmethod of the copy returns the identical constraints instance. The original proxy is not modified. Anullvalue 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 thegetConstraintsmethod of the specifiedMethodConstraintsinstance with aMethodobject 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
s1obtains a proxy for remote objects2, and passes that proxy to remote objects3, expectings3to invoke a remote method ons2, thens1can control that call by placing its constraints directly on the proxy before passing it tos3. Ifs3does 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 own policy.- Specified by:
setConstraintsin interfaceRemoteMethodControl- Parameters:
constraints- client constraints, ornull- Returns:
- a new copy of this proxy with the client constraints set to the specified constraints
- See Also:
-
getConstraints
Description copied from interface:RemoteMethodControlReturns the client constraints placed on this proxy. The return value can benull, which is interpreted as mapping all methods to empty constraints (one that has no requirements and no preferences).- Specified by:
getConstraintsin interfaceRemoteMethodControl- Returns:
- the client constraints, or
null - See Also:
-
getReferentUuid
Returns the lease Uuid.- Specified by:
getReferentUuidin interfaceReferentUuid- Returns:
- the
Uuidassociated with the resource this proxy represents. Will not returnnull.
-
hashCode
public int hashCode()Returns the lease Uuid's hash code. -
equals
Returns true if lease Uuids match, false otherwise. -
toString
Returns a string created from the proxy class name, the registrar's service ID, the id of the lessee or event (depending on the subclass), and the result of the underlying server proxy's toString method.
-