Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2015-03-16 17:25:15 +0000
committerJoakim Erdfelt2015-03-16 17:25:15 +0000
commit6e952d461817169f0dd19d2771ae3943aad40e38 (patch)
tree3c9ef2238aff33310330bc37fb5f2ff861740f4a
parent81f29576e6b7a1ee1da32b19843801becd000412 (diff)
parent4a4131750195cc27c23ac417df4bde55a2a79c13 (diff)
downloadorg.eclipse.jetty.project-6e952d461817169f0dd19d2771ae3943aad40e38.tar.gz
org.eclipse.jetty.project-6e952d461817169f0dd19d2771ae3943aad40e38.tar.xz
org.eclipse.jetty.project-6e952d461817169f0dd19d2771ae3943aad40e38.zip
Merge branch 'jetty-9.2.x'
Conflicts: jetty-start/src/main/java/org/eclipse/jetty/start/Main.java jetty-start/src/test/java/org/eclipse/jetty/start/LicensingTest.java
-rw-r--r--examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithJMX.java56
-rw-r--r--jetty-jmx/src/main/config/etc/jetty-jmx-remote.xml22
-rw-r--r--jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java4
-rw-r--r--jetty-start/src/test/java/org/eclipse/jetty/start/LicensingTest.java26
-rw-r--r--jetty-websocket/websocket-server/pom.xml20
-rw-r--r--jetty-websocket/websocket-servlet/pom.xml1
6 files changed, 117 insertions, 12 deletions
diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithJMX.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithJMX.java
new file mode 100644
index 0000000000..79d2a5fe28
--- /dev/null
+++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ServerWithJMX.java
@@ -0,0 +1,56 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2015 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.embedded;
+
+import java.lang.management.ManagementFactory;
+
+import javax.management.remote.JMXServiceURL;
+
+import org.eclipse.jetty.jmx.ConnectorServer;
+import org.eclipse.jetty.jmx.MBeanContainer;
+import org.eclipse.jetty.server.Server;
+
+/**
+ * The simplest possible Jetty server.
+ */
+public class ServerWithJMX
+{
+ public static void main( String[] args ) throws Exception
+ {
+ // === jetty-jmx.xml ===
+ MBeanContainer mbContainer = new MBeanContainer(
+ ManagementFactory.getPlatformMBeanServer());
+
+ Server server = new Server(8080);
+ server.addBean(mbContainer);
+
+ ConnectorServer jmx = new ConnectorServer(
+ new JMXServiceURL(
+ "rmi",
+ null,
+ 1999,
+ "/jndi/rmi://localhost:1999/jmxrmi"),
+ "org.eclipse.jetty.jmx:name=rmiconnectorserver");
+ server.addBean(jmx);
+
+ server.start();
+ server.dumpStdErr();
+ server.join();
+ }
+}
diff --git a/jetty-jmx/src/main/config/etc/jetty-jmx-remote.xml b/jetty-jmx/src/main/config/etc/jetty-jmx-remote.xml
index 20a2dda239..3527d8b375 100644
--- a/jetty-jmx/src/main/config/etc/jetty-jmx-remote.xml
+++ b/jetty-jmx/src/main/config/etc/jetty-jmx-remote.xml
@@ -11,17 +11,19 @@
the RMI registry hostname and port number, that may need to be modified
in order to comply with the firewall requirements.
-->
- <New id="ConnectorServer" class="org.eclipse.jetty.jmx.ConnectorServer">
+ <Call name="addBean">
<Arg>
- <New class="javax.management.remote.JMXServiceURL">
- <Arg type="java.lang.String">rmi</Arg>
- <Arg type="java.lang.String" />
- <Arg type="java.lang.Integer"><SystemProperty name="jetty.jmxrmiport" default="1099"/></Arg>
- <Arg type="java.lang.String">/jndi/rmi://<SystemProperty name="jetty.jmxrmihost" default="localhost"/>:<SystemProperty name="jetty.jmxrmiport" default="1099"/>/jmxrmi</Arg>
+ <New id="ConnectorServer" class="org.eclipse.jetty.jmx.ConnectorServer">
+ <Arg>
+ <New class="javax.management.remote.JMXServiceURL">
+ <Arg type="java.lang.String">rmi</Arg>
+ <Arg type="java.lang.String" />
+ <Arg type="java.lang.Integer"><Property name="jetty.jmxrmiport" default="1099"/></Arg>
+ <Arg type="java.lang.String">/jndi/rmi://<Property name="jetty.jmxrmihost" default="localhost"/>:<Property name="jetty.jmxrmiport" default="1099"/>/jmxrmi</Arg>
+ </New>
+ </Arg>
+ <Arg>org.eclipse.jetty.jmx:name=rmiconnectorserver</Arg>
</New>
</Arg>
- <Arg>org.eclipse.jetty.jmx:name=rmiconnectorserver</Arg>
- <Call name="start" />
- </New>
+ </Call>
</Configure>
-
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java
index 434e4b371f..94190c0035 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java
@@ -114,8 +114,8 @@ public class TestJettyOSGiBootCore
res.add(mavenBundle().groupId( "org.eclipse.jetty" ).artifactId( "jetty-annotations" ).versionAsInProject().start());
res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "websocket-api" ).versionAsInProject().noStart());
res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "websocket-common" ).versionAsInProject().noStart());
- res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "websocket-servlet" ).versionAsInProject().noStart());
- res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "websocket-server" ).versionAsInProject().noStart());
+ res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "websocket-servlet" ).versionAsInProject());
+ res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "websocket-server" ).versionAsInProject());
res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "websocket-client" ).versionAsInProject().noStart());
res.add(mavenBundle().groupId( "javax.websocket" ).artifactId( "javax.websocket-api" ).versionAsInProject().noStart());
res.add(mavenBundle().groupId( "org.eclipse.jetty.websocket" ).artifactId( "javax-websocket-client-impl").versionAsInProject().noStart());
diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/LicensingTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/LicensingTest.java
index 4eb6f0c302..f57d258323 100644
--- a/jetty-start/src/test/java/org/eclipse/jetty/start/LicensingTest.java
+++ b/jetty-start/src/test/java/org/eclipse/jetty/start/LicensingTest.java
@@ -58,6 +58,7 @@ public class LicensingTest
int len = cmds.size();
String args[] = cmds.toArray(new String[len]);
+ System.err.printf("%n## Exec: %s%n", Utils.join(cmds,", "));
Main main = new Main();
StartArgs startArgs = main.processCommandLine(args);
main.start(startArgs);
@@ -116,6 +117,31 @@ public class LicensingTest
}
@Test
+ public void testAdd_Http_Http2_Then_Deploy() throws Exception
+ {
+ File basePath = testdir.getEmptyDir();
+
+ List<String> cmds = getBaseCommandLine(basePath);
+
+ cmds.add("-Dorg.eclipse.jetty.start.ack.license.protonego-impl=true");
+ cmds.add("--add-to-start=http,http2");
+
+ execMain(cmds);
+
+ String contents = assertFileExists(basePath, "start.ini");
+ assertThat("Contents",contents,containsString("--module=http"+System.lineSeparator()));
+ assertThat("Contents",contents,containsString("--module=http2"+System.lineSeparator()));
+
+ // now request deploy (no license check should occur)
+ List<String> cmds2 = getBaseCommandLine(basePath);
+ cmds2.add("--add-to-start=deploy");
+ execMain(cmds2);
+
+ contents = assertFileExists(basePath, "start.ini");
+ assertThat("Contents",contents,containsString("--module=deploy"+System.lineSeparator()));
+ }
+
+ @Test
public void testCreate_HTTP2_Licensed() throws Exception
{
File basePath = testdir.getEmptyDir();
diff --git a/jetty-websocket/websocket-server/pom.xml b/jetty-websocket/websocket-server/pom.xml
index 76efde8a16..f170b82f19 100644
--- a/jetty-websocket/websocket-server/pom.xml
+++ b/jetty-websocket/websocket-server/pom.xml
@@ -16,6 +16,26 @@
<build>
<plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <id>generate-manifest</id>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ <configuration>
+ <instructions>
+ <Require-Capability>osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)"</Require-Capability>
+ <Provide-Capability>osgi.serviceloader; osgi.serviceloader=org.eclipse.jetty.websocket.servlet.WebSocketServletFactory</Provide-Capability>
+ <_nouses>true</_nouses>
+ </instructions>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
diff --git a/jetty-websocket/websocket-servlet/pom.xml b/jetty-websocket/websocket-servlet/pom.xml
index f91ff8493a..0872094b1b 100644
--- a/jetty-websocket/websocket-servlet/pom.xml
+++ b/jetty-websocket/websocket-servlet/pom.xml
@@ -25,6 +25,7 @@
<Bundle-Classpath />
<_nouses>true</_nouses>
<DynamicImport-Package>org.eclipse.jetty.websocket.server.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}",org.eclipse.jetty.websocket.server.pathmap.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}"</DynamicImport-Package>
+ <Require-Capability>osgi.serviceloader; filter:="(osgi.serviceloader=org.eclipse.jetty.websocket.servlet.WebSocketServletFactory)";cardinality:=multiple, osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)"</Require-Capability>
</instructions>
</configuration>
</plugin>

Back to the top