public class LocalVNS extends org.apache.vinci.transport.VinciServableAdapter implements Runnable
| Constructor and Description |
|---|
LocalVNS()
Instantiates a new local VNS.
|
LocalVNS(int aStartPort,
int aEndPort,
int aVNSPort)
Initialize local VNS instance with a range of ports, and the port for the VNS itself.
|
LocalVNS(String aStartPort,
String aEndPort,
String aVNSPort)
Instantiates Local Vinci Naming Service.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.vinci.transport.Transportable |
eval(org.apache.vinci.transport.Transportable in)
Main method called by services advertising their availability.
|
protected void |
finalize() |
int |
getPort()
Returns the next available port.
|
int |
getVNSPort()
Returns the port number on which local VNS is listening for requests.
|
boolean |
isAvailable(int port)
Determines if a given port is free.
|
void |
run()
Starts VNS thread.
|
void |
setConnectionPool(BoundedWorkQueue pQueue)
Associates a port pool with instance of VNS.
|
void |
shutdown()
Stop the VNS service.
|
public LocalVNS()
public LocalVNS(String aStartPort, String aEndPort, String aVNSPort) throws PortUnreachableException
aStartPort - -
a starting port # for clients (services)aEndPort - -
an ending port # for clients( services)aVNSPort - -
port on which this VNS will listen onPortUnreachableException - the port unreachable exceptionpublic LocalVNS(int aStartPort,
int aEndPort,
int aVNSPort)
throws PortUnreachableException
aStartPort - -
starting port number usedaEndPort - -
end port number. Together with StartPort defines the range of ports (port pool)aVNSPort - -
port on which this VNS will listen for requestsPortUnreachableException - unreachable port after retriespublic void setConnectionPool(BoundedWorkQueue pQueue)
pQueue - -
queue where allocated ports will be addedpublic boolean isAvailable(int port)
port - number to checkpublic int getVNSPort()
public int getPort()
throws PortUnreachableException
PortUnreachableException - can't get port in configured rangepublic org.apache.vinci.transport.Transportable eval(org.apache.vinci.transport.Transportable in)
throws org.apache.vinci.transport.ServiceException
eval in interface org.apache.vinci.transport.VinciServableeval in class org.apache.vinci.transport.VinciServableAdapterin - the inorg.apache.vinci.transport.ServiceException - the service exceptionpublic void shutdown()
protected void finalize()
throws Throwable
Copyright © 2006–2017 The Apache Software Foundation. All rights reserved.