org.javagroups.service.lease
Class LeaseFactoryService.LeaseInfo

java.lang.Object
  extended byorg.javagroups.service.lease.LeaseFactoryService.LeaseInfo
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable
Enclosing class:
LeaseFactoryService

public static class LeaseFactoryService.LeaseInfo
extends java.lang.Object
implements java.io.Externalizable

This class represents granted lease that is replicated between services. Each LeaseInfo class contains information when lease expires (absolute time) and a tenant to which lease was granted.

See Also:
Serialized Form

Field Summary
static int CANCEL_LEASE_TYPE
           
static int NEW_LEASE_TYPE
           
static int RENEW_LEASE_TYPE
           
 
Constructor Summary
LeaseFactoryService.LeaseInfo()
          Create uninitialized instance of this object.
LeaseFactoryService.LeaseInfo(LeaseRequestHeader requestHeader)
          Create instance of this class using request header.
LeaseFactoryService.LeaseInfo(java.lang.Object tenant, long expiresAt)
          Create instance of this class.
 
Method Summary
 long expiresAt()
          Get information when lease expires.
 void extendLease(long newExpiration)
          Extend lease to new expiration term.
 java.lang.Object getTenant()
          Get tenant that owns this lease.
 boolean isExpired()
          Check if lease is expired.
 void readExternal(java.io.ObjectInput in)
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEW_LEASE_TYPE

public static final int NEW_LEASE_TYPE
See Also:
Constant Field Values

RENEW_LEASE_TYPE

public static final int RENEW_LEASE_TYPE
See Also:
Constant Field Values

CANCEL_LEASE_TYPE

public static final int CANCEL_LEASE_TYPE
See Also:
Constant Field Values
Constructor Detail

LeaseFactoryService.LeaseInfo

public LeaseFactoryService.LeaseInfo()
Create uninitialized instance of this object. Should not be used directly, only for Externalizable implementation.


LeaseFactoryService.LeaseInfo

public LeaseFactoryService.LeaseInfo(java.lang.Object tenant,
                                     long expiresAt)
Create instance of this class.


LeaseFactoryService.LeaseInfo

public LeaseFactoryService.LeaseInfo(LeaseRequestHeader requestHeader)
Create instance of this class using request header.

Method Detail

expiresAt

public long expiresAt()
Get information when lease expires.


getTenant

public java.lang.Object getTenant()
Get tenant that owns this lease.


extendLease

public void extendLease(long newExpiration)
Extend lease to new expiration term.


isExpired

public boolean isExpired()
Check if lease is expired.


readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException


Copyright © 2001,2002 www.javagroups.com . All Rights Reserved.