org.glassfish.tyrus.server
Class TyrusServerContainer

java.lang.Object
  extended by org.glassfish.tyrus.WithProperties
      extended by org.glassfish.tyrus.server.TyrusServerContainer
All Implemented Interfaces:
ClientContainer, ServerContainer

public class TyrusServerContainer
extends WithProperties
implements ServerContainer, ServerContainer

Server Container Implementation.

Author:
Martin Matula (martin.matula at oracle.com)

Constructor Summary
TyrusServerContainer(TyrusServer server, String contextPath, ServerConfiguration configuration)
           
 
Method Summary
 void connectToServer(Endpoint endpoint, ClientEndpointConfiguration olc)
          Connect the supplied endpoint to its server using the supplied handshake parameters
 Set<Session> getActiveSessions()
          Return a copy of the Set of the currently active web socket sessions.
 ServerConfiguration getConfiguration()
          Returns server configuration object that can be used to register endpoints and set other configuration parameters.
 Set<String> getInstalledExtensions()
          Return the set of Extensions installed in the container.
 long getMaxBinaryMessageBufferSize()
          Returns the maximum size of binary message that this container will buffer.
 long getMaxSessionIdleTimeout()
          Return the maximum time in seconds that a web socket session may be idle before the container may close it.
 long getMaxTextMessageBufferSize()
          Sets the maximum size of text message that this container will buffer.
 void publishServer(Endpoint endpoint, ServerEndpointConfiguration ilc)
          Publish the given endpoint with the provided configuration information.
 void setMaxBinaryMessageBufferSize(long max)
          Sets the maximum size of binary message that this container will buffer.
 void setMaxSessionIdleTimeout(long timeout)
          Sets the maximum time that a web socket session may be idle before the container may close it.
 void setMaxTextMessageBufferSize(long max)
          Sets the maximum size of text message that this container will buffer.
 void start()
          Starts the server and deploys all the endpoints configured in the corresponding ServerConfiguration.
 void stop()
          Attempts to stops the server (for some containers, such as servlet, which don't support stopping, this may be a no-op).
 
Methods inherited from class org.glassfish.tyrus.WithProperties
getProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TyrusServerContainer

public TyrusServerContainer(TyrusServer server,
                            String contextPath,
                            ServerConfiguration configuration)
Method Detail

getConfiguration

public ServerConfiguration getConfiguration()
Description copied from interface: ServerContainer
Returns server configuration object that can be used to register endpoints and set other configuration parameters.

Returns:
server configuration.

start

public void start()
           throws IOException
Description copied from interface: ServerContainer
Starts the server and deploys all the endpoints configured in the corresponding ServerConfiguration.

Throws:
IOException - if something goes wrong.

stop

public void stop()
Description copied from interface: ServerContainer
Attempts to stops the server (for some containers, such as servlet, which don't support stopping, this may be a no-op).


publishServer

public void publishServer(Endpoint endpoint,
                          ServerEndpointConfiguration ilc)
Description copied from interface: ServerContainer
Publish the given endpoint with the provided configuration information.

Specified by:
publishServer in interface ServerContainer
Parameters:
endpoint - the endpoint to be deployed.
ilc - the endpoint configuration that the runtime should use to deploy the endpoint.

connectToServer

public void connectToServer(Endpoint endpoint,
                            ClientEndpointConfiguration olc)
Description copied from interface: ClientContainer
Connect the supplied endpoint to its server using the supplied handshake parameters

Specified by:
connectToServer in interface ClientContainer
Parameters:
endpoint - the endpoint which will be connected to the server
olc - the client configuration used to connect the client

getActiveSessions

public Set<Session> getActiveSessions()
Description copied from interface: ClientContainer
Return a copy of the Set of the currently active web socket sessions. These sessions may not still be active at any point after the return of this method, for example, Iterating over the set at a later time may yield closed session. Use session.isActive() to check.

Specified by:
getActiveSessions in interface ClientContainer
Returns:
the set of sessions, active at the time of return.

getMaxSessionIdleTimeout

public long getMaxSessionIdleTimeout()
Description copied from interface: ClientContainer
Return the maximum time in seconds that a web socket session may be idle before the container may close it.

Specified by:
getMaxSessionIdleTimeout in interface ClientContainer
Returns:
the number of seconds idle wed socket sessions are active

setMaxSessionIdleTimeout

public void setMaxSessionIdleTimeout(long timeout)
Description copied from interface: ClientContainer
Sets the maximum time that a web socket session may be idle before the container may close it.

Specified by:
setMaxSessionIdleTimeout in interface ClientContainer

getMaxBinaryMessageBufferSize

public long getMaxBinaryMessageBufferSize()
Description copied from interface: ClientContainer
Returns the maximum size of binary message that this container will buffer.

Specified by:
getMaxBinaryMessageBufferSize in interface ClientContainer
Returns:
the maximum size of binary message in number of bytes

setMaxBinaryMessageBufferSize

public void setMaxBinaryMessageBufferSize(long max)
Description copied from interface: ClientContainer
Sets the maximum size of binary message that this container will buffer.

Specified by:
setMaxBinaryMessageBufferSize in interface ClientContainer

getMaxTextMessageBufferSize

public long getMaxTextMessageBufferSize()
Description copied from interface: ClientContainer
Sets the maximum size of text message that this container will buffer.

Specified by:
getMaxTextMessageBufferSize in interface ClientContainer
Returns:
the maximum size of text message in number of bytes

setMaxTextMessageBufferSize

public void setMaxTextMessageBufferSize(long max)
Description copied from interface: ClientContainer
Sets the maximum size of text message that this container will buffer.

Specified by:
setMaxTextMessageBufferSize in interface ClientContainer

getInstalledExtensions

public Set<String> getInstalledExtensions()
Description copied from interface: ClientContainer
Return the set of Extensions installed in the container.

Specified by:
getInstalledExtensions in interface ClientContainer
Returns:
the set of extensions.


Copyright © 2012. All Rights Reserved.