Package org.jboss.as.protocol.mgmt
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
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.jboss.remoting3.ChannelGet the underlying channel.protected static IOExceptionvoidclose()org.jboss.remoting3.ChannelGet the channel.getState()protected booleanCheck if connected.protected org.jboss.remoting3.ChannelopenChannel(org.jboss.remoting3.Connection connection, String serviceType, org.xnio.OptionMap options) Open a channel.protected booleanSignal that we are about to close the channel.protected booleansetChannel(org.jboss.remoting3.Channel newChannel) Set the channel.Methods inherited from class org.jboss.as.protocol.mgmt.ManagementClientChannelStrategy
create, create, createMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.as.protocol.ProtocolConnectionManager.ConnectionOpenHandler
connectionOpened
-
Constructor Details
-
FutureManagementChannel
public FutureManagementChannel()
-
-
Method Details
-
getChannel
Description copied from class:ManagementClientChannelStrategyGet the channel.- Specified by:
getChannelin classManagementClientChannelStrategy- Returns:
- the channel
- Throws:
IOException- if an IO problem occurs getting the channel
-
channelClosed
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getState
-
isConnected
protected boolean isConnected()Check if connected.- Returns:
trueif the connection is open,falseotherwise
-
awaitChannel
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 connectionserviceType- the service typeoptions- 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
-