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 java.lang.ObjectUtility 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 classTCPRemoteCommitProvider.HostAddress.SocketPoolableObjectFactoryFactory for pooled sockets.
-
Field Summary
Fields Modifier and Type Field Description protected java.net.InetAddress_addressprotected int_infosIssuedprotected boolean_isAvailableprotected int_portprotected org.apache.commons.pool2.impl.GenericObjectPool<java.net.Socket>_socketPoolprotected long_timeLastError
-
Constructor Summary
Constructors Constructor Description HostAddress(java.lang.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 voidclearAllSockets()voidclose()protected voidcloseSocket(java.net.Socket s)booleanequals(java.lang.Object obj)java.net.InetAddressgetAddress()intgetPort()protected java.net.SocketgetSocket()inthashCode()protected voidreturnSocket(java.net.Socket s)protected voidsendUpdatePacket(byte[] bytes)protected voidsetMaxIdle(int maxIdle)protected voidsetMaxTotal(int maxTotal)
-
-
-
Field Detail
-
_address
protected java.net.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<java.net.Socket> _socketPool
-
-
Method Detail
-
setMaxTotal
protected void setMaxTotal(int maxTotal)
-
setMaxIdle
protected void setMaxIdle(int maxIdle)
-
getAddress
public java.net.InetAddress getAddress()
-
getPort
public int getPort()
-
close
public void close()
-
sendUpdatePacket
protected void sendUpdatePacket(byte[] bytes)
-
getSocket
protected java.net.Socket getSocket() throws java.lang.Exception- Throws:
java.lang.Exception
-
returnSocket
protected void returnSocket(java.net.Socket s) throws java.lang.Exception- Throws:
java.lang.Exception
-
clearAllSockets
protected void clearAllSockets()
-
closeSocket
protected void closeSocket(java.net.Socket s)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-