com.sun.jini.norm
Class LeaseTable

java.lang.Object
  extended by com.sun.jini.norm.LeaseTable

 class LeaseTable
extends Object

Maps client leases to the wrapper objects that we use internally.

Internally we keep two tables of client leases, one mapping client leases to client lease wrappers, the other a list of client lease wrappers whose leases could not be unpacked (aka "deformed wrappers") when they were added (and thus could not be put in the map). This bifurcation is not exposed to the client.

Unless otherwise noted the methods of this class are not thread safe.

Author:
Sun Microsystems, Inc.

Field Summary
private  DeformedLeaseList deformedLeases
          The list we store deformed wrappers in.
private  Map leaseTable
          The map we use to map client leases to wrappers.
 
Constructor Summary
LeaseTable()
           
 
Method Summary
(package private)  ClientLeaseWrapper get(Lease clientLease)
          Find the client lease wrapper associated with the passed lease.
(package private)  void put(ClientLeaseWrapper clw)
          Add a mapping from lease wrapper to client lease.
(package private)  void remove(ClientLeaseWrapper clw)
          Remove a lease from the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

deformedLeases

private final DeformedLeaseList deformedLeases
The list we store deformed wrappers in.


leaseTable

private final Map leaseTable
The map we use to map client leases to wrappers.

Constructor Detail

LeaseTable

LeaseTable()
Method Detail

get

ClientLeaseWrapper get(Lease clientLease)
Find the client lease wrapper associated with the passed lease.

Parameters:
clientLease - the lease we need the wrapper for
Returns:
the wrapper associated with the passed lease, or null if we don't know about this lease

put

void put(ClientLeaseWrapper clw)
Add a mapping from lease wrapper to client lease. Gets client lease from wrapper.

Parameters:
clw - client lease wrapper, and client lease to add to table

remove

void remove(ClientLeaseWrapper clw)
Remove a lease from the table.

Parameters:
clw - client lease wrapper for the lease we want to remove


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