Class AbstractCodec

    • Constructor Detail

      • AbstractCodec

        public AbstractCodec​(org.slf4j.Logger logger,
                             PluginConstructorParameters.CodecConstructorParameters params)
                      throws java.lang.IllegalArgumentException,
                             java.lang.Exception
        Constructor. A subclass should provide its own constructor with the same signature as this one. This base class makes the parameters passed into its constructor available as member fields or methods for use by the subclass.
        Parameters:
        logger - a slf4j Logger object which can be used to log to the host log file.
        params - an extensible interface providing access to the configuration for this plug-in and other capabilities.
        Throws:
        java.lang.IllegalArgumentException - should be thrown from a plug-in's constructor if the configuration is invalid.
        java.lang.Exception - can be thrown to indicate an internal error.
        Since:
        9.12.0.1
    • Method Detail

      • setNextTowardsHost

        public final void setNextTowardsHost​(HostSide hostSide)
        Remember the host side of this codec. The hostSide argument is stored in the hostSide member of this class for use by subclasses when delivering messages towards the transport.
      • setNextTowardsTransport

        public final void setNextTowardsTransport​(TransportSide transportSide)
        Remember the transport side of this codec. The transportSide argument is stored in the transportSide member of this class for use by subclasses when delivering messages towards the host.
      • shutdown

        public void shutdown()
                      throws java.lang.Exception
        No-op implementation of ConnectivityPlugin.shutdown(). For convenience. If the codec creates any resources that need closing, it must override this method.

        This method may be called while messages are still being delivered towards the host or towards the transport.

        If the plug-in has any messages queued to send towards the host it should flush them before shutting down. This is not true if the host itself is shutting down (rather than just the chain). This can be determined via the PluginHost.isShuttingDown() method.

        Specified by:
        shutdown in class ConnectivityPlugin
        Throws:
        java.lang.Exception
      • start

        public void start()
                   throws java.lang.Exception
        No-op implementation of ConnectivityPlugin.start(). For convenience. If the codec creates any resources, it will need to override this method to do so and will typically need to implement shutdown() as well.
        Specified by:
        start in class ConnectivityPlugin
        Throws:
        java.lang.Exception - only if a fatal error occurred during startup.
      • hostReady

        public void hostReady()
                       throws java.lang.Exception
        No-op implementation of ConnectivityPlugin.hostReady(). For convenience. Plug-ins are not required to do anything at this point, and most codecs will not need to implement this method.
        Specified by:
        hostReady in class ConnectivityPlugin
        Throws:
        java.lang.Exception
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object