Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Optimizing Embedded Jetty, LocalConnector within another Web Container

Hi, 

We use WebObjects as our HTTP container due to organizational requirements.   

However, 95% of our business logic is in a Jetty/Spring container.  This Jetty/Spring container is capable of running stand-alone as well.  [The remaining 5% is what WebObjects provides] 

We have successfully embedded this Jetty/Spring container in WebObjects and use LocalConnector.   

The flow for any request/response cycle is roughly like this: 

a. WebObjects receives the request and assigns one of its worker threads to process this request
b. WebObjects performs some authentication/authorization
c. We convert from a WORequest to a raw HTTP request
d. We use embedded Jetty and the LocalConnector to invoke the business logic
e. Jetty assigns on of its threads from the Jetty thread pool for further processing
f. On the way back, we convert the HTTP Response to a WOResponse
g. If required, we add some additional info to the WOResponse

Step e. above is suboptimal for us, because we are already in the context of a WebObjects thread assigned in Step a. [from the WebObjects thread pool].  We would like to continue to use that same WebObjects thread for the Jetty LocalConnector processing. 

Looking at the sources of LocalConnector available at 
http://download.eclipse.org/jetty/stable-7/xref/org/eclipse/jetty/server/LocalConnector.html

In LocalConnector there is: 
private class Request implements Runnable 

The bulk of the processing logic for local requests seems to reside in the run() method of this private class.

We were wondering if we either:

a. just extracted the implementation of the run() method of this Request class, and executed it inline in the WebObjects thread, then would things work just fine? 

Or 

b. is there some other such Connector available already so that we can continue to process the request in the context of a thread that's already been dedicated for our processing? 

Thanks for your help! 
Karthik


Back to the top