public class Handler extends Object implements biz.onixs.fix.engine.Session.InboundSessionMessageListener, biz.onixs.fix.engine.Session.InboundApplicationMessageListener, biz.onixs.fix.engine.Session.OutboundSessionMessageListener, biz.onixs.fix.engine.Session.OutboundApplicationMessageListener, biz.onixs.fix.scheduler.InitiatorConnectionListener
| Modifier and Type | Class and Description |
|---|---|
static interface |
Handler.ErrorListener
Defines the contract for listeners that handle error events.
|
static interface |
Handler.HandlerListener
Defines the contract for listeners that handle various messages received from the
CME Drop Copy Handler.
|
static interface |
Handler.WarningListener
Defines the contract for listeners that handle warning events.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ApplicationSystemName |
static String |
ApplicationSystemVendor |
static String |
ApplicationSystemVersion |
static int |
MaxResendMsgCount |
| Constructor and Description |
|---|
Handler(biz.onixs.fix.engine.Session session)
Handler constructor.
|
Handler(String senderCompId,
String senderSubId,
String targetSubId)
Handler constructor.
|
Handler(String senderCompId,
String targetCompId,
String senderSubId,
String targetSubId,
String senderLocationId)
Handler constructor.
|
| Modifier and Type | Method and Description |
|---|---|
biz.onixs.fix.parser.Message |
createLogonMessage(String accessKeyID,
String secretKey)
Sets the access key ID and secret key, and then creates a FIX Logon message.
|
void |
dispose()
Releases all resources held by this Handler and gracefully shuts down its
internal FIX session and the global OnixS FIX Engine.
|
static String |
getDialectFile()
Returns the location of the Cme Drop Copy FIX Dialect file.
|
Handler.ErrorListener |
getErrorListener()
Retrieves the currently registered
ErrorListener. |
Handler.HandlerListener |
getHandlerListener()
Retrieves the currently registered
HandlerListener. |
static String |
getLicenseFile()
Retrieves the path configured for the OnixS license file (`.lic`) location.
|
static String |
getLogDirectory()
Retrieves the path configured for storing log files.
|
boolean |
getProcessNextExpectedSeqNumFromCmeLogout() |
biz.onixs.fix.engine.Session |
getSession()
Retrieves the underlying FIX session used by this Handler.
|
Handler.WarningListener |
getWarningListener()
Retrieves the currently registered
WarningListener. |
void |
logon(String host,
int port,
String accessKeyID,
String secretKey)
Establishes a connection and logs on to the CME Drop Copy session.
|
void |
logout()
Initiates the logout process from the CME Drop Copy session.
|
void |
onConnecting(biz.onixs.fix.scheduler.InitiatorConnectingArgs initiatorConnectingArgs) |
void |
onInboundApplicationMessage(Object sender,
biz.onixs.fix.engine.Session.InboundApplicationMessageArgs args) |
void |
onInboundSessionMessage(Object sender,
biz.onixs.fix.engine.Session.InboundSessionMessageArgs args) |
void |
onOutboundApplicationMessage(Object o,
biz.onixs.fix.engine.Session.OutboundApplicationMessageArgs outboundApplicationMessageArgs) |
void |
onOutboundSessionMessage(Object o,
biz.onixs.fix.engine.Session.OutboundSessionMessageArgs outboundSessionMessageArgs) |
void |
reset()
Resets the underlying FIX session's local sequence numbers.
|
static void |
setDialectFile(String value)
Sets a custom path to the CME Drop Copy FIX Dialect file (`.xml`).
|
void |
setErrorListener(Handler.ErrorListener listener)
Sets the listener for error events.
|
void |
setHandlerListener(Handler.HandlerListener listener)
Sets the listener for Handler-related events.
|
static void |
setLicenseFile(String value)
Sets a custom, absolute path to the OnixS license file (`.lic`) location.
|
static void |
setLogDirectory(String value)
Sets the absolute path where log files will be stored.
|
void |
setProcessNextExpectedSeqNumFromCmeLogout(boolean processNextExpectedSeqNumFromCmeLogout) |
void |
setWarningListener(Handler.WarningListener listener)
Sets the listener for warning events.
|
public static final int MaxResendMsgCount
public static String ApplicationSystemName
public static String ApplicationSystemVendor
public static String ApplicationSystemVersion
public Handler(String senderCompId, String senderSubId, String targetSubId)
senderCompId - Fix session SenderCompIDsenderSubId - Fix session SenderSubIDtargetSubId - Fix session TargetSubIDpublic Handler(String senderCompId, String targetCompId, String senderSubId, String targetSubId, String senderLocationId)
senderCompId - Fix session SenderCompIDtargetCompId - Fix session TargetCompIDsenderSubId - Fix session SenderSubIDtargetSubId - Fix session TargetSubIDsenderLocationId - Fix session SenderLocationIDpublic Handler(biz.onixs.fix.engine.Session session)
session - Fix session.public static String getLogDirectory()
By default, this path is initialized to the current working directory (`.`)
when the Handler class is loaded. Developers can change this path
at any time using setLogDirectory(String).
public static void setLogDirectory(String value)
This method is typically called during application startup to configure logging. It is a static method, meaning it configures the log directory globally for all instances of the Handler within the application's lifecycle.
value - The absolute path to the directory where log files should be written.
For example, "/var/log/my-app" or "C:\\ProgramData\\MyApp\\Logs".
Using "." specifies the current working directory.public static String getLicenseFile()
By default, this path is initialized to the current working directory (`.`)
when the Handler class is loaded. Developers can change this path
at any time using setLicenseFile(String).
It's important to note that even if a custom path is set, the OnixS library might also search for the license file in default locations like the classpath if the file is not found at the specified path.
public static void setLicenseFile(String value)
If this method is not called, the OnixS library will by default attempt to locate the license file (`OnixS.lic`) on the **application's classpath**. This means you can often include the license file directly in your application's resources without explicitly setting a file path.
This is a static method, meaning it configures the license file location for all instances of the Handler or other library components within the application's lifecycle.
value - The file or folder path, e.g., "/path/to/OnixS.lic" or "C:\\licenses")
* where the OnixS license file is located.public static void setDialectFile(String value)
By default, if this method is not called, the Handler will automatically
load the dialect file named CmeDropCopyFixDialect.xml from the
application's classpath. This approach is often preferred for deployment,
allowing the dialect file to be bundled directly within the application's
JAR or resources.
This is a static method, meaning it configures the dialect file location globally for all instances of the Handler within the application's lifecycle.
value - The absolute path (including the file name and extension,
e.g., "/path/to/CmeDropCopyFixDialect.xml" or "C:\\configs\\CmeDropCopyFixDialect.xml")
where the CME Drop Copy FIX Dialect file is located. Pass null to reset to the
default classpath lookup behavior.public static String getDialectFile()
public final void logon(String host, int port, String accessKeyID, String secretKey) throws Exception
The `accessKeyID` and `secretKey` are critical for authenticating your application with the CME Globex platform. They are used to generate a Hashed Message Authentication Code (HMAC) to secure the logon request and ensure the confidentiality and integrity of messages.
host - The hostname or IP address of the CME Drop Copy session endpoint.port - The port number for the CME Drop Copy session endpoint.accessKeyID - The Access Key ID provided by CME Group, used for authentication.secretKey - The Secret Key provided by CME Group, used in conjunction with the Access Key ID for authentication.Exception - If any error occurs during the logon process.public biz.onixs.fix.parser.Message createLogonMessage(String accessKeyID, String secretKey)
accessKeyID - The Access Key ID used for authentication with the CME Drop Copy service.secretKey - The Secret Key associated with the Access Key ID, used for authentication.Message object representing the FIX Logon message (MsgType=A),
pre-populated with the necessary authentication credentials.public final void logout()
After calling this method, the session will transition to a logged-out state, and no further messages will be exchanged until a new logon is performed.
This method is synchronized to ensure thread safety when initiating logout.
public final void reset()
This method is synchronized to ensure thread safety during the reset operation.
RuntimeException - If the session is not in a DISCONNECTED state.
This method must only be called when the session is
not actively connected or logging on/out.public void onOutboundSessionMessage(Object o, biz.onixs.fix.engine.Session.OutboundSessionMessageArgs outboundSessionMessageArgs)
onOutboundSessionMessage in interface biz.onixs.fix.engine.Session.OutboundSessionMessageListenerpublic void onOutboundApplicationMessage(Object o, biz.onixs.fix.engine.Session.OutboundApplicationMessageArgs outboundApplicationMessageArgs)
onOutboundApplicationMessage in interface biz.onixs.fix.engine.Session.OutboundApplicationMessageListenerpublic void onInboundSessionMessage(Object sender, biz.onixs.fix.engine.Session.InboundSessionMessageArgs args)
onInboundSessionMessage in interface biz.onixs.fix.engine.Session.InboundSessionMessageListenerpublic void onInboundApplicationMessage(Object sender, biz.onixs.fix.engine.Session.InboundApplicationMessageArgs args)
onInboundApplicationMessage in interface biz.onixs.fix.engine.Session.InboundApplicationMessageListenerpublic boolean getProcessNextExpectedSeqNumFromCmeLogout()
public void setProcessNextExpectedSeqNumFromCmeLogout(boolean processNextExpectedSeqNumFromCmeLogout)
public void onConnecting(biz.onixs.fix.scheduler.InitiatorConnectingArgs initiatorConnectingArgs)
onConnecting in interface biz.onixs.fix.scheduler.InitiatorConnectionListenerpublic void setHandlerListener(Handler.HandlerListener listener)
listener - The Handler.HandlerListener instance that will receive Handler events.
Pass null to unregister the current listener.public Handler.HandlerListener getHandlerListener()
HandlerListener.Handler.HandlerListener instance currently set to receive Handler events,
or null if no listener has been set.public void setErrorListener(Handler.ErrorListener listener)
listener - The Handler.ErrorListener instance that will receive error events.
Pass null to unregister the current listener.public Handler.ErrorListener getErrorListener()
ErrorListener.Handler.ErrorListener instance currently set to receive error events,
or null if no listener has been set.public void setWarningListener(Handler.WarningListener listener)
listener - The Handler.WarningListener instance that will receive warning events.
Pass null to unregister the current listener.public Handler.WarningListener getWarningListener()
WarningListener.Handler.WarningListener instance currently set to receive warning events,
or null if no listener has been set.public final void dispose()
Once disposed, this Handler instance should no longer be used.
This method is idempotent; calling it multiple times will not cause an error
and will only perform the cleanup once. It is also synchronized to
ensure thread safety during the disposal process.
**Important Note on Engine Shutdown:** Calling Engine.getInstance().shutdown()
will shut down the entire OnixS FIX Engine. This means any other sessions or
components using the same Engine instance will also be affected and should
no longer be used after this method is called. Ensure no other active sessions
or Engine-dependent operations are running or intended to run after this call.
public final biz.onixs.fix.engine.Session getSession()
Session object representing the underlying
FIX session, or null if the session has been disposed.Copyright © 2013–2026 Onix Solutions. All rights reserved.