Interface Chain

    • Method Detail

      • getTransport

        <T extends AbstractTransport> T getTransport()
        Get the transport plug-in at the end of the chain. If possible, the return type is determined automatically based on the variable it is assigned into.
      • getTransport

        <T extends AbstractTransport> T getTransport​(java.lang.Class<T> transportClass)
        Get the transport plug-in at the end of the chain.
        Parameters:
        transportClass - The transport class which will be used to cast the result.
      • start

        Chain start()
             throws java.lang.Exception
        Calls start on all of the plug-ins in the chain and connects the chain to receive events.

        Will not return until all start() methods have completed and therefore may block.

        If the chain to be created might send events during the start() call then this should not be called from an event receiving thread as a deadlock may occur.

        If onApplicationInitialized has already been called then hostReady will be called on the new chain immediately from a background thread. Once onApplicationInitialized has been called the chain will receive any events that were sent to its subscribed channels from after the createChain call onwards.

        Returns:
        this Chain instance (to support fluent call style)
        Throws:
        java.lang.Exception - if an exception is thrown by the start() method of any plug-in in the chain.
      • destroy

        void destroy()
        Delete this dynamic chain instance, shutting down all plug-ins in the chain.

        Will disconnect the chain sender/receiver from the host, call shutdown on all the chain elements and then delete them. Will not return until chain shutdown has completed and therefore may block.

        Any events sent from a chain which is destroyed before onApplicationInitialized is called will be lost

        Managers may call createChain and destroy from multiple threads simultaneously. You may not call this method from a manager or chain whose shutdown() methods have returned (will throw an exception). You may not call this method from within a hostReady call (will deadlock)