com.lonniepryor.blues
Class Local

java.lang.Object
  |
  +--com.lonniepryor.blues.Local

public class Local
extends java.lang.Object

Provides a service similiar to the ThreadLocal class, except values of blues Locals can only exist between the creation of a Session and the subsequent calling of it's dispose() method. Values of these Locals will therefore be safely disposed of without relying on garbage collection.

Version:
$Revision: 1.1 $
Author:
Lonnie Pryor

Constructor Summary
Local()
          Creates a new Local object.
 
Method Summary
protected  java.lang.Object createValue()
          Creates the inital value of this Local, returns null by default.
protected  void disposeValue(java.lang.Object value)
          Disposed the value of this local when the Session is disposed, does nothing by default.
 boolean equals(java.lang.Object obj)
           
 java.lang.Object get()
          Returns the value of this Local in the currently bound Session.
 int hashCode()
           
 void set(java.lang.Object value)
          Sets the value of this Local in the currently bound Session.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Local

public Local()
Creates a new Local object.

Method Detail

get

public final java.lang.Object get()
Returns the value of this Local in the currently bound Session.

Returns:
The value of this Local in the currently bound Session.

set

public final void set(java.lang.Object value)
Sets the value of this Local in the currently bound Session.

Parameters:
value - The new value of this Local in the currently bound Session.

equals

public final boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

createValue

protected java.lang.Object createValue()
Creates the inital value of this Local, returns null by default.

Returns:
The inital value of this Local.

disposeValue

protected void disposeValue(java.lang.Object value)
Disposed the value of this local when the Session is disposed, does nothing by default.

Parameters:
value - The local value to dispose.


Copyright © 2003 Blues Framework. All Rights Reserved.