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.
- Since:
- 0.2.5.0
- Author:
- Brian Leair, Patrick Linskey
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classFactory for pooled sockets. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InetAddressprotected intprotected booleanprotected intprotected final org.apache.commons.pool2.impl.GenericObjectPool<Socket> protected long -
Constructor Summary
ConstructorsConstructorDescriptionHostAddress(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 voidvoidclose()protected voidbooleanintgetPort()protected SocketinthashCode()protected voidprotected voidsendUpdatePacket(byte[] bytes) protected voidsetMaxIdle(int maxIdle) protected voidsetMaxTotal(int maxTotal) toString()
-
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
-
returnSocket
-
clearAllSockets
protected void clearAllSockets() -
closeSocket
-
hashCode
-
equals
-
toString
-