com.sun.jini.norm
Interface NormServer

All Superinterfaces:
Administrable, DestroyAdmin, JoinAdmin, Landlord, LeaseRenewalService, Remote, ServiceProxyAccessor
All Known Implementing Classes:
ActivatableNormServerImpl, NormServerBaseImpl, PersistentNormServerImpl, TransientNormServerImpl

interface NormServer
extends Landlord, LeaseRenewalService, Administrable, JoinAdmin, DestroyAdmin, ServiceProxyAccessor, Remote

This interface is the private wire protocol to that the various proxy objects created by a Norm server (the lease renewal service itself, sets, leases, admins, etc.) use to communicate back to the server.

Author:
Sun Microsystems, Inc.

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.sun.jini.landlord.Landlord
Landlord.RenewResults
 
Field Summary
static long NO_LISTENER
          If calling setExpirationWarningListener with a null listener, this is the value that should be passed.
 
Method Summary
 GetLeasesResult getLeases(Uuid id)
          Return all the leases in the set.
 Lease remove(Uuid id, Lease leaseToRemove)
          Remove a lease from a set.
 void renewFor(Uuid id, Lease leaseToRenew, long membershipDuration, long renewDuration)
          Add a lease to a set.
 EventRegistration setExpirationWarningListener(Uuid id, RemoteEventListener listener, long minWarning, MarshalledObject handback)
          Set the expiration warning listener for a set.
 EventRegistration setRenewalFailureListener(Uuid id, RemoteEventListener listener, MarshalledObject handback)
          Set the renewal failure listener for a set.
 
Methods inherited from interface com.sun.jini.landlord.Landlord
cancel, cancelAll, renew, renewAll
 
Methods inherited from interface net.jini.lease.LeaseRenewalService
createLeaseRenewalSet
 
Methods inherited from interface net.jini.admin.Administrable
getAdmin
 
Methods inherited from interface net.jini.admin.JoinAdmin
addLookupAttributes, addLookupGroups, addLookupLocators, getLookupAttributes, getLookupGroups, getLookupLocators, modifyLookupAttributes, removeLookupGroups, removeLookupLocators, setLookupGroups, setLookupLocators
 
Methods inherited from interface com.sun.jini.admin.DestroyAdmin
destroy
 
Methods inherited from interface com.sun.jini.start.ServiceProxyAccessor
getServiceProxy
 

Field Detail

NO_LISTENER

static final long NO_LISTENER
If calling setExpirationWarningListener with a null listener, this is the value that should be passed.

See Also:
Constant Field Values
Method Detail

renewFor

void renewFor(Uuid id,
              Lease leaseToRenew,
              long membershipDuration,
              long renewDuration)
              throws RemoteException,
                     ThrowThis
Add a lease to a set.

Parameters:
id - what set the lease should be added to
leaseToRenew - the lease to be added to the set
membershipDuration - how long the lease should be in the set
renewDuration - how long the lease should be renewed for each time it is renewed
Throws:
ThrowThis - when another exception has to be thrown by the proxy
RemoteException - if a communication-related exception occurs

remove

Lease remove(Uuid id,
             Lease leaseToRemove)
             throws RemoteException,
                    ThrowThis
Remove a lease from a set.

Parameters:
id - of set being operated on
leaseToRemove - the lease to be removed from the set
Throws:
ThrowThis - when another exception has to be thrown by the proxy
RemoteException - if a communication-related exception occurs

getLeases

GetLeasesResult getLeases(Uuid id)
                          throws RemoteException,
                                 ThrowThis
Return all the leases in the set. Returns null or a zero-length array if there are no leases in the set.

Parameters:
id - of set being operated on
Returns:
an object containing an array of MarshalledInstances, one for each lease
Throws:
ThrowThis - when another exception has to be thrown by the proxy
RemoteException - if a communication-related exception occurs

setExpirationWarningListener

EventRegistration setExpirationWarningListener(Uuid id,
                                               RemoteEventListener listener,
                                               long minWarning,
                                               MarshalledObject handback)
                                               throws RemoteException,
                                                      ThrowThis
Set the expiration warning listener for a set. Also used to cancel a registration.

Parameters:
id - of set being operated on
listener - listener to be notified when this event occurs. Pass null to clear the registration.
minWarning - how long be for the lease on the set expires should the event be sent. Ignored if listener is null.
handback - an object to be handed back to the listener when the warning event occurs. Ignored if listener is null.
Returns:
an EventRegistration object for the new registration if listener is non-null and null otherwise
Throws:
ThrowThis - when another exception has to be thrown by the proxy
RemoteException - if a communication-related exception occurs

setRenewalFailureListener

EventRegistration setRenewalFailureListener(Uuid id,
                                            RemoteEventListener listener,
                                            MarshalledObject handback)
                                            throws RemoteException,
                                                   ThrowThis
Set the renewal failure listener for a set. Also used to cancel a registration.

Parameters:
id - of set being operated on
listener - listener to be notified when this event occurs. Pass null to clear the registration.
handback - an object to be handed back to the listener when the failure event occurs. Ignored if listener is null.
Returns:
an EventRegistration object for the new registration if listener is non-null and null otherwise.
Throws:
ThrowThis - when another exception has to be thrown by the proxy
RemoteException - if a communication-related exception occurs


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.