Hi, RequestGlobals.getRequest() should return null I think:
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/RequestGlobals.html#getRequest() On Mon, Nov 18, 2013 at 4:40 PM, Wechsung, Wulf <wulf.wechs...@sap.com>wrote: > Hi everyone, > > I want to build a service that works transparently for web request threads > and system threads. If called in a web request it should utilize session > storage via ASM and if called from a background thread it should just > return the value of a ThreadLocal<?>. > > What I can't find out is: is there a simple way to find out if a Request > object exists for the thread (and therefore ASM.get() will work) or not > (and therefore cause ASM methods to throw NPEs)? > > Thanks in advance and kind regards, > Wulf Wechsung > > > > > > > -- Dmitry Gusev AnjLab Team http://anjlab.com