Created
October 5, 2014 23:11
Starting Tyrus ClientManager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ClientManager client = AccessController.doPrivileged(new PrivilegedExceptionAction<ClientManager>() { | |
@Override | |
public ClientManager run() throws Exception { | |
ThreadPoolConfig workerThreadPoolConfig = ThreadPoolConfig.defaultConfig(); | |
workerThreadPoolConfig.setInitialClassLoader(this.getClass().getClassLoader()); | |
workerThreadPoolConfig.setDaemon(false); | |
workerThreadPoolConfig.setMaxPoolSize(4); | |
workerThreadPoolConfig.setCorePoolSize(3); | |
ClientManager cm = ClientManager.createClient(JdkClientContainer.class.getName()); | |
cm = ClientManager.createClient(JdkClientContainer.class.getName()); | |
cm.getProperties().put(ClientProperties.SHARED_CONTAINER, false); | |
cm.getProperties().put(ClientProperties.WORKER_THREAD_POOL_CONFIG, workerThreadPoolConfig); | |
cm.asyncConnectToServer(websocketClientEndpoint, serverEndpointAddress); | |
return cm; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment