Class ConnectionBasedDomainManager

    • Constructor Detail

      • ConnectionBasedDomainManager

        protected ConnectionBasedDomainManager​(String domain)
        Constructor.
        Parameters:
        domain - the domain to manage
    • Method Detail

      • isConnected

        public boolean isConnected()
        Checks if this domain manager is connected.
        Returns:
        true if connected, false otherwise
      • failedToConnect

        protected void failedToConnect​(Throwable exception)
        Implementations can optionally override this if they need special handling for a failure to connect.
        Parameters:
        exception - the exception that caused the failure the connect
      • connect

        protected abstract void connect()
        Implementations must connect via this method.

        This is executed in a separate thread so timeliness is not a factor. It is possible that multiple calls to connect() block waiting for the first one to finish so implementations of this method must be written to guard against this being a problem.

      • disconnect

        protected abstract void disconnect()
        Implementations must disconnect via this method.

        This is executed in a separate thread so timeliness is not a factor. It is possible that multiple calls to disconnect() block waiting for the first one to finish so implementations of this method must be written to guard against this being a problem.

      • onFirstRegister

        protected final void onFirstRegister()
        Description copied from class: AbstractDomainManager
        Implementations must handle any specific logic for dealing with a registration that adds to the map of handlers for the first time (such as connecting).
        Specified by:
        onFirstRegister in class AbstractDomainManager
      • onLastDeregister

        protected final void onLastDeregister()
        Description copied from class: AbstractDomainManager
        Implementations must handle any specific logic for dealing with a deregistration that empties the map of handlers (such as disconnecting).
        Specified by:
        onLastDeregister in class AbstractDomainManager