|
||||||||||
| PREV CLASS NEXT CLASS | All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.teraspaces.qwfix.FIXMessageComponent
com.teraspaces.qwfix.FIXMessage
public abstract class FIXMessage
Represents a FIX message.
| Constructor Summary | |
|---|---|
FIXMessage()
|
|
| Method Summary | |
|---|---|
abstract void |
free()
Returns this instance to QWFIX run time object cache. |
abstract FIXMessageDirection |
getDirection()
Gets the direction. |
FIXSchemaMessage |
getMessageSchema()
Gets the message schema. |
abstract long |
getMessageToken()
Gets the message token. |
String |
getMsgType()
Gets the MsgType. |
abstract void |
verify()
Verifies this message. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FIXMessage()
| Method Detail |
|---|
public String getMsgType()
public abstract void verify()
throws FIXSessionRejectException
If this method returns without throwing an exception, the FIXSession won't throw
FIXSessionRejectException when the application sends the message later on using
FIXSession.sendMessage(com.teraspaces.qwfix.FIXMessage).
This method only makes sure that the message meets the most basic requirement of the FIXMessage
verification rules. In practice only the required fields rule is checked. There's no need to check
the valid values rule because it's already checked when FIXMessageComponent.setValue(int, int) is called.
QWFIX Engine won't check the "conditionally required fields". Visual Lambda rules can be defined and added to engine session to enforce such rules. This method does check Visual Lambda rules. This method only makes sense for non-readonly type of messages. Read only type of FIX messages always returns successfully.
Event if a message passes this verification, other exceptions may be thrown out when calling sendMessage. For example, the session may be down or disabled. This method won't guarantee that the message won't be rejected by counter party, either.
Usually there's no need to call this method because the message is always verified when message is passed to sendMessage. The only scenario that the message needs to be called is when application needs to send more than one messages in a "Transaction" context, for example, a list of segmented message (such as "New Order - List").
FIXSessionRejectException - the FIX session reject exceptionpublic FIXSchemaMessage getMessageSchema()
public abstract FIXMessageDirection getDirection()
public abstract long getMessageToken()
public abstract void free()
This method is called when the message instance created by FIXSession.createMessage(String) is no longer needed.
Modifying the instance after this method is called will lead to undetermined behavior.
This method will return the message to the run time maintained "FIX message cache", so that the instance will be reused when another CreateMessage()()() is called. Using the method will save unnecessary memory allocation and unnecessary garbage collection and improve the system overall performance.
If the message is discarded without calling this method, the message will finally subject to garbage collection.
Calling FIXMessageComponent.clear() method on the message will recycle every repeating instances contained by the message. The message can be reused immediately. In fact this method also triggers a clear() method call.
Calling this method more than once on the same FIXMessage instance may lead to disastrous result. For performance reason we don't check such behavior in our code. It's developers' responsibility to prevent it.
Calling free() on a read only message will do nothing. Read only messages are managed by internal message cache.
|
||||||||||
| PREV CLASS NEXT CLASS | All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||