Package org.apache.openjpa.event
Class TCPRemoteCommitProvider.HostAddress
java.lang.Object
org.apache.openjpa.event.TCPRemoteCommitProvider.HostAddress
- Enclosing class:
- TCPRemoteCommitProvider
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
Modifier and TypeClassDescriptionprotected class
Factory for pooled sockets. -
Field Summary
Modifier and TypeFieldDescriptionprotected InetAddress
protected int
protected boolean
protected int
protected final org.apache.commons.pool2.impl.GenericObjectPool<Socket>
protected long
-
Constructor Summary
ConstructorDescriptionHostAddress
(String host) Construct a new host address from a string of the form "host:port" or of the form "host". -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
close()
protected void
boolean
int
getPort()
protected Socket
int
hashCode()
protected void
protected void
sendUpdatePacket
(byte[] bytes) protected void
setMaxIdle
(int maxIdle) protected void
setMaxTotal
(int maxTotal)
-
Field Details
-
_address
-
_port
protected int _port -
_timeLastError
protected long _timeLastError -
_isAvailable
protected boolean _isAvailable -
_infosIssued
protected int _infosIssued -
_socketPool
-
-
Constructor Details
-
HostAddress
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 Details
-
setMaxTotal
protected void setMaxTotal(int maxTotal) -
setMaxIdle
protected void setMaxIdle(int maxIdle) -
getAddress
-
getPort
public int getPort() -
close
public void close() -
sendUpdatePacket
protected void sendUpdatePacket(byte[] bytes) -
getSocket
- Throws:
Exception
-
returnSocket
- Throws:
Exception
-
clearAllSockets
protected void clearAllSockets() -
closeSocket
-
hashCode
public int hashCode() -
equals
-