org.glassfish.tyrus.server
Class DefaultServerConfiguration

java.lang.Object
  extended by org.glassfish.tyrus.server.DefaultServerConfiguration
All Implemented Interfaces:
ServerConfiguration

public class DefaultServerConfiguration
extends Object
implements ServerConfiguration

Default mutable implementation of ServerConfiguration interface. Allows setting all the configuration properties.

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

Constructor Summary
DefaultServerConfiguration()
           
 
Method Summary
 DefaultServerConfiguration endpoint(Class<?> endpointClass)
          Registers a new endpoint annotated class.
 DefaultServerConfiguration endpoint(javax.websocket.Endpoint endpoint)
          Registers a new programmatic endpoint.
 DefaultServerConfiguration endpoints(Class<?>... endpointClasses)
          Registers new endpoint annotated classes.
 DefaultServerConfiguration endpoints(javax.websocket.Endpoint... endpoints)
          Registers new endpoint instances.
 DefaultServerConfiguration endpoints(Set<Class<?>> endpointClasses)
          Registers new endpoint annotated classes.
 Set<Class<?>> getEndpointClasses()
          Returns a set of endpoint classes annotated with WebSocketEndpoint annotation that should be published by the container initialized with this configuration object.
 Set<javax.websocket.Endpoint> getEndpointInstances()
          Returns a set of Endpoint instances that should be exposed by the server in addition to the class-based endpoints returned from ServerConfiguration.getEndpointClasses().
 List<String> getExtensions()
          Return a mutable list of extension names supported by 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()
          Gets the maximum size of text message that this container will buffer.
 DefaultServerConfiguration maxBinaryMessageBufferSize(long max)
          Sets the max binary message buffer size.
 DefaultServerConfiguration maxSessionIdleTimeout(long max)
          Sets the max session idle timeout.
 DefaultServerConfiguration maxTextMessageBufferSize(long max)
          Sets the max text message buffer size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultServerConfiguration

public DefaultServerConfiguration()
Method Detail

getEndpointClasses

public Set<Class<?>> getEndpointClasses()
Description copied from interface: ServerConfiguration
Returns a set of endpoint classes annotated with WebSocketEndpoint annotation that should be published by the container initialized with this configuration object.

Specified by:
getEndpointClasses in interface ServerConfiguration
Returns:
Set of annotated endpoint classes to be exposed by the server.

getEndpointInstances

public Set<javax.websocket.Endpoint> getEndpointInstances()
Description copied from interface: ServerConfiguration
Returns a set of Endpoint instances that should be exposed by the server in addition to the class-based endpoints returned from ServerConfiguration.getEndpointClasses().

Specified by:
getEndpointInstances in interface ServerConfiguration
Returns:
Set of endpoint objects.

getMaxSessionIdleTimeout

public long getMaxSessionIdleTimeout()
Description copied from interface: ServerConfiguration
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 ServerConfiguration
Returns:
the number of seconds idle wed socket sessions are active.

getMaxBinaryMessageBufferSize

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

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

getMaxTextMessageBufferSize

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

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

getExtensions

public List<String> getExtensions()
Description copied from interface: ServerConfiguration
Return a mutable list of extension names supported by the container.

Specified by:
getExtensions in interface ServerConfiguration
Returns:
the mutable set of extension names.

maxSessionIdleTimeout

public DefaultServerConfiguration maxSessionIdleTimeout(long max)
Sets the max session idle timeout.

Parameters:
max - timeout in seconds.
Returns:
this configuration object.

maxBinaryMessageBufferSize

public DefaultServerConfiguration maxBinaryMessageBufferSize(long max)
Sets the max binary message buffer size.

Parameters:
max - buffer size in bytes.
Returns:
this configuration object.

maxTextMessageBufferSize

public DefaultServerConfiguration maxTextMessageBufferSize(long max)
Sets the max text message buffer size.

Parameters:
max - buffer size in bytes.
Returns:
this configuration object.

endpoint

public DefaultServerConfiguration endpoint(Class<?> endpointClass)
Registers a new endpoint annotated class.

Parameters:
endpointClass - class annotated with WebSocketEndpoint annotation.
Returns:
this configuration object.

endpoint

public DefaultServerConfiguration endpoint(javax.websocket.Endpoint endpoint)
Registers a new programmatic endpoint.

Parameters:
endpoint - object implementing Endpoint interface.
Returns:
this configuration object.

endpoints

public DefaultServerConfiguration endpoints(Class<?>... endpointClasses)
Registers new endpoint annotated classes.

Parameters:
endpointClasses - classes annotated with WebSocketEndpoint annotation.
Returns:
this configuration object.

endpoints

public DefaultServerConfiguration endpoints(javax.websocket.Endpoint... endpoints)
Registers new endpoint instances.

Parameters:
endpoints - endpoints.
Returns:
this configuration object.

endpoints

public DefaultServerConfiguration endpoints(Set<Class<?>> endpointClasses)
Registers new endpoint annotated classes.

Parameters:
endpointClasses - classes annotated with WebSocketEndpoint annotation.
Returns:
this configuration object.


Copyright © 2012. All Rights Reserved.