|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
com.kedwards.swt.landlord.BasicLandlord
BasicLandlord.java
This class provides a simple landlord implementation designed to work with Sun's framework.
See http://www.kedwards.com/jini
No warranty expressed or implied; use at your own risk; for educational purposes only.
| Constructor Summary | |
BasicLandlord()
Create a landlord with a default duration policy and no manager. |
|
BasicLandlord(com.sun.jini.lease.landlord.LeaseManager manager)
Create a landlord with a default duration policy and the specified manager. |
|
BasicLandlord(com.sun.jini.lease.landlord.LeasePolicy policy)
Create a landlord with the specified policy. |
|
BasicLandlord(java.lang.String name)
Create a landlord with a default duration policy and no manager. |
|
| Method Summary | |
void |
cancel(java.lang.Object cookie)
Cancel the lease represented by 'cookie' |
java.util.Map |
cancelAll(java.lang.Object[] cookies)
Cancel a set of leases |
com.sun.jini.lease.landlord.LeaseDurationPolicy |
createPolicy(long maximumTime,
long defaultTime)
A little utility factory method to create new lease policies. |
boolean |
ensureCurrent(com.sun.jini.lease.landlord.LeasedResource resource)
Ensure that a currently-managed resource is current. |
java.lang.String |
getName()
Get the name used to identify this landlord. |
com.sun.jini.lease.landlord.LeasedResource |
getResource(java.lang.Object cookie)
Returns the resource for the provided cookie, or null. |
com.sun.jini.lease.landlord.LeasedResource[] |
getResources()
Return all of the resources currently under management by this landlord. |
net.jini.core.lease.Lease |
manageResource(com.sun.jini.lease.landlord.LeasedResource resource,
com.sun.jini.lease.landlord.LeasePolicy policy,
long requestedDuration)
Pass in a new resource to be managed. |
net.jini.core.lease.Lease |
manageResource(com.sun.jini.lease.landlord.LeasedResource resource,
long requestedDuration)
Pass in a new resource to be managed. |
long |
renew(java.lang.Object cookie,
long extension)
Renew the lease specified by 'cookie' |
com.sun.jini.lease.landlord.Landlord.RenewResults |
renewAll(java.lang.Object[] cookies,
long[] extensions)
Renew a set of leases. |
void |
setName(java.lang.String name)
Set the name used to identify this landlord. |
void |
terminate()
Shut down the landlord, killing the reaper thread and terminating all the leased resources. |
| Constructor Detail |
public BasicLandlord()
throws java.rmi.RemoteException
public BasicLandlord(java.lang.String name)
throws java.rmi.RemoteException
public BasicLandlord(com.sun.jini.lease.landlord.LeaseManager manager)
throws java.rmi.RemoteException
public BasicLandlord(com.sun.jini.lease.landlord.LeasePolicy policy)
throws java.rmi.RemoteException
| Method Detail |
public com.sun.jini.lease.landlord.LeaseDurationPolicy createPolicy(long maximumTime,
long defaultTime)
maximum - The maximum time, in milliseconds, of the leases that
will be granted by this policy.default - The default time, in milliseconds, of the leases that will
be granted by this policy.public java.lang.String getName()
public void setName(java.lang.String name)
public net.jini.core.lease.Lease manageResource(com.sun.jini.lease.landlord.LeasedResource resource,
long requestedDuration)
throws net.jini.core.lease.LeaseDeniedException
public net.jini.core.lease.Lease manageResource(com.sun.jini.lease.landlord.LeasedResource resource,
com.sun.jini.lease.landlord.LeasePolicy policy,
long requestedDuration)
throws net.jini.core.lease.LeaseDeniedException
public com.sun.jini.lease.landlord.LeasedResource[] getResources()
public com.sun.jini.lease.landlord.LeasedResource getResource(java.lang.Object cookie)
public void cancel(java.lang.Object cookie)
throws net.jini.core.lease.UnknownLeaseException
public long renew(java.lang.Object cookie,
long extension)
throws net.jini.core.lease.UnknownLeaseException,
net.jini.core.lease.LeaseDeniedException
public java.util.Map cancelAll(java.lang.Object[] cookies)
public com.sun.jini.lease.landlord.Landlord.RenewResults renewAll(java.lang.Object[] cookies,
long[] extensions)
public boolean ensureCurrent(com.sun.jini.lease.landlord.LeasedResource resource)
public void terminate()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||