JBoss EJB client 1.0.5.Final

org.jboss.ejb.client
Class ThreadLocalContextSelector<T>

java.lang.Object
  extended by org.jboss.ejb.client.ThreadLocalContextSelector<T>
Type Parameters:
T - the context type
All Implemented Interfaces:
ContextSelector<T>

public final class ThreadLocalContextSelector<T>
extends Object
implements ContextSelector<T>

A context selector which uses thread-local storage.

Author:
David M. Lloyd

Constructor Summary
ThreadLocalContextSelector(ThreadLocal<T> storage)
          Construct a new instance.
 
Method Summary
 T getCurrent()
          Get the current instance, returning null if none are valid in the current context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadLocalContextSelector

public ThreadLocalContextSelector(ThreadLocal<T> storage)
Construct a new instance.

Parameters:
storage - the thread-local from which the value should be selected
Method Detail

getCurrent

public T getCurrent()
Description copied from interface: ContextSelector
Get the current instance, returning null if none are valid in the current context.

Specified by:
getCurrent in interface ContextSelector<T>
Returns:
the instance, or null if there is none

JBoss EJB client 1.0.5.Final

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.