com.epam.fixengine
Class FIXServer

java.lang.Object
  extended by com.epam.fixengine.FIXServer
Direct Known Subclasses:
ScheduledFIXServer, SSLFIXServer

public class FIXServer
extends Object

Generic FIXServer implementation.


Field Summary
protected  com.epam.fixengine.session.util.ConfigurationAdaptor configuration
           
protected  com.epam.fixengine.manager.ConfiguredSessionRegister configuredSessionRegister
           
protected  int[] ports
           
protected  Server[] servers
           
 
Constructor Summary
FIXServer()
           
FIXServer(Configuration conf)
          Creates the fix server.
 
Method Summary
protected  SessionAcceptorStrategyHandler getAcceptorStrategy(Configuration configuration)
           
 String getConfigPath()
          Path to config file
 List<SessionParameters> getRegisterAcceptorSession()
           
protected  SessionTransportFactory getTransportFactory(Configuration configuration)
           
 void registerAcceptorSession(SessionParameters sessionParameters)
          Register the session parameters of acceptor.
protected  void registerConfiguredSessions()
           
 void setConfigPath(String configPath)
          Set path to config file
 void setListener(FIXServerListener listener)
          Sets listener.
 void setLoginWaitTimeout(int loginWaitTimeout)
          Sets login timeout.
 void setNic(String nic)
           
 void setPort(int port)
          Sets port to listen on.
 void setPorts(int... ports)
          Sets ports to listen on.
 void setServer(Server server)
          Replaces default TCPServer implementation with custom Server implementation.
 boolean start()
          Actually starts the servers.
 void stop()
          Stops the server.
 void unregisterAcceptorSession(SessionParameters sessionParameters)
          Remove registered acceptor session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servers

protected Server[] servers

configuration

protected final com.epam.fixengine.session.util.ConfigurationAdaptor configuration

configuredSessionRegister

protected com.epam.fixengine.manager.ConfiguredSessionRegister configuredSessionRegister

ports

protected int[] ports
Constructor Detail

FIXServer

public FIXServer()

FIXServer

public FIXServer(Configuration conf)
Creates the fix server.

Method Detail

getTransportFactory

protected SessionTransportFactory getTransportFactory(Configuration configuration)

getAcceptorStrategy

protected SessionAcceptorStrategyHandler getAcceptorStrategy(Configuration configuration)

setServer

public void setServer(Server server)
Replaces default TCPServer implementation with custom Server implementation.

Parameters:
server - implementation specified by user
See Also:
Server

setListener

public void setListener(FIXServerListener listener)
Sets listener.

Parameters:
listener - - user specified listener

setLoginWaitTimeout

public void setLoginWaitTimeout(int loginWaitTimeout)
Sets login timeout.

Parameters:
loginWaitTimeout - the login timeout in mils

setPorts

public void setPorts(int... ports)
Sets ports to listen on.

Parameters:
ports - ports to listen on

setPort

public void setPort(int port)
Sets port to listen on.

Parameters:
port - port to listen on

setNic

public void setNic(String nic)

start

public boolean start()
              throws IOException
Actually starts the servers.

Returns:
true if all servers started succesfully false - otherwise (server will add WARN messages with description of each problem to log)
Throws:
IOException - if unable to start the server at least on one port. In this case the first received exception will be thrown.

registerConfiguredSessions

protected void registerConfiguredSessions()

stop

public void stop()
          throws IOException
Stops the server.

Throws:
IOException - if stop was unsuccessful

registerAcceptorSession

public void registerAcceptorSession(SessionParameters sessionParameters)
Register the session parameters of acceptor.

Parameters:
sessionParameters - the sessionParameters

unregisterAcceptorSession

public void unregisterAcceptorSession(SessionParameters sessionParameters)
Remove registered acceptor session.
Note: To remove registered acceptor session it's enough to pass SessionParameters with right SenderComId and TargetCompId for a moment.

Parameters:
sessionParameters -

getRegisterAcceptorSession

public List<SessionParameters> getRegisterAcceptorSession()

getConfigPath

public String getConfigPath()
Path to config file

Returns:
path to config file

setConfigPath

public void setConfigPath(String configPath)
Set path to config file

Parameters:
configPath - path to config file


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.