Fixing merge 9.2.x -> 9.3.x
This commit is contained in:
parent
bfadca49b5
commit
7930a3dac8
|
@ -37,7 +37,6 @@ import org.eclipse.jetty.io.ByteBufferPool;
|
|||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.util.DecoratedObjectFactory;
|
||||
import org.eclipse.jetty.util.TypeUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
@ -201,20 +200,8 @@ public class WebSocketServerContainerInitializer implements ServletContainerInit
|
|||
// Create the Jetty ServerContainer implementation
|
||||
ServerContainer jettyContainer = configureContext(jettyContext);
|
||||
|
||||
context.addListener(new ContextDestroyListener()); //make sure context is cleaned up when the context stops
|
||||
context.addListener(new ContextDestroyListener()); // make sure context is cleaned up when the context stops
|
||||
|
||||
// Establish the DecoratedObjectFactory thread local
|
||||
// for various ServiceLoader initiated components to use.
|
||||
DecoratedObjectFactory instantiator = (DecoratedObjectFactory)context.getAttribute(DecoratedObjectFactory.ATTR);
|
||||
if (instantiator == null)
|
||||
{
|
||||
LOG.info("Using WebSocket local DecoratedObjectFactory - none found in ServletContext");
|
||||
instantiator = new DecoratedObjectFactory();
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
||||
if (c.isEmpty())
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
|
|
|
@ -221,9 +221,13 @@ public abstract class AbstractEventDriver extends AbstractLifeCycle implements I
|
|||
public void openSession(WebSocketSession session)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("openSession({})",session);
|
||||
{
|
||||
LOG.debug("openSession({})", session);
|
||||
LOG.debug("objectFactory={}", session.getContainerScope().getObjectFactory());
|
||||
}
|
||||
this.session = session;
|
||||
this.session.getContainerScope().getObjectFactory().decorate(this.websocket);
|
||||
|
||||
try
|
||||
{
|
||||
this.onConnect();
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
package org.eclipse.jetty.websocket.server;
|
||||
|
||||
import org.eclipse.jetty.websocket.server.pathmap.PathMappings;
|
||||
import org.eclipse.jetty.websocket.server.pathmap.PathSpec;
|
||||
import org.eclipse.jetty.http.pathmap.PathMappings;
|
||||
import org.eclipse.jetty.http.pathmap.PathSpec;
|
||||
import org.eclipse.jetty.websocket.servlet.WebSocketCreator;
|
||||
|
||||
public class DefaultMappedWebSocketCreator implements MappedWebSocketCreator
|
||||
|
|
|
@ -292,6 +292,7 @@ public class WebSocketUpgradeFilter extends ContainerLifeCycle implements Filter
|
|||
{
|
||||
factory = new WebSocketServerFactory(policy, bufferPool);
|
||||
}
|
||||
factory.init(config.getServletContext());
|
||||
addBean(factory, true);
|
||||
|
||||
// TODO: Policy isn't from attributes
|
||||
|
@ -327,7 +328,7 @@ public class WebSocketUpgradeFilter extends ContainerLifeCycle implements Filter
|
|||
key = WebSocketUpgradeFilter.class.getName();
|
||||
}
|
||||
|
||||
setToAttribute(ctx, key);
|
||||
setToAttribute(config.getServletContext(), key);
|
||||
|
||||
factory.start();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue