public class PortManager extends Object
| Constructor and Description |
|---|
PortManager(IniFile ini,
int clusterServerNumber)
Creates the listeners on the ports specified in [Port] section
in item 'portID'.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeClientListener()
Closes and disposes of the connection listener.
|
boolean |
closeClientListener(String name)
Closes and disposes of the connection listener.
|
boolean |
closeClientListener(String name,
boolean doRemove)
Closes and disposes of the connection listener.
|
boolean |
createClientListener(String name)
Create a port listener.
|
boolean |
createClientListenerEx(String name)
Create a port listener.
|
Transaction |
getAvailablePorts(Transaction trans)
Gets the ports available for load balancing.
|
Enumeration<SocketClientConnectionListener> |
getPorts()
Gets the ports enumeration (SocketClientConnectionListener instances).
|
int |
getPortState(String name)
Checks if the port state.
|
boolean |
isClosed(String name)
Checks if a port is started.
|
boolean |
isStarted(String name)
Checks if a port is started.
|
boolean |
isStopped(String name)
Checks if a port is started.
|
void |
startClientListener(ClientConnectionListener listener)
This method starts listening for connections.
|
void |
startClientListener(ClientConnectionListener listener,
int errorMessageID)
This method starts listening for connections.
|
boolean |
startClientListener(String name)
Starts listening for connections.
|
void |
stopClientListener()
Stops listening for connections.
|
boolean |
stopClientListener(String name)
Stops listening for connections.
|
public PortManager(IniFile ini, int clusterServerNumber) throws IOException
IOException - for listener creation error.public boolean createClientListenerEx(String name) throws IOException
IOException - for failures.public boolean createClientListener(String name)
public void startClientListener(ClientConnectionListener listener) throws IOException
IOException - if an I/O error occurs.public void startClientListener(ClientConnectionListener listener, int errorMessageID)
public boolean startClientListener(String name) throws IOException
IOException - if an I/O error occurs.public void stopClientListener()
public boolean stopClientListener(String name)
public void closeClientListener()
public boolean closeClientListener(String name)
public boolean closeClientListener(String name, boolean doRemove)
public int getPortState(String name)
name - the port ID name (it is made upper case).public boolean isStarted(String name)
public boolean isStopped(String name)
public boolean isClosed(String name)
public Transaction getAvailablePorts(Transaction trans)
public Enumeration<SocketClientConnectionListener> getPorts()
Note: You must be careful with NoSuchElementException when enumerating the elements because ports can be stopped/started and removed.
Phantom® and NetPhantom® are registered trademarks of Nexum Technologies SARL.
© Copyright Nexum Technologies SARL, 2011. All rights reserved.