public class DefaultMessageFactory extends Object implements MessageFactory
Constructor and Description |
---|
DefaultMessageFactory()
Constructs a DefaultMessageFactory, which dynamically loads and delegates to
the default version-specific message factories, if they are available at runtime.
|
DefaultMessageFactory(String defaultApplVerID)
Constructs a DefaultMessageFactory, which dynamically loads and delegates to
the default version-specific message factories, if they are available at runtime.
|
Modifier and Type | Method and Description |
---|---|
void |
addFactory(String beginString,
Class<? extends MessageFactory> factoryClass)
Adds a factory of the given class, which will be delegated to for creating
Message instances from messages with the given begin string.
|
void |
addFactory(String beginString,
String factoryClassName)
Adds a factory of the given class, which will be delegated to for creating
Message instances from messages with the given begin string.
|
Message |
create(String beginString,
ApplVerID applVerID,
String msgType)
Creates a message for a specified type, FIX version, and ApplVerID.
|
Message |
create(String beginString,
String msgType)
Creates a message for a specified type and FIX version
|
Group |
create(String beginString,
String msgType,
int correspondingFieldID)
Creates a group for the specified parent message type and
for the fields with the corresponding field ID
Example: to create a
MarketDataRequest.NoMDEntryTypes
you need to call
create(MsgType.MARKET_DATA_REQUEST , NoMDEntryTypes.FIELD )
Function returns null if the group cannot be created. |
public DefaultMessageFactory()
Callers can set the context classloader
,
which will be used to load the classes if Class.forName
fails to do so (e.g. in an OSGi environment).
Equivalent to DefaultMessageFactory
(ApplVerID.FIX50
).
public DefaultMessageFactory(String defaultApplVerID)
Callers can set the context classloader
,
which will be used to load the classes if Class.forName
fails to do so (e.g. in an OSGi environment).
defaultApplVerID
- ApplVerID value used by default for create(String, ApplVerID, String)
public void addFactory(String beginString, String factoryClassName) throws ClassNotFoundException
Callers can set the context classloader
,
which will be used to load the classes if Class.forName
fails to do so (e.g. in an OSGi environment).
beginString
- the begin string whose messages will be delegated to the factoryfactoryClassName
- the name of the factory class to instantiate and addClassNotFoundException
- if the named factory class cannot be foundRuntimeException
- if the named factory class cannot be instantiatedpublic void addFactory(String beginString, Class<? extends MessageFactory> factoryClass)
beginString
- the begin string whose messages will be delegated to the factoryfactoryClass
- the class of the factory to instantiate and addRuntimeException
- if the given factory class cannot be instantiatedpublic Message create(String beginString, String msgType)
MessageFactory
create
in interface MessageFactory
beginString
- the FIX version (for example, "FIX.4.2")msgType
- the FIX message type (for example, "D" for an order)public Message create(String beginString, ApplVerID applVerID, String msgType)
MessageFactory
create
in interface MessageFactory
beginString
- the FIX version (for example, "FIX.4.2")applVerID
- the ApplVerID (for example "6" for FIX44)msgType
- the FIX message type (for example, "D" for an order)public Group create(String beginString, String msgType, int correspondingFieldID)
MessageFactory
MarketDataRequest.NoMDEntryTypes
you need to call
create(MsgType.MARKET_DATA_REQUEST
, NoMDEntryTypes.FIELD
)
Function returns null if the group cannot be created.create
in interface MessageFactory
beginString
- the FIX version (for example, "FIX.4.2")msgType
- Message type of the enclosing messagecorrespondingFieldID
- the fieldID of the field in the groupCopyright © 2021. All rights reserved.