Issue #207 - Adding missing JSR356 Server @PathParam ArgIdentifier

This commit is contained in:
Joakim Erdfelt 2017-04-27 13:18:14 -07:00
parent ae51344582
commit d216206fcd
5 changed files with 43 additions and 4 deletions

View File

@ -3,4 +3,5 @@ org.eclipse.jetty.LEVEL=WARN
# org.eclipse.jetty.websocket.LEVEL=INFO
# org.eclipse.jetty.websocket.LEVEL=ALL
# org.eclipse.jetty.websocket.LEVEL=DEBUG
# org.eclipse.jetty.websocket.jsr356.LEVEL=DEBUG

View File

@ -0,0 +1,40 @@
//
// ========================================================================
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.websocket.jsr356.server;
import javax.websocket.server.PathParam;
import org.eclipse.jetty.websocket.common.reflect.Arg;
import org.eclipse.jetty.websocket.common.reflect.ArgIdentifier;
/**
* Method argument identifier for {@link javax.websocket.server.PathParam} annotations.
*/
@SuppressWarnings("unused")
public class PathParamArgIdentifier implements ArgIdentifier
{
@Override
public Arg apply(Arg arg)
{
PathParam pathParam = arg.getAnnotation(PathParam.class);
if (pathParam != null)
arg.setTag(pathParam.value());
return arg;
}
}

View File

@ -0,0 +1 @@
org.eclipse.jetty.websocket.jsr356.server.PathParamArgIdentifier

View File

@ -133,6 +133,7 @@ public class WSServer
{
contexts.addHandler(webapp);
contexts.manage(webapp);
webapp.setThrowUnavailableOnStartupException(true);
webapp.start();
if (LOG.isDebugEnabled())
{

View File

@ -139,25 +139,21 @@ public final class WSURI
{
// keep as-is
wsScheme = httpScheme;
port = 80;
}
else if ("wss".equalsIgnoreCase(httpScheme))
{
// keep as-is
wsScheme = httpScheme;
port = 443;
}
else if ("http".equalsIgnoreCase(httpScheme))
{
// convert to ws
wsScheme = "ws";
port = 80;
}
else if ("https".equalsIgnoreCase(httpScheme))
{
// convert to wss
wsScheme = "wss";
port = 443;
}
else
{