JSR-356 tweaking use of configureContext
This commit is contained in:
parent
6029826aa4
commit
e5655fc2cd
|
@ -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);
|
||||||
|
@ -59,16 +59,13 @@ 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
|
||||||
|
|
Loading…
Reference in New Issue