geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Wilkins <gr...@mortbay.com>
Subject Re: [wadi-dev] Session/clustering API and the web tier
Date Fri, 14 Jul 2006 09:06:47 GMT
Jules Gosnell wrote:
> I see the GSM interceptor as a 'peninsula' of the GSM impl, because it
> deals with clustering concerns. The point at which it meets Jetty is at
> the generic interceptor API... - I guess this is one of the bones of
> contention.
> 
> Seen this way, the same interceptor code can be shared across all
> containers (via different interceptor adaptors), rather than duplicated
> by each container.... and less of the GSM's API needs to be exposed to
> the container...

OK, this is the point that I don't get.  

What of the pseudo code below can be shared with other tiers or containers:


public class JettyGeronimoClusterInterceptor extends AbstractJETTYHandler
{

   void handle(JETTYRequest request, JETTYResponse response)
   {
        String sessionId = request.getRequestedSessionId();
      
        if (sessionId!=null)
        {
            MetaSession meta = getCluster().getMetaSession(sessionId);
            if (meta!=null)
            {
                Node node = meta.getExecutionContext(getContextId());
                if (!node.isLocal())
                {
                    relocateRequestInJETTYSpecificWay(node,request,response);
                    return;
                }
            }
        }
        super.handle(request,response);
   }
}

I guess the 3 getXxx calls and the 3 ifs are common, but they
are in a Jetty specific method and call jetty specific code and
use jetty specific params.

In reality, this code will be even more Jetty specific has it 
will have to handle continuations and async proxying etc.

I just don't see that there is enough here to make a huge 
sticking point.   But if you want to wrap this up into a common
ServletRequestClusterInterceptor, then sure!  But I still
think that does not effect the underlying Cluster API.

cheers



Mime
View raw message