org.jgroups.service.lease

Class LeaseFactoryService.LeaseInfo

Enclosing Class:
LeaseFactoryService
Implemented Interfaces:
java.io.Externalizable

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

LeaseInfo()
Create uninitialized instance of this object.
LeaseInfo(Object tenant, long expiresAt)
Create instance of this class.
LeaseInfo(LeaseRequestHeader requestHeader)
Create instance of this class using request header.

Method Summary

long
expiresAt()
Get information when lease expires.
void
extendLease(long newExpiration)
Extend lease to new expiration term.
Object
getTenant()
Get tenant that owns this lease.
boolean
isExpired()
Check if lease is expired.
void
readExternal(ObjectInput in)
void
writeExternal(ObjectOutput out)

Field Details

CANCEL_LEASE_TYPE

public static final int CANCEL_LEASE_TYPE
Field Value:
3

NEW_LEASE_TYPE

public static final int NEW_LEASE_TYPE
Field Value:
1

RENEW_LEASE_TYPE

public static final int RENEW_LEASE_TYPE
Field Value:
2

Constructor Details

LeaseInfo

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

LeaseInfo

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

LeaseInfo

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

Method Details

expiresAt

public long expiresAt()
Get information when lease expires.

extendLease

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

getTenant

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

isExpired

public boolean isExpired()
Check if lease is expired.

readExternal

public void readExternal(ObjectInput in)
            throws IOException,
                   ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
            throws IOException

Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.