Hi Charles,
First, you can find the source code for all vinci things in the Apache
UIMA project - both in individual source releases, and in the SVN
itself. There are links on the incubator.apache.org/uima home page on
the left to the source.
There are two parts to Vinci. One part is the stand-alone vinci
name-server. The part you are talking about is the vinci service
wrapper - that is used to wrap a UIMA annotator and make it into a Vinci
service.
The code for this wrapper is in uimaj-adapter-vinci project in the SVN.
In there, you will find in class VinciAnalysisEngineService_impl, a
method, "eval". It's javadoc says:
/**
* Main method called by the Vinci Service Layer. All requests coming
in from clients go through
* this method. Each request comes in as a VinciFrame and is expected
to contain a valid
* VINCI:COMMAND. Currently, two such operations are supported: 1)
Annotate - triggers document
* analysis 2) GetData - triggers return of the AE meta data ( descriptor)
*
* @param [EMAIL PROTECTED] org.apache.vinci.transport.Transportable} -
* a VinciFrame containing client request
* @return [EMAIL PROTECTED] org.apache.vinci.transport.Transportable} - a
VinciFrame containg result of
* performing the service
*/
If you look at the implementation code itself, you will see that, in
addition to what the javadoc says, it looks for a
"Shutdown" command, and if received, terminates the JVM:
. . .
else if (Constants.SHUTDOWN.equals(op)) {
stop();
System.exit(1);
There is code to send this command in the Vinci Proxy at the client.
When the Collection Processing Complete method is called in the
framework, it actually calls the VinciTAP class's method to shutdown.
However, it currently passes a flag to bypass the sending of the
shutdown message for external remote services, on the presumption that
these services might be in use by other clients.
You might want to have a short method that you write that does something
like this:
1) from your CPE, get a list of the Cas Processors
2) For each Cas Processor, see if it is of the Vinci TAP kind (this
means it is implemented as a proxy to a remote vinci service, using the
class VinciTAP).
3) for all those, call its shutdown method, passing *true* as the first
argument. The second argument appears to allow sending a collection
processing complete message to the service, or not.
For example, once you have a valid reference to a cas processor, you
could write:
// warning: untested code - but you get the idea :-)
if ( casProcessor instanceof NetworkCasProcessorImpl ) {
VinciTAP vinciTextAnalysisProxy =
((NetworkCasProcessorImpl )casProcessor).getProxy();
vinciTextAnalysisProxy.shutdown(true, true-or-false);
// second argument controls sending
// collection processing complete or not
}
-Marshall
Charles Proefrock wrote:
Still no luck finding anything useful on the web to address this question. The
only hits I get are for a May 2001 paper on Vinci.
Any help would be appreciated (especially regarding VinciServer.shutdown() ... or where to find the javadocs or source so I can look into it myself ...)
Thanks,
Charles
From: [EMAIL PROTECTED]> To: [email protected]> Subject: Shutdown Vinci Server & Child AE> Date: Wed,
12 Mar 2008 17:15:19 -0400> > When I run an example UIMA Vinci Server I can use Ctrl-C to terminate the running process.
When I use Ctrl-C the stdout indicates that VinciServer.shutdown() is called. Two questions:> > (1) Is there a
graceful/programatic way to signal the shutdown of a [remote] Vinci Server?> (2) When VinciServer.shutdown() is called, does
it call a method on the child AE (such as destroy() ) to gracefully perform cleanup operations? (Similar to the call to
destroy() when run integrated in a CPM)> > Thanks,> > Charles>
_________________________________________________________________> Shed those extra pounds with MSN and The Biggest
Loser!> http://biggestloser.msn.com/
_________________________________________________________________
In a rush? Get real-time answers with Windows Live Messenger.
http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_realtime_042008