Package org.apache.openjpa.event
Class TCPRemoteCommitProvider.HostAddress
- java.lang.Object
-
- org.apache.openjpa.event.TCPRemoteCommitProvider.HostAddress
-
- Enclosing class:
- TCPRemoteCommitProvider
protected class TCPRemoteCommitProvider.HostAddress extends Object
Utility class to store an InetAddress and an int. Not using InetSocketAddress because it's a JDK1.4 API. This also provides a wrapper around the socket(s) associated with this address.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
TCPRemoteCommitProvider.HostAddress.SocketPoolableObjectFactory
Factory for pooled sockets.
-
Field Summary
Fields Modifier and Type Field Description protected InetAddress
_address
protected int
_infosIssued
protected boolean
_isAvailable
protected int
_port
protected org.apache.commons.pool2.impl.GenericObjectPool<Socket>
_socketPool
protected long
_timeLastError
-
Constructor Summary
Constructors Constructor Description HostAddress(String host)
Construct a new host address from a string of the form "host:port" or of the form "host".
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
clearAllSockets()
void
close()
protected void
closeSocket(Socket s)
boolean
equals(Object obj)
InetAddress
getAddress()
int
getPort()
protected Socket
getSocket()
int
hashCode()
protected void
returnSocket(Socket s)
protected void
sendUpdatePacket(byte[] bytes)
protected void
setMaxIdle(int maxIdle)
protected void
setMaxTotal(int maxTotal)
-
-
-
Field Detail
-
_address
protected InetAddress _address
-
_port
protected int _port
-
_timeLastError
protected long _timeLastError
-
_isAvailable
protected boolean _isAvailable
-
_infosIssued
protected int _infosIssued
-
_socketPool
protected final org.apache.commons.pool2.impl.GenericObjectPool<Socket> _socketPool
-
-
Constructor Detail
-
HostAddress
public HostAddress(String host) throws UnknownHostException
Construct a new host address from a string of the form "host:port" or of the form "host".- Parameters:
host
- host name- Throws:
UnknownHostException
-
-
Method Detail
-
setMaxTotal
protected void setMaxTotal(int maxTotal)
-
setMaxIdle
protected void setMaxIdle(int maxIdle)
-
getAddress
public InetAddress getAddress()
-
getPort
public int getPort()
-
close
public void close()
-
sendUpdatePacket
protected void sendUpdatePacket(byte[] bytes)
-
clearAllSockets
protected void clearAllSockets()
-
closeSocket
protected void closeSocket(Socket s)
-
-