...
Code Block | ||
---|---|---|
| ||
package com.epam.feta.core;
/**
* This abstract class is needed for message communication between FE and its transport adapter (TA).
* Each adapter will be run on a new instance of JVM.
*/
public abstract class JavaAdapter {
public JavaAdapter() {
}
/**
* FE implements this method and receives the messages from TA through it.
* @param clientId a name of the client. It is configured in FIXEdge.properties and used in BL rules in the capacity of sender or receiver.
* @param message a message to FE (which has been received from TA) as byte array.
*/
public native void onMessageCallback(String clientId, byte[] message);
/**
* FE implements this method and receives the events from TA through it.
* For example: event MESSAGE_DELIVERED when the message has been sent by TA.
*
* @param clientId a name of the client. It is configured in FIXEdge.properties and used in BL rules in the capacity of sender or receiver.
* @param eventCode the code of event from set. There is the set of events which is reserved in FE and TA.
* @param description event description.
* @param message this parameter is used to know what message was cause the event
* @see com.epam.feta.core.event.EventCode
*/
public native void onEventCallback(String clientId, long eventCode, String description, byte[] message);
/**
* The method is called by FE when it starts.
* @param prefix prefix of TA's parameters. It is declared in parameter "TransportLayer.TransportAdapters"
* @param pathToConfigFile path to FIXEdge.properties. TA parses it.
* @throws Exception
*/
public abstract void init(String prefix, String pathToConfigFile) throws Exception;
/**
* The method is called by FE when its parameters were update in runtime.
* @param prefix prefix of TA's parameters. It is declared in parameter "TransportLayer.TransportAdapters"
* @param config parameters and values for TA from FIXEdge.properties as string. TA parses it.
* @throws Exception
*/
public abstract void reInit(String prefix, String config) throws Exception;
/**
* The method is called by FE to send a message to TA
* @param clientId a name of the client. It is configured in FIXEdge.properties and used in BL rules in the capacity of sender or receiver.
* @param message a message to TA (which has been received from FE) as byte array.
*/
public abstract void sendMessage(String clientId, byte[] message);
/**
* The method is called by FE to take the parameters for monitoring tool
* @return Name of parameter and its value(split by equals sign), this pairs will be sent to monitoring tool as is. Parameters must be split by commas.
*/
public abstract String getMonitoringParameters();
/**
* The method is called by FE when it is going to stop.
* When this method is invoked we need to stop processing the messages to FE and process messages only from FE.
*/
public abstract void preDestroy();
/**
* The method is called by FE when it stops.
*/
public abstract void destroy();
}
package com.epam.feta.event.client;
public enum ClientState {
CREATED, CONNECTING, CONNECTED, DISCONNECTED, RECONNECTING, AUTHORIZATION_ERROR
} |
...
All other parameters are setup on the level of specific Transport Adaptors (see JMS TA Configuration Parameters and RMQ TA Configuration Parameters for examples)
Configuring FIXEdge.properties
...