Class TransportFactory
java.lang.Object
de.iip_ecosphere.platform.transport.TransportFactory
A factory for creating transport connector instances. This factory shall
ensure that the entire platform runs with the same connector instances,
however, provides at the same time the flexibility to exchange the creation
process. As there is no default connector in this artifact anymore, the factory
must be configured by instances of
TransportFactory.ConnectorCreator before use.- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDefines an internal factory implementation to create connectors. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static TransportFactory.ConnectorCreatorprivate static booleanprivate static TransportFactory.ConnectorCreatorprivate static TransportFactory.ConnectorCreator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TransportConnectorCreates a connector instance.static TransportConnectorCreates a direct memory transfer connector instance.static TransportConnectorCreates an inter-process connector.static StringReturns the descriptive name of the main connector.private static TransportFactory.ConnectorCreatorReturns eithercreatorif not null ordflt.private static voidInitializes the factory if not already done.Changes the direct memory factory implementation.Changes the inter-process factory implementation.Changes the main factory implementation.
-
Field Details
-
mainCreator
-
ipcCreator
-
dmCreator
-
initialized
private static boolean initialized
-
-
Constructor Details
-
TransportFactory
public TransportFactory()
-
-
Method Details
-
setMainImplementation
public static TransportFactory.ConnectorCreator setMainImplementation(TransportFactory.ConnectorCreator inst) Changes the main factory implementation. May be replaced by an injection-based mechanism, so far required for testing.- Parameters:
inst- the factory implementation instance (ignored if null)- Returns:
- the factory implementation instance before calling this method
-
setIpcImplementation
public static TransportFactory.ConnectorCreator setIpcImplementation(TransportFactory.ConnectorCreator inst) Changes the inter-process factory implementation. May be replaced by an injection-based mechanism, so far required for testing.- Parameters:
inst- the factory implementation instance (ignored if null)- Returns:
- the factory implementation instance before calling this method
-
setDmImplementation
public static TransportFactory.ConnectorCreator setDmImplementation(TransportFactory.ConnectorCreator inst) Changes the direct memory factory implementation. May be replaced by an injection-based mechanism, so far required for testing.- Parameters:
inst- the factory implementation instance (ignored if null)- Returns:
- the factory implementation instance before calling this method
-
initialize
private static void initialize()Initializes the factory if not already done. -
getCreator
private static TransportFactory.ConnectorCreator getCreator(TransportFactory.ConnectorCreator creator, TransportFactory.ConnectorCreator dflt) Returns eithercreatorif not null ordflt.- Parameters:
creator- the primary creator to return (if not null)dflt- the default creator to return if the primary creator is not present- Returns:
- the creator, either
creatorordflt
-
createConnector
Creates a connector instance.- Returns:
- the created connector instance
-
createIpcConnector
Creates an inter-process connector.- Returns:
- the created connector instance
-
createDirectMemoryConnector
Creates a direct memory transfer connector instance.- Returns:
- the direct memory connector instance
-
getConnectorName
Returns the descriptive name of the main connector.- Returns:
- the descriptive name
-