work in progress
Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
parent
13ee892921
commit
e8d468b3e1
|
@ -53,7 +53,7 @@
|
|||
<instructions>
|
||||
<Bundle-Description>javax.websocket.client Implementation</Bundle-Description>
|
||||
<Export-Package>
|
||||
org.eclipse.jetty.websocket.jsr356.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
|
||||
org.eclipse.jetty.websocket.javax.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
|
||||
</Export-Package>
|
||||
<Require-Capability>osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)";resolution:=optional</Require-Capability>
|
||||
<Provide-Capability>osgi.serviceloader;osgi.serviceloader=javax.websocket.ContainerProvider</Provide-Capability>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<instructions>
|
||||
<Bundle-Description>javax.websocket.client Implementation</Bundle-Description>
|
||||
<Export-Package>
|
||||
org.eclipse.jetty.websocket.jsr356.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
|
||||
org.eclipse.jetty.websocket.javax.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
|
||||
</Export-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
<instructions>
|
||||
<Bundle-Description>javax.websocket.server Implementation</Bundle-Description>
|
||||
<Export-Package>
|
||||
org.eclipse.jetty.websocket.jsr356.server.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
|
||||
org.eclipse.jetty.websocket.javax.server.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
|
||||
</Export-Package>
|
||||
<Require-Capability>osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)";resolution:=optional</Require-Capability>
|
||||
<Provide-Capability>
|
||||
|
|
|
@ -38,6 +38,6 @@ public class JavaxWebSocketConfiguration extends AbstractConfiguration
|
|||
addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class, FragmentConfiguration.class);
|
||||
addDependents("org.eclipse.jetty.annotations.AnnotationConfiguration", WebAppConfiguration.class.getName());
|
||||
protectAndExpose("org.eclipse.jetty.websocket.servlet."); // For WebSocketUpgradeFilter
|
||||
protectAndExpose("org.eclipse.jetty.websocket.jsr356."); // TODO
|
||||
protectAndExpose("org.eclipse.jetty.websocket.javax."); // TODO Do we need all classes?
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,10 +47,10 @@ import org.eclipse.jetty.websocket.servlet.WebSocketUpgradeFilter;
|
|||
@HandlesTypes({ ServerApplicationConfig.class, ServerEndpoint.class, Endpoint.class })
|
||||
public class JavaxWebSocketServerContainerInitializer implements ServletContainerInitializer
|
||||
{
|
||||
public static final String ENABLE_KEY = "org.eclipse.jetty.websocket.jsr356";
|
||||
public static final String ADD_DYNAMIC_FILTER_KEY = "org.eclipse.jetty.websocket.jsr356.addDynamicFilter";
|
||||
public static final String ENABLE_KEY = "org.eclipse.jetty.websocket.javax";
|
||||
public static final String DEPRECATED_ENABLE_KEY = "org.eclipse.jetty.websocket.jsr356";
|
||||
private static final Logger LOG = Log.getLogger(JavaxWebSocketServerContainerInitializer.class);
|
||||
public static final String HTTPCLIENT_ATTRIBUTE = "org.eclipse.jetty.websocket.jsr356.HttpClient";
|
||||
public static final String HTTPCLIENT_ATTRIBUTE = "org.eclipse.jetty.websocket.javax.HttpClient";
|
||||
|
||||
/**
|
||||
* DestroyListener
|
||||
|
@ -89,7 +89,7 @@ public class JavaxWebSocketServerContainerInitializer implements ServletContaine
|
|||
* @param defValue the default value, if the value is not specified in the context
|
||||
* @return the value for the feature key
|
||||
*/
|
||||
public static boolean isEnabledViaContext(ServletContext context, String keyName, boolean defValue)
|
||||
public static Boolean isEnabledViaContext(ServletContext context, String keyName, Boolean defValue)
|
||||
{
|
||||
// Try context parameters first
|
||||
String cp = context.getInitParameter(keyName);
|
||||
|
@ -197,9 +197,15 @@ public class JavaxWebSocketServerContainerInitializer implements ServletContaine
|
|||
@Override
|
||||
public void onStartup(Set<Class<?>> c, ServletContext context) throws ServletException
|
||||
{
|
||||
if (!isEnabledViaContext(context, ENABLE_KEY, true))
|
||||
Boolean dft = isEnabledViaContext(context, DEPRECATED_ENABLE_KEY, null);
|
||||
if (dft==null)
|
||||
dft = Boolean.TRUE;
|
||||
else
|
||||
LOG.warn("Deprecated parameter used: " + DEPRECATED_ENABLE_KEY);
|
||||
|
||||
if (!isEnabledViaContext(context, ENABLE_KEY, dft))
|
||||
{
|
||||
LOG.info("JSR-356 is disabled by configuration for context {}", context.getContextPath());
|
||||
LOG.info("Javax Websocket is disabled by configuration for context {}", context.getContextPath());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -207,12 +213,12 @@ public class JavaxWebSocketServerContainerInitializer implements ServletContaine
|
|||
|
||||
if (handler == null)
|
||||
{
|
||||
throw new ServletException("Not running on Jetty, JSR-356 support unavailable");
|
||||
throw new ServletException("Not running on Jetty, Javax Websocket support unavailable");
|
||||
}
|
||||
|
||||
if (!(handler instanceof ServletContextHandler))
|
||||
{
|
||||
throw new ServletException("Not running in Jetty ServletContextHandler, JSR-356 support unavailable");
|
||||
throw new ServletException("Not running in Jetty ServletContextHandler, Javax Websocket support unavailable");
|
||||
}
|
||||
|
||||
ServletContextHandler jettyContext = (ServletContextHandler)handler;
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
<instructions>
|
||||
<Bundle-Description>javax.websocket Integration Tests</Bundle-Description>
|
||||
<Export-Package>
|
||||
org.eclipse.jetty.websocket.jsr356.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
|
||||
org.eclipse.jetty.websocket.javax.tests.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
|
||||
</Export-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
|
|
|
@ -127,7 +127,7 @@ public class WSServer extends LocalServer implements LocalFuzzer.Provider
|
|||
WebAppContext context = new WebAppContext();
|
||||
context.setContextPath(this.contextPath);
|
||||
context.setBaseResource(new PathResource(this.contextDir));
|
||||
context.setAttribute("org.eclipse.jetty.websocket.jsr356", Boolean.TRUE);
|
||||
context.setAttribute("org.eclipse.jetty.websocket.javax", Boolean.TRUE);
|
||||
|
||||
context.addConfiguration(new AnnotationConfiguration());
|
||||
context.addConfiguration(new PlusConfiguration());
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
version="3.1">
|
||||
|
||||
<context-param>
|
||||
<param-name>org.eclipse.jetty.websocket.jsr356.addDynamicFilter</param-name>
|
||||
<param-name>org.eclipse.jetty.websocket.javax.addDynamicFilter</param-name>
|
||||
<param-value>false</param-value>
|
||||
</context-param>
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!--<logger name="org.eclipse.jetty.websocket.tests.client.jsr356" level="debug" />-->
|
||||
|
||||
<logger name="org.eclipse.jetty.websocket.core.internal.Parser.CLIENT" level="debug" additivity="false">
|
||||
<appender-ref ref="FILE"/>
|
||||
</logger>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
version="3.1">
|
||||
|
||||
<listener>
|
||||
<listener-class>org.eclipse.jetty.websocket.jsr356.tests.server.InfoContextAltAttributeListener</listener-class>
|
||||
<listener-class>org.eclipse.jetty.websocket.javax.tests.server.InfoContextAltAttributeListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<filter>
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
||||
version="3.1">
|
||||
|
||||
<!-- disable JSR-356 -->
|
||||
<!-- disable Javax WebSockets -->
|
||||
<context-param>
|
||||
<param-name>org.eclipse.jetty.websocket.jsr356</param-name>
|
||||
<param-name>org.eclipse.jetty.websocket.javax</param-name>
|
||||
<param-value>false</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
<listener-class>org.eclipse.jetty.websocket.jsr356.tests.server.InfoContextAttributeListener</listener-class>
|
||||
<listener-class>org.eclipse.jetty.websocket.javax.tests.server.InfoContextAttributeListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<filter>
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
||||
version="3.1">
|
||||
|
||||
<!-- disable JSR-356 -->
|
||||
<!-- disable Javax Websockets -->
|
||||
<context-param>
|
||||
<param-name>org.eclipse.jetty.websocket.jsr356</param-name>
|
||||
<param-name>org.eclipse.jetty.websocket.javax</param-name>
|
||||
<param-value>false</param-value>
|
||||
</context-param>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>info-servlet</servlet-name>
|
||||
<servlet-class>org.eclipse.jetty.websocket.jsr356.tests.server.InfoServlet</servlet-class>
|
||||
<servlet-class>org.eclipse.jetty.websocket.javax.tests.server.InfoServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
<modules>
|
||||
<module>websocket-core</module>
|
||||
<module>websocket-servlet</module>
|
||||
<!-- Jetty Native WebSocket Implementation -->
|
||||
<!-- Jetty WebSocket Implementation -->
|
||||
<module>jetty-websocket-api</module>
|
||||
<module>jetty-websocket-common</module>
|
||||
<module>jetty-websocket-client</module>
|
||||
<module>jetty-websocket-server</module>
|
||||
<!-- JSR356 Implementation -->
|
||||
<!-- Javax WebSocket Implementation -->
|
||||
<module>javax-websocket-common</module>
|
||||
<module>javax-websocket-client</module>
|
||||
<module>javax-websocket-server</module>
|
||||
|
|
|
@ -31,7 +31,7 @@ detected.
|
|||
|
||||
<!-- Enable WebSocket container -->
|
||||
<Call name="setAttribute">
|
||||
<Arg>org.eclipse.jetty.websocket.jsr356</Arg>
|
||||
<Arg>org.eclipse.jetty.websocket.javax</Arg>
|
||||
<Arg type="Boolean">true</Arg>
|
||||
</Call>
|
||||
|
||||
|
|
Loading…
Reference in New Issue