Package deltix.util.vsocket
Class VSServerFramework
- java.lang.Object
-
- deltix.util.vsocket.VSServerFramework
-
- All Implemented Interfaces:
deltix.util.lang.DisposableListener<VSDispatcher>,deltix.util.tomcat.ConnectionHandshakeHandler,java.io.Closeable,java.lang.AutoCloseable
public class VSServerFramework extends java.lang.Object implements deltix.util.tomcat.ConnectionHandshakeHandler, deltix.util.lang.DisposableListener<VSDispatcher>, java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<VSDispatcher>comparatorstatic VSServerFrameworkINSTANCEstatic intMAX_CONNECTIONSstatic shortMAX_SOCKETS_PER_CONNECTION
-
Constructor Summary
Constructors Constructor Description VSServerFramework(deltix.util.concurrent.QuickExecutor executor, int reconnectInterval, VSCompression compression, int connectionsLimit, short socketsPerConnection, ContextContainer contextContainer)VSServerFramework(deltix.util.concurrent.QuickExecutor executor, int reconnectInterval, VSCompression compression, ContextContainer contextContainer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voiddisposed(VSDispatcher resource)VSCompressiongetCompression()VSDispatchergetDispatcher(java.lang.String id)VSDispatcher[]getDispatchers()intgetDispatchersCount()deltix.util.concurrent.QuickExecutorgetExecutor()longgetThroughput()booleanhandleHandshake(Connection c)Handle the initial transport-level handshake with a client.booleanhandleHandshake(java.net.Socket s)booleanhandleHandshake(java.net.Socket s, java.io.BufferedInputStream is, java.io.OutputStream os)Handles inbound HTTP connection handshake when TB is running inside TomcatvoidinitSSLSocketFactory(TLSContext context)voidinitTransport(TransportProperties transportProperties)voidsetConnectionListener(VSConnectionListener lnr)
-
-
-
Field Detail
-
INSTANCE
public static volatile VSServerFramework INSTANCE
-
MAX_CONNECTIONS
public static final int MAX_CONNECTIONS
- See Also:
- Constant Field Values
-
MAX_SOCKETS_PER_CONNECTION
public static final short MAX_SOCKETS_PER_CONNECTION
- See Also:
- Constant Field Values
-
comparator
public static final java.util.Comparator<VSDispatcher> comparator
-
-
Constructor Detail
-
VSServerFramework
public VSServerFramework(deltix.util.concurrent.QuickExecutor executor, int reconnectInterval, VSCompression compression, int connectionsLimit, short socketsPerConnection, ContextContainer contextContainer)
-
VSServerFramework
public VSServerFramework(deltix.util.concurrent.QuickExecutor executor, int reconnectInterval, VSCompression compression, ContextContainer contextContainer)
-
-
Method Detail
-
getExecutor
public deltix.util.concurrent.QuickExecutor getExecutor()
-
getDispatchers
public VSDispatcher[] getDispatchers()
-
getDispatchersCount
public int getDispatchersCount()
-
getDispatcher
public VSDispatcher getDispatcher(java.lang.String id)
-
getThroughput
public long getThroughput()
-
setConnectionListener
public void setConnectionListener(VSConnectionListener lnr)
-
initSSLSocketFactory
public void initSSLSocketFactory(TLSContext context)
-
initTransport
public void initTransport(TransportProperties transportProperties)
-
handleHandshake
public boolean handleHandshake(java.net.Socket s) throws java.io.IOException- Throws:
java.io.IOException
-
handleHandshake
public boolean handleHandshake(java.net.Socket s, java.io.BufferedInputStream is, java.io.OutputStream os) throws java.io.IOExceptionHandles inbound HTTP connection handshake when TB is running inside Tomcat- Specified by:
handleHandshakein interfacedeltix.util.tomcat.ConnectionHandshakeHandler- Throws:
java.io.IOException
-
handleHandshake
public boolean handleHandshake(Connection c) throws java.io.IOException
Handle the initial transport-level handshake with a client.- Parameters:
c- Socket to perform the handshake with.- Returns:
- true if the connection is accepted and socket added to the set of transport channels. false if socket should be closed.
- Throws:
java.io.IOException
-
getCompression
public VSCompression getCompression()
-
disposed
public void disposed(VSDispatcher resource)
- Specified by:
disposedin interfacedeltix.util.lang.DisposableListener<VSDispatcher>
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-