biz.onixs.fix.engine
Class Engine

java.lang.Object
  extended by biz.onixs.fix.engine.Engine

public class Engine
extends Object

FIX Engine.


Nested Class Summary
static class Engine.DynamicAcceptorArgs
          Dynamic acceptor event arguments.
static interface Engine.DynamicAcceptorListener
          Dynamic acceptor event listener.
static class Engine.State
          Engine state.
static class Engine.StateChangedArgs
          State changed event arguments.
static interface Engine.StateChangedListener
          Engine state changed listener interface.
 
Field Summary
 Engine.DynamicAcceptorListener NULL_DYNAMIC_ACCEPTOR_LISTENER
           
static Engine.StateChangedListener NULL_STATE_CHANGED_LISTENER
           
static ThreadStartedListener NULL_THREAD_STARTED_LISTENER
           
 
Method Summary
static void checkExpirationNotice(License license)
           
 Engine.DynamicAcceptorListener getDynamicAcceptorListener()
          Returns dynamic acceptor event listener.
static Engine getInstance()
          The instance of the engine.
 License getLicense()
           
 String getProductName()
          Returns product name
 String getProductNameAndVersion()
          Returns product name and version
 String getProductVersion()
          Returns Engine version
static EngineSettings getSettings()
          Returns Engine settings.
static Engine.StateChangedListener getStateChangedListener()
          Returns state changed listener.
static StorageRepositoryManager getStorageRepositoryManager()
           
 ThreadStartedListener getThreadStartedDispatcher()
           
 ThreadStartedListener getThreadStartedListener()
          Returns thread started listener.
static Engine init()
          Initializes the engine.
static Engine init(EngineSettings settings)
          Initializes the engine.
static Engine init(int listenPort)
          Initializes the engine.
static Engine init(Properties settings)
          Initializes the engine.
static Engine init(biz.onixs.util.settings.Settings settings)
          Initializes the engine.
static boolean isInited()
          Verify whether engine is inited.
 void setDynamicAcceptorListener(Engine.DynamicAcceptorListener listener)
          Sets dynamic acceptor event listener.
Warning.
static void setNetworkInterface(InetSocketAddress bindAddress)
          Sets the network interface bind address for establishing acceptor sessions.
static void setSSLContext(SSLContext sslContext)
          Sets the SSL context for establishing secure acceptor sessions.
static void setStateChangedListener(Engine.StateChangedListener listener)
          Sets state changed listener.
Warning.
 void setThreadStartedListener(ThreadStartedListener listener)
          Sets thread started event listener.
Warning.
 void shutdown()
          Shut downs the engine.
 String toString()
           
static void verifyEngineInited()
          Verifies that Engine inited
static void verifyEngineNotInited()
          Verifies that Engine is not inited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_DYNAMIC_ACCEPTOR_LISTENER

public final Engine.DynamicAcceptorListener NULL_DYNAMIC_ACCEPTOR_LISTENER

NULL_STATE_CHANGED_LISTENER

public static final Engine.StateChangedListener NULL_STATE_CHANGED_LISTENER

NULL_THREAD_STARTED_LISTENER

public static final ThreadStartedListener NULL_THREAD_STARTED_LISTENER
Method Detail

getThreadStartedDispatcher

public ThreadStartedListener getThreadStartedDispatcher()

setThreadStartedListener

public void setThreadStartedListener(ThreadStartedListener listener)
Sets thread started event listener.
Warning. This is critical to avoid time-consuming tasks inside the listener.

Parameters:
listener - thread started listener or NULL_THREAD_STARTED_LISTENER value to reset listener to default

getThreadStartedListener

public ThreadStartedListener getThreadStartedListener()
Returns thread started listener.

Returns:
thread started listener or NULL_THREAD_STARTED_LISTENER if it was not set

setSSLContext

public static void setSSLContext(SSLContext sslContext)
Sets the SSL context for establishing secure acceptor sessions. This is effective for all acceptor sessions.

Parameters:
sslContext - SSL context

setNetworkInterface

public static void setNetworkInterface(InetSocketAddress bindAddress)
Sets the network interface bind address for establishing acceptor sessions.

Parameters:
bindAddress - bind address

init

public static Engine init()
Initializes the engine. Must be called before any other method of the library.

Returns:
instance of the Engine.

init

public static Engine init(Properties settings)
Initializes the engine. Must be called before any other method of the library.

Parameters:
settings - Configuration settings (e.g. Listen Port, FIX Dialect, etc.).
Returns:
instance of the Engine.

init

public static Engine init(biz.onixs.util.settings.Settings settings)
Initializes the engine. Must be called before any other method of the library.

Parameters:
settings - Configuration settings (e.g. Listen Port, FIX Dialect, etc.).
Returns:
instance of the Engine.

init

public static Engine init(EngineSettings settings)
Initializes the engine. Must be called before any other method of the library.

Parameters:
settings - Engine configuration settings
Returns:
instance of the Engine.

init

public static Engine init(int listenPort)
Initializes the engine. Must be called before any other method of the library.

Parameters:
listenPort - The engine listens on this port for incoming connections. If '0' then only session-initiators can be created. If '-1' then the telecommunication level is disabled and only message parsing/assembling can be used.
Returns:
instance of the Engine.

isInited

public static boolean isInited()
Verify whether engine is inited.

Returns:
engine inited status

getInstance

public static Engine getInstance()
The instance of the engine.

Returns:
The instance of the engine.

setDynamicAcceptorListener

public void setDynamicAcceptorListener(Engine.DynamicAcceptorListener listener)
Sets dynamic acceptor event listener.
Warning. This is critical to avoid time-consuming tasks inside the listener.

Parameters:
listener - listener to add

getDynamicAcceptorListener

public Engine.DynamicAcceptorListener getDynamicAcceptorListener()
Returns dynamic acceptor event listener.

Returns:
listener

getSettings

public static EngineSettings getSettings()
Returns Engine settings.

Returns:
the Engine settings

shutdown

public void shutdown()
Shut downs the engine.


getStorageRepositoryManager

public static StorageRepositoryManager getStorageRepositoryManager()

getLicense

public License getLicense()

verifyEngineInited

public static void verifyEngineInited()
Verifies that Engine inited

Throws:
EngineException - if engine is not inited

verifyEngineNotInited

public static void verifyEngineNotInited()
Verifies that Engine is not inited

Throws:
EngineException - if engine is inited

getProductVersion

public String getProductVersion()
Returns Engine version

Returns:
Engine version

getProductName

public String getProductName()
Returns product name

Returns:
product name

getProductNameAndVersion

public String getProductNameAndVersion()
Returns product name and version

Returns:
product name and version

checkExpirationNotice

public static void checkExpirationNotice(License license)

getStateChangedListener

public static Engine.StateChangedListener getStateChangedListener()
Returns state changed listener.

Returns:
state changed listener

setStateChangedListener

public static void setStateChangedListener(Engine.StateChangedListener listener)
Sets state changed listener.
Warning. This is critical to avoid time-consuming tasks inside the listener.

Parameters:
listener - inbound application message listener or NULL_STATE_CHANGED_LISTENER value to reset listener to default

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2012 Onix Solutions. All Rights Reserved.