You're code looks fine to me.     You could likely test it just by doing 
something like:

SelectChannelConnector con = new SelectChannelConnector() {
  public void doStart() throws Exception {
     System.out.println("in start! " + getMaxIdleTime());
     super.doStart();
  }
}
.....

Just to make sure the start on your configured version is the one being 
called.    The jetty code calls:
        _manager.setMaxIdleTime(getMaxIdleTime());
        _manager.setLowResourcesConnections(getLowResourcesConnections());
        _manager.setLowResourcesMaxIdleTime(getLowResourcesMaxIdleTime());

in the SelectChannelConnector.doStart call  so making sure the correct value 
is there at that point should do it.



Dan



On Monday, June 11, 2012 11:10:18 AM Benson Margulies wrote:
> Readers of this list may remember a few messages from me over the last
> few months in which I reported strange closed connections on JAX-WS
> operations. The service in question launches itself using the embedded
> jetty inside CXF, not via a webapp in an independent jetty container.
> 
> There is a jetty parameter of nominal relevance here related to jetty
> garbage collecting 'idle' connections. However, I've got it set, as
> best as I can tell, to avoid this problem.
> 
> So, in trying to make some sense of this, I wonder how widespread my
> configuration is. I know from a survey last year that plenty of people
> deploy CXF services in Jetty, but what I don't know is what fraction
> of them are using the CXF embedded launch?
> 
> On the other hand, upon re-reading the code here, I'm not convinced
> that I've actually accomplished the task at hand. I create a server
> engine factory and a connector and configure it. The assumption is
> that because I call createJettyHTTPServerEngine on the port at which I
> launch the service, that I've indeed configured the relevant Jetty.
> 
> Here's some code.
> 
> 
>  /*
>          * Explicitly configure Jetty. We want to avoid having jetty
> time things out.
>          */
>         JettyHTTPServerEngineFactory sef = new
> JettyHTTPServerEngineFactory(); JettyHTTPServerEngine eng =
> sef.createJettyHTTPServerEngine(endpointPort, "http");
>         SelectChannelConnector con = new SelectChannelConnector();
>         con.setName("documentDatabaseConnector");
>         // try to turn off Jetty's love of timing out.
>         con.setMaxIdleTime(Integer.MAX_VALUE);
>         con.setLowResourcesMaxIdleTime(Integer.MAX_VALUE);
>         con.setLowResourcesConnections(Integer.MAX_VALUE);
>         con.setPort(endpointPort);
>         eng.setConnector(con);
> 
>         JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
>         Map<String, Object> props = new HashMap<String, Object>();
>         // setting the binding isn't enough.
>         props.put("mtom-enabled", Boolean.TRUE);
>         svrFactory.setProperties(props);
>         svrFactory.setDataBinding(new AegisDatabinding());
>         svrFactory.setBindingId(SOAPBinding.SOAP11HTTP_MTOM_BINDING);
>         svrFactory.setServiceClass(DocumentDatabase.class);
>         svrFactory.setAddress("http://0.0.0.0:"; + endpointPort +
> "/documentDatabase");
>         svrFactory.setServiceBean(documentDatabaseImpl);
>         LOG.info("Launching service endpoint: " +
> svrFactory.getAddress()); server = svrFactory.create();

Reply via email to