a thread local is a mere reference so having a thread local of portlet invocation is
better than 4 thread local of invocation.
if you don't want to pass the whole invocation you can pass the current phase
org.gatein.pc.api.LifeCyclePhase from pc api.
On Apr 19, 2013, at 2:28 PM, Ken Finnigan <kfinniga(a)redhat.com> wrote:
I have it working with a single ThreadLocal of PortletInvocation.
Just wondering whether I should modify it to 4 ThreadLocal's of Boolean to reduce the
memory footprint? As at this stage I don't believe I need anything more than what type
of request it is, not any contents of PortletInvocation.
Ken
From: "Julien Viet" <julien(a)julienviet.com>
To: "Ken Finnigan" <kfinniga(a)redhat.com>
Cc: gatein-dev(a)lists.jboss.org
Sent: Thursday, April 18, 2013 4:34:35 PM
Subject: Re: [gatein-dev] Determining the type of PortletRequest from a Servlet Request
Listener
I would rather not do because servlet request attributes as those are visible then from
the portlet request attributes and that's something I prefer to avoid.
What about having an interceptor in GateIn (it's the place where integration occurs)
placed before the ContextDispatcherInterceptor that setup the information you need
associated with a thread local ?
On Apr 18, 2013, at 10:07 PM, Ken Finnigan <kfinniga(a)redhat.com> wrote:
Does anyone know if its possible to determine what kind of PortletRequest
(Action/Render/etc) is being triggered from the raw ServletRequest? Before the Portlet
Container interceptors have fired.
If it's not possible, does anyone have any objections to modifying PC to set a value
onto the request to make it identifiable?
An initial thought is to modify ContextDispatcherInterceptor.invoke() from
CallableImpl callable = new CallableImpl(invocation);
reqCtx.dispatch(targetCtx, invocation.getRequest(), invocation.getResponse(),
callable);
return callable.response;
to
CallableImpl callable = new CallableImpl(invocation);
invocation.getRequest().setAttribute("cdi.portlet.invocation",
invocation);
reqCtx.dispatch(targetCtx, invocation.getRequest(), invocation.getResponse(),
callable);
return callable.response;
The actual attribute name I've just set to anything to illustrate the code at
present.
If not the invocation itself, then can we set an Enum or integer value to indicate the
portlet request type?
Thanks
Ken
========================
Senior Software Engineer / JBoss Enterprise Middleware Red Hat, Inc.
_______________________________________________
gatein-dev mailing list
gatein-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/gatein-dev