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 connectingManagementClientChannelStrategy.- Author:
- Emanuel Muckenhuber
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFutureManagementChannel.State
-
Constructor Summary
Constructors Constructor Description FutureManagementChannel()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.jboss.remoting3.ChannelawaitChannel()Get the underlying channel.protected static IOExceptionchannelClosed()voidclose()org.jboss.remoting3.ChannelgetChannel()Get the channel.FutureManagementChannel.StategetState()protected booleanisConnected()Check if connected.protected org.jboss.remoting3.ChannelopenChannel(org.jboss.remoting3.Connection connection, String serviceType, org.xnio.OptionMap options)Open a channel.protected booleanprepareClose()Signal 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, create
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.as.protocol.ProtocolConnectionManager.ConnectionOpenHandler
connectionOpened
-
-
-
-
Method Detail
-
getChannel
public org.jboss.remoting3.Channel getChannel() throws IOExceptionDescription copied from class:ManagementClientChannelStrategyGet the channel.- Specified by:
getChannelin classManagementClientChannelStrategy- 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getState
public FutureManagementChannel.State getState()
-
isConnected
protected boolean isConnected()
Check if connected.- Returns:
trueif the connection is open,falseotherwise
-
awaitChannel
protected org.jboss.remoting3.Channel awaitChannel() throws IOExceptionGet 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 IOExceptionOpen 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
-
-