Skip to content

Commit

Permalink
reverts - commited by accident :-/
Browse files Browse the repository at this point in the history
Revert "special j1 version"
Revert "create container with external Grizzly server"

This reverts commit 6a1c05f.
This reverts commit 2a3038b.
  • Loading branch information
pavelbucek committed Oct 5, 2015
1 parent 2a3038b commit aa899a9
Show file tree
Hide file tree
Showing 71 changed files with 70 additions and 209 deletions.
2 changes: 1 addition & 1 deletion archetypes/echo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<parent>
<groupId>org.glassfish.tyrus.archetypes</groupId>
<artifactId>tyrus-archetypes-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<description>
Expand Down
2 changes: 1 addition & 1 deletion archetypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<groupId>org.glassfish.tyrus.archetypes</groupId>
Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-bom</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Tyrus BOM</name>

Expand Down
2 changes: 1 addition & 1 deletion bundles/client-jdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<parent>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-bundles</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion bundles/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<parent>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-bundles</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion bundles/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<groupId>org.glassfish.tyrus.bundles</groupId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<parent>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-bundles</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<artifactId>tyrus-samples</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/websocket-ri-archive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<parent>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-bundles</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<artifactId>websocket-ri-archive</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/websocket-ri-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<parent>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-bundles</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<artifactId>websocket-ri-bundle</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion containers/glassfish/cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-containers-glassfish-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<packaging>bundle</packaging>
Expand Down
2 changes: 1 addition & 1 deletion containers/glassfish/ejb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-containers-glassfish-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<packaging>bundle</packaging>
Expand Down
2 changes: 1 addition & 1 deletion containers/glassfish/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-containers-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion containers/grizzly-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-containers-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<packaging>bundle</packaging>
Expand Down
2 changes: 1 addition & 1 deletion containers/grizzly-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-containers-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<packaging>bundle</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,145 +233,6 @@ public void stop() {
};
}

/**
* Create container - user provided HttpServer.
*
* @param server server.
* @param properties properties.
* @return new ServerContainer.
* @see #createContainer(java.util.Map)
*/
public ServerContainer createContainer(final HttpServer server, Map<String, Object> properties) {

final Map<String, Object> localProperties;
// defensive copy
if (properties == null) {
localProperties = Collections.emptyMap();
} else {
localProperties = new HashMap<String, Object>(properties);
}

final Integer incomingBufferSize =
Utils.getProperty(localProperties, TyrusWebSocketEngine.INCOMING_BUFFER_SIZE, Integer.class);
final ClusterContext clusterContext =
Utils.getProperty(localProperties, ClusterContext.CLUSTER_CONTEXT, ClusterContext.class);
final ApplicationEventListener applicationEventListener =
Utils.getProperty(localProperties, ApplicationEventListener.APPLICATION_EVENT_LISTENER,
ApplicationEventListener.class);
final Integer maxSessionsPerApp =
Utils.getProperty(localProperties, TyrusWebSocketEngine.MAX_SESSIONS_PER_APP, Integer.class);
final Integer maxSessionsPerRemoteAddr =
Utils.getProperty(localProperties, TyrusWebSocketEngine.MAX_SESSIONS_PER_REMOTE_ADDR, Integer.class);
final Boolean parallelBroadcastEnabled =
Utils.getProperty(localProperties, TyrusWebSocketEngine.PARALLEL_BROADCAST_ENABLED, Boolean.class);
final DebugContext.TracingType tracingType =
Utils.getProperty(localProperties, TyrusWebSocketEngine.TRACING_TYPE, DebugContext.TracingType.class,
DebugContext.TracingType.OFF);
final DebugContext.TracingThreshold tracingThreshold =
Utils.getProperty(localProperties, TyrusWebSocketEngine.TRACING_THRESHOLD,
DebugContext.TracingThreshold.class, DebugContext.TracingThreshold.TRACE);

return new TyrusServerContainer((Set<Class<?>>) null) {

private final WebSocketEngine engine =
TyrusWebSocketEngine.builder(this)
.incomingBufferSize(incomingBufferSize)
.clusterContext(clusterContext)
.applicationEventListener(applicationEventListener)
.maxSessionsPerApp(maxSessionsPerApp)
.maxSessionsPerRemoteAddr(maxSessionsPerRemoteAddr)
.parallelBroadcastEnabled(parallelBroadcastEnabled)
.tracingType(tracingType)
.tracingThreshold(tracingThreshold)
.build();

private String contextPath;

@Override
public void register(Class<?> endpointClass) throws DeploymentException {
engine.register(endpointClass, contextPath);
}

@Override
public void register(ServerEndpointConfig serverEndpointConfig) throws DeploymentException {
engine.register(serverEndpointConfig, contextPath);
}

@Override
public WebSocketEngine getWebSocketEngine() {
return engine;
}

@Override
public void start(final String rootPath, int port) throws IOException, DeploymentException {
contextPath = rootPath;
final ServerConfiguration config = server.getServerConfiguration();

final NetworkListener listener = new NetworkListener("grizzly", "0.0.0.0", port);
server.addListener(listener);

// server = HttpServer.createSimpleServer(rootPath, port);
ThreadPoolConfig workerThreadPoolConfig =
Utils.getProperty(localProperties, WORKER_THREAD_POOL_CONFIG, ThreadPoolConfig.class);
ThreadPoolConfig selectorThreadPoolConfig =
Utils.getProperty(localProperties, SELECTOR_THREAD_POOL_CONFIG, ThreadPoolConfig.class);

// TYRUS-287: configurable server thread pools
if (workerThreadPoolConfig != null || selectorThreadPoolConfig != null) {
TCPNIOTransportBuilder transportBuilder = TCPNIOTransportBuilder.newInstance();
if (workerThreadPoolConfig != null) {
transportBuilder.setWorkerThreadPoolConfig(workerThreadPoolConfig);
}
if (selectorThreadPoolConfig != null) {
transportBuilder.setSelectorThreadPoolConfig(selectorThreadPoolConfig);
}
transportBuilder.setIOStrategy(WorkerThreadIOStrategy.getInstance());
server.getListener("grizzly").setTransport(transportBuilder.build());
} else {
// if no configuration is set, just update IO Strategy to worker thread strat.
server.getListener("grizzly").getTransport().setIOStrategy(WorkerThreadIOStrategy.getInstance());
}

// idle timeout set to indefinite.
server.getListener("grizzly").getKeepAlive().setIdleTimeoutInSeconds(-1);
server.getListener("grizzly").registerAddOn(new WebSocketAddOn(this, contextPath));

final WebSocketEngine webSocketEngine = getWebSocketEngine();

final Object staticContentPath = localProperties.get(Server.STATIC_CONTENT_ROOT);
HttpHandler staticHandler = null;
if (staticContentPath != null && !staticContentPath.toString().isEmpty()) {
staticHandler = new StaticHttpHandler(staticContentPath.toString());
}

final Object wsadl = localProperties.get(TyrusWebSocketEngine.WSADL_SUPPORT);

if (wsadl != null && wsadl.toString().equalsIgnoreCase("true")) { // wsadl enabled
config.addHttpHandler(new WsadlHttpHandler((TyrusWebSocketEngine) webSocketEngine, staticHandler));
} else if (staticHandler != null) { // wsadl disabled
config.addHttpHandler(staticHandler);
}

if (applicationEventListener != null) {
applicationEventListener.onApplicationInitialized(rootPath);
}

// server.start();
super.start(rootPath, port);
}

@Override
public void stop() {
super.stop();
// server.shutdownNow();
if (applicationEventListener != null) {
applicationEventListener.onApplicationDestroyed();
}
}
};
}


private static class WsadlHttpHandler extends HttpHandler {

private final TyrusWebSocketEngine engine;
Expand Down
2 changes: 1 addition & 1 deletion containers/inmemory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-containers-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<packaging>bundle</packaging>
Expand Down
2 changes: 1 addition & 1 deletion containers/jdk-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-containers-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<packaging>bundle</packaging>
Expand Down
2 changes: 1 addition & 1 deletion containers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion containers/servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-containers-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<artifactId>tyrus-documentation</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ext/client-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<parent>
<groupId>org.glassfish.tyrus.ext</groupId>
<artifactId>tyrus-extensions-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion ext/client-java8/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<parent>
<groupId>org.glassfish.tyrus.ext</groupId>
<artifactId>tyrus-extensions-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion ext/extension-deflate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<parent>
<groupId>org.glassfish.tyrus.ext</groupId>
<artifactId>tyrus-extensions-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion ext/monitoring-jmx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<parent>
<groupId>org.glassfish.tyrus.ext</groupId>
<artifactId>tyrus-extensions-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<artifactId>tyrus-monitoring-jmx</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<parent>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>tyrus</name>
<description>Tyrus is the reference implementation of Java API for WebSocket (JSR-356).</description>
Expand Down
2 changes: 1 addition & 1 deletion samples/auction/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<parent>
<groupId>org.glassfish.tyrus.samples</groupId>
<artifactId>tyrus-samples-project</artifactId>
<version>2.0-J1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<packaging>war</packaging>
Expand Down
Loading

0 comments on commit aa899a9

Please sign in to comment.