public class LocalVNS extends VinciServableAdapter implements Runnable
| Constructor and Description |
|---|
LocalVNS() |
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 |
|---|---|
Transportable |
eval(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
|
cleanExit, makeTransportablepublic 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 onPortUnreachableExceptionpublic 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 Transportable eval(Transportable in) throws ServiceException
eval in interface VinciServableeval in class VinciServableAdapterin - The input documentServiceException - thrown when there is an application level error that should result in the client
receiving the same ServiceException on the other end.public void shutdown()
protected void finalize()
throws Throwable
Copyright © 2018. All rights reserved.