JSR-356 tweaking use of configureContext

This commit is contained in:
Joakim Erdfelt 2013-07-26 14:10:03 -07:00
parent 6029826aa4
commit e5655fc2cd
1 changed files with 4 additions and 7 deletions

View File

@ -39,7 +39,7 @@ public class WebSocketConfiguration extends AbstractConfiguration
{ {
private static final Logger LOG = Log.getLogger(WebSocketConfiguration.class); private static final Logger LOG = Log.getLogger(WebSocketConfiguration.class);
public void configureContext(ServletContextHandler context, boolean startContainer) public static ServerContainer configureContext(ServletContextHandler context)
{ {
WebSocketUpgradeFilter filter = new WebSocketUpgradeFilter(); WebSocketUpgradeFilter filter = new WebSocketUpgradeFilter();
FilterHolder fholder = new FilterHolder(filter); FilterHolder fholder = new FilterHolder(filter);
@ -58,17 +58,14 @@ public class WebSocketConfiguration extends AbstractConfiguration
// Store a reference to the ServerContainer per javax.websocket spec 1.0 final section 6.4 Programmatic Server Deployment // Store a reference to the ServerContainer per javax.websocket spec 1.0 final section 6.4 Programmatic Server Deployment
context.setAttribute(javax.websocket.server.ServerContainer.class.getName(),jettyContainer); context.setAttribute(javax.websocket.server.ServerContainer.class.getName(),jettyContainer);
if (startContainer) return jettyContainer;
{
jettyContainer.start();
}
} }
@Override @Override
public void configure(WebAppContext context) throws Exception public void configure(WebAppContext context) throws Exception
{ {
configureContext(context,false); WebSocketConfiguration.configureContext(context);
} }
@Override @Override