use of org.atmosphere.util.VoidServletConfig in project cxf by apache.
the class AtmosphereWebSocketJettyDestination method activate.
protected void activate() {
super.activate();
if (handler.getServletContext().getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") == null) {
try {
Class<?> dcc = ClassUtils.forName("org.eclipse.jetty.util.DecoratedObjectFactory", getClass().getClassLoader());
handler.getServletContext().setAttribute("org.eclipse.jetty.util.DecoratedObjectFactory", dcc.newInstance());
} catch (ClassNotFoundException | LinkageError | InstantiationException | IllegalAccessException e) {
// ignore, old version of Jetty
}
}
ServletConfig config = new VoidServletConfig(initParams) {
@Override
public ServletContext getServletContext() {
return handler.getServletContext();
}
};
try {
framework.init(config);
} catch (ServletException e) {
throw new Fault(new Message("Could not initialize WebSocket Framework", LOG, e.getMessage()), e);
}
}
Aggregations