GigaSpaces XAP 8.0 API

com.sun.jini.landlord
Interface Landlord

All Superinterfaces:
Remote
All Known Subinterfaces:
TxnManager
All Known Implementing Classes:
TxnManagerImpl

public interface Landlord
extends Remote

Interface that granters of leases must implement in order to work with the LandlordLease implementation of the Lease interface.

Since:
2.0
Author:
Sun Microsystems, Inc.
See Also:
Lease, LandlordLease

Nested Class Summary
static class Landlord.RenewResults
          Simple class that holds return values of the Landlord.renewAll method.
 
Method Summary
 void cancel(Uuid cookie)
          Called by the lease when its cancel method is called.
 Map cancelAll(Uuid[] cookies)
          Called by the lease map when its cancelAll method is called.
 long renew(Uuid cookie, long duration)
          Called by the lease when its renew method is called.
 Landlord.RenewResults renewAll(Uuid[] cookies, long[] durations)
          Called by the lease map when its renewAll method is called.
 

Method Detail

renew

long renew(Uuid cookie,
           long duration)
           throws LeaseDeniedException,
                  UnknownLeaseException,
                  RemoteException
Called by the lease when its renew method is called. Renews the lease that is associated with the given cookie.

Parameters:
cookie - the Uuid associated with the lease who's renew method was called
duration - argument passed to the renew call
Returns:
The new duration the lease should have
Throws:
LeaseDeniedException - if the landlord is unwilling to renew the lease
UnknownLeaseException - if landlord does not know about a lease with the specified cookie
RemoteException - if a communications failure occurs

cancel

void cancel(Uuid cookie)
            throws UnknownLeaseException,
                   RemoteException
Called by the lease when its cancel method is called. Cancels the lease that is associated with the given cookie.

Parameters:
cookie - the Uuid associated with the lease who's renew method was called
Throws:
UnknownLeaseException - if landlord does not know about a lease with the specified cookie
RemoteException - if a communications failure occurs

renewAll

Landlord.RenewResults renewAll(Uuid[] cookies,
                               long[] durations)
                               throws RemoteException
Called by the lease map when its renewAll method is called. Should renew the lease that is associated with each element of cookies

Parameters:
cookies - an array of Uuids, each universally and uniquely identifying a lease granted by this Landlord
durations - an array of longs, each representing an a duration in milliseconds that the client wants the lease associated with the Uuid from the corresponding element of cookies renewed for
Returns:
A RenewResults object that contains the new duration of each lease that was successfully renewed or the exception encountered for each lease that could not be renewed
Throws:
RemoteException - if a communications failure occurs

cancelAll

Map cancelAll(Uuid[] cookies)
              throws RemoteException
Called by the lease map when its cancelAll method is called. Should cancel the lease that is associated with each element of cookies

Parameters:
cookies - an array of Uuids, each universally and uniquely identifying a lease granted by this Landlord
Returns:
If all the leases specified in the cookies could be cancelled return null. Otherwise, return a Map that for each failed cancel attempt maps the corresponding cookie object to an exception describing the failure.
Throws:
RemoteException - if a communications failure occurs

GigaSpaces XAP 8.0 API

Copyright © GigaSpaces.