com.jpeterson.x10server
Class X10ServerSocketObjectPool

java.lang.Object
  |
  +--com.jpeterson.pool.ObjectPool
        |
        +--com.jpeterson.pool.SocketObjectPool
              |
              +--com.jpeterson.x10server.X10ServerSocketObjectPool

public class X10ServerSocketObjectPool
extends SocketObjectPool

A pool of Socket's for X10Server's


Fields inherited from class com.jpeterson.pool.SocketObjectPool
address, port
 
Fields inherited from class com.jpeterson.pool.ObjectPool
DEFAULT_EXPIRATION, locked, unlocked
 
Constructor Summary
X10ServerSocketObjectPool(java.net.InetAddress address, int port)
          Create an object pool of Socket's for the specified address and port.
X10ServerSocketObjectPool(java.net.InetAddress address, int port, long expiration)
          Create an object pool of Socket's for the specified address and port with the specified expiration.
X10ServerSocketObjectPool(java.lang.String hostname, int port)
          Create an object pool of Socket's for the specified hostname and port.
X10ServerSocketObjectPool(java.lang.String hostname, int port, long expiration)
          Create an object pool of Socket's for the specified hostname and port with the specified expiration.
 
Method Summary
protected  java.lang.Object create()
          Create a new instance of a Socket.
protected  boolean validate(java.lang.Object o)
          Make sure that the X10Server is still there.
 
Methods inherited from class com.jpeterson.pool.SocketObjectPool
borrowObject, expire, returnBrokenObject, returnObject
 
Methods inherited from class com.jpeterson.pool.ObjectPool
broken, checkIn, checkOut, getExpiration, setExpiration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

X10ServerSocketObjectPool

public X10ServerSocketObjectPool(java.lang.String hostname,
                                 int port)
                          throws java.net.UnknownHostException
Create an object pool of Socket's for the specified hostname and port. Expiration is set to the default value.
Parameters:
hostname - Host name or IP address for sockets in the pool.
port - Port for sockets in the pool.

X10ServerSocketObjectPool

public X10ServerSocketObjectPool(java.lang.String hostname,
                                 int port,
                                 long expiration)
                          throws java.net.UnknownHostException
Create an object pool of Socket's for the specified hostname and port with the specified expiration.
Parameters:
hostname - Host name or IP address for sockets in the pool.
port - Port for sockets in the pool.
expiration - Expiration in milliseconds for sockets in the pool.

X10ServerSocketObjectPool

public X10ServerSocketObjectPool(java.net.InetAddress address,
                                 int port)
Create an object pool of Socket's for the specified address and port. Expiration is set to the default value.
Parameters:
address - Address for sockets in the pool.
port - Port for sockets in the pool.

X10ServerSocketObjectPool

public X10ServerSocketObjectPool(java.net.InetAddress address,
                                 int port,
                                 long expiration)
Create an object pool of Socket's for the specified address and port with the specified expiration.
Parameters:
address - Address for sockets in the pool.
port - Port for sockets in the pool.
expiration - Expiration in milliseconds for sockets in the pool.
Method Detail

create

protected java.lang.Object create()
Create a new instance of a Socket.
Overrides:
create in class SocketObjectPool
Returns:
A new instance of a Socket or null if unable to create one.

validate

protected boolean validate(java.lang.Object o)
Make sure that the X10Server is still there.
Overrides:
validate in class SocketObjectPool
Returns:
Always returns true.