Class TransportFactory

java.lang.Object
de.iip_ecosphere.platform.transport.TransportFactory

public class TransportFactory extends Object
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
  • Field Details

  • 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

      Returns either creator if not null or dflt.
      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 creator or dflt
    • createConnector

      public static TransportConnector createConnector()
      Creates a connector instance.
      Returns:
      the created connector instance
    • createIpcConnector

      public static TransportConnector createIpcConnector()
      Creates an inter-process connector.
      Returns:
      the created connector instance
    • createDirectMemoryConnector

      public static TransportConnector createDirectMemoryConnector()
      Creates a direct memory transfer connector instance.
      Returns:
      the direct memory connector instance
    • getConnectorName

      public static String getConnectorName()
      Returns the descriptive name of the main connector.
      Returns:
      the descriptive name