Class FutureManagementChannel

java.lang.Object
org.jboss.as.protocol.mgmt.ManagementClientChannelStrategy
org.jboss.as.protocol.mgmt.FutureManagementChannel
All Implemented Interfaces:
Closeable, AutoCloseable, ProtocolConnectionManager.ConnectionOpenHandler

public abstract class FutureManagementChannel extends ManagementClientChannelStrategy implements ProtocolConnectionManager.ConnectionOpenHandler
Base class for a connecting ManagementClientChannelStrategy.
Author:
Emanuel Muckenhuber
  • Constructor Details

    • FutureManagementChannel

      public FutureManagementChannel()
  • Method Details

    • getChannel

      public org.jboss.remoting3.Channel getChannel() throws IOException
      Description copied from class: ManagementClientChannelStrategy
      Get the channel.
      Specified by:
      getChannel in class ManagementClientChannelStrategy
      Returns:
      the channel
      Throws:
      IOException - if an IO problem occurs getting the channel
    • channelClosed

      protected static IOException channelClosed()
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getState

      public FutureManagementChannel.State getState()
    • isConnected

      protected boolean isConnected()
      Check if connected.
      Returns:
      true if the connection is open, false otherwise
    • awaitChannel

      protected org.jboss.remoting3.Channel awaitChannel() throws IOException
      Get the underlying channel. This may block until the channel is set.
      Returns:
      the channel
      Throws:
      IOException - for any error
    • prepareClose

      protected boolean prepareClose()
      Signal that we are about to close the channel. This will not have any affect on the underlying channel, however prevent setting a new channel.
      Returns:
      whether the closing state was set successfully
    • openChannel

      protected org.jboss.remoting3.Channel openChannel(org.jboss.remoting3.Connection connection, String serviceType, org.xnio.OptionMap options) throws IOException
      Open a channel.
      Parameters:
      connection - the connection
      serviceType - the service type
      options - the channel options
      Returns:
      the opened channel
      Throws:
      IOException - if there is a remoting problem opening the channel or it cannot be opened in a reasonable amount of time
    • setChannel

      protected boolean setChannel(org.jboss.remoting3.Channel newChannel)
      Set the channel. This will return whether the channel could be set successfully or not.
      Parameters:
      newChannel - the channel
      Returns:
      whether the operation succeeded or not