public class ThreadSingletonServiceImpl extends Object implements ThreadSingletonService
| Constructor and Description |
|---|
ThreadSingletonServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear(Object key) |
Object |
contextEntered(org.apache.webbeans.config.WebBeansContext newOWBContext) |
void |
contextExited(Object oldContext) |
static org.apache.webbeans.config.WebBeansContext |
enter(org.apache.webbeans.config.WebBeansContext newOWBContext) |
static void |
exit(Object oldContext) |
static org.apache.webbeans.config.WebBeansContext |
get(ClassLoader cl)
Generally contexts.get() is enough since we set the current context from a request (see webbeanslistener)
but sometimes matching the classloader is better (manager webapps of tomcat deploys for instance)
so here the algorithm:
1) try to match with the classloader
2) if not matched try to use the threadlocal
3) (shouldn't happen) simply return the biggest webbeancontext
|
org.apache.webbeans.config.WebBeansContext |
get(Object key) |
void |
initialize(StartupObject startupObject) |
String |
sessionContextClass() |
public static final Logger logger
public void initialize(StartupObject startupObject)
initialize in interface ThreadSingletonServicepublic Object contextEntered(org.apache.webbeans.config.WebBeansContext newOWBContext)
contextEntered in interface ThreadSingletonServicepublic static org.apache.webbeans.config.WebBeansContext enter(org.apache.webbeans.config.WebBeansContext newOWBContext)
public void contextExited(Object oldContext)
contextExited in interface ThreadSingletonServicepublic static void exit(Object oldContext)
public static org.apache.webbeans.config.WebBeansContext get(ClassLoader cl)
cl - the key (generally TCCL)public org.apache.webbeans.config.WebBeansContext get(Object key)
get in interface org.apache.webbeans.spi.SingletonService<org.apache.webbeans.config.WebBeansContext>public void clear(Object key)
clear in interface org.apache.webbeans.spi.SingletonService<org.apache.webbeans.config.WebBeansContext>public String sessionContextClass()
sessionContextClass in interface ThreadSingletonServiceCopyright © 1999–2014 The Apache Software Foundation. All rights reserved.