public class OutboundSocketBinding extends Object
SocketBinding
which represents a ServerSocket
that opens a socket for "listening",
the OutboundSocketBinding
represents a Socket
which "connects" to a remote/local hostModifier and Type | Field and Description |
---|---|
static org.jboss.msc.service.ServiceName |
OUTBOUND_SOCKET_BINDING_BASE_SERVICE_NAME |
Constructor and Description |
---|
OutboundSocketBinding(String name,
SocketBindingManager socketBindingManager,
InetAddress destinationAddress,
int destinationPort,
NetworkInterfaceBinding sourceNetworkInterface,
Integer sourcePort,
boolean fixedSourcePort)
Creates a outbound socket binding
|
OutboundSocketBinding(String name,
SocketBindingManager socketBindingManager,
String destinationAddress,
int destinationPort,
NetworkInterfaceBinding sourceNetworkInterface,
Integer sourcePort,
boolean fixedSourcePort)
Creates a outbound socket binding
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the outbound socket binding connection
|
Socket |
connect()
Creates a
Socket represented by this OutboundSocketBinding and connects to the
destination |
InetAddress |
getDestinationAddress()
Returns the destination address of this outbound socket binding.
|
int |
getDestinationPort() |
InetAddress |
getSourceAddresss()
Returns the source address of this outbound socket binding.
|
Integer |
getSourcePort()
The source port for this outbound socket binding.
|
boolean |
isConnected()
Returns true if a socket connection has been established by this outbound socket binding.
|
boolean |
isFixedSourcePort() |
public static final org.jboss.msc.service.ServiceName OUTBOUND_SOCKET_BINDING_BASE_SERVICE_NAME
public OutboundSocketBinding(String name, SocketBindingManager socketBindingManager, String destinationAddress, int destinationPort, NetworkInterfaceBinding sourceNetworkInterface, Integer sourcePort, boolean fixedSourcePort)
name
- Name of the outbound socket bindingsocketBindingManager
- The socket binding managerdestinationAddress
- The destination address to which this socket will be "connected". Cannot be null or empty string.destinationPort
- The destination port. Cannot be < 0.sourceNetworkInterface
- (Optional) source network interface which will be used as the "source" of the socket bindingsourcePort
- (Optional) source port. Cannot be null or < 0fixedSourcePort
- True if the sourcePort
has to be used as a fixed port number. False if the sourcePort
will be added to the port offset while determining the absolute source port.public OutboundSocketBinding(String name, SocketBindingManager socketBindingManager, InetAddress destinationAddress, int destinationPort, NetworkInterfaceBinding sourceNetworkInterface, Integer sourcePort, boolean fixedSourcePort)
name
- Name of the outbound socket bindingsocketBindingManager
- The socket binding managerdestinationAddress
- The destination address to which this socket will be "connected". Cannot be null.destinationPort
- The destination port. Cannot be < 0.sourceNetworkInterface
- (Optional) source network interface which will be used as the "source" of the socket bindingsourcePort
- (Optional) source port. Cannot be null or < 0fixedSourcePort
- True if the sourcePort
has to be used as a fixed port number. False if the sourcePort
will be added to the port offset while determining the absolute source port.public Socket connect() throws IOException
Socket
represented by this OutboundSocketBinding
and connects to the
destinationIOException
public InetAddress getDestinationAddress() throws UnknownHostException
UnknownHostException
- If the destination address cannot be resolvedpublic int getDestinationPort()
public boolean isFixedSourcePort()
public InetAddress getSourceAddresss()
public Integer getSourcePort()
getAbsoluteSourcePort()
methodpublic void close() throws IOException
IOException
public boolean isConnected()
Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.