|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.directwebremoting.guice.DwrGuiceUtil
public class DwrGuiceUtil
Utilities for making Injector and ServletContext instances available.
| Field Summary | |
|---|---|
static java.lang.String |
INJECTOR
The key under which a provided Injector is stashed in a ServletContext. |
| Constructor Summary | |
|---|---|
DwrGuiceUtil()
|
|
| Method Summary | ||
|---|---|---|
static com.google.inject.Injector |
getInjector()
Returns the Injector instance published in the current servlet context. |
|
static javax.servlet.ServletContext |
getServletContext()
Gets the servlet context from the thread-local stash, if any, otherwise from the current web context, if one exists, otherwise from the singleton server context, if it exists, otherwise from the first of all server contexts, if there are any, otherwise null. |
|
static
|
withServletContext(javax.servlet.ServletContext servletContext,
java.util.concurrent.Callable<T> callable)
Executes the given Callable with the thread-locally stashed servlet context set to the given value, and returns the result. |
|
static void |
withServletContext(javax.servlet.ServletContext servletContext,
java.lang.Runnable runnable)
Executes the given Runnable with the thread-locally stashed servlet context set to the given value. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String INJECTOR
| Constructor Detail |
|---|
public DwrGuiceUtil()
| Method Detail |
|---|
public static com.google.inject.Injector getInjector()
public static javax.servlet.ServletContext getServletContext()
public static void withServletContext(javax.servlet.ServletContext servletContext,
java.lang.Runnable runnable)
public static <T> T withServletContext(javax.servlet.ServletContext servletContext,
java.util.concurrent.Callable<T> callable)
throws java.lang.Exception
java.lang.Exception
|
Copyright ยจ 2008 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||