public class LocalVNS extends VinciServableAdapter implements java.lang.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(java.lang.String aStartPort,
java.lang.String aEndPort,
java.lang.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(java.lang.String aStartPort,
java.lang.String aEndPort,
java.lang.String aVNSPort)
throws java.net.PortUnreachableException
aProcessor - -
CASProcessor instantiating this VNS (the owner)aStartPort - -
a starting port # for clients (services)aEndPort - -
an ending port # for clients( services)aVNSPort - -
port on which this VNS will listen onjava.net.PortUnreachableExceptionpublic LocalVNS(int aStartPort,
int aEndPort,
int aVNSPort)
throws java.net.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 requestsjava.net.PortUnreachableExceptionpublic 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 java.net.PortUnreachableException
java.net.PortUnreachableExceptionpublic 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 java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic void run()
run in interface java.lang.RunnableCopyright © 2013. All Rights Reserved.