You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by to...@apache.org on 2009/01/05 01:43:41 UTC

svn commit: r731395 - in /incubator/uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver: Service.java servlet/SimpleServerServlet.java

Author: tongfin
Date: Sun Jan  4 16:43:41 2009
New Revision: 731395

URL: http://svn.apache.org/viewvc?rev=731395&view=rev
Log:
[UIMA-1260] Expose some "private" variables and method as "protected" so that new subclasses for UIMA-AS can be defined

Modified:
    incubator/uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/Service.java
    incubator/uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/SimpleServerServlet.java

Modified: incubator/uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/Service.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/Service.java?rev=731395&r1=731394&r2=731395&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/Service.java (original)
+++ incubator/uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/Service.java Sun Jan  4 16:43:41 2009
@@ -72,13 +72,13 @@
 
   private AnalysisEngine ae = null;
 
-  private CAS cas = null;
+  protected CAS cas = null;
 
-  private ServerSpec serviceSpec = null;
+  protected ServerSpec serviceSpec = null;
 
-  private ResultExtractor resultExtractor = null;
+  protected ResultExtractor resultExtractor = null;
 
-  private volatile boolean initialized = false;
+  protected volatile boolean initialized = false;
 
   /**
    * Default constructor.
@@ -147,7 +147,7 @@
     configure(serviceSpecFile);
   }
 
-  private void configure(File serviceSpecFile) throws IOException, SimpleServerException,
+  protected void configure(File serviceSpecFile) throws IOException, SimpleServerException,
       XmlException {
     if (serviceSpecFile == null) {
       this.serviceSpec = ConfigFactory.newServerSpec(noDescriptionProvided, noDescriptionProvided,
@@ -159,7 +159,7 @@
     this.initialized = true;
   }
 
-  private final void logInitializationError() {
+  protected final void logInitializationError() {
     // TODO: log which service could not be initialized!!!!!!!!!!!!!!!!!
     SimpleServerException e = new SimpleServerException(
         SimpleServerException.service_state_exception, new Object[] {});
@@ -242,6 +242,8 @@
   /**
    * Calls the services analysis engine on the input text, filters and produces the result.
    */
+  // If UIMA-AS is included as an ADD-ON to SimpleServer and UIMA-AS servlet 
+  // is invoked, UIMA-AS (UimaAsService) will override this method
   public synchronized Result process(String text, String lang) {
     // Check that service has been initialized.
     if (!this.initialized) {

Modified: incubator/uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/SimpleServerServlet.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/SimpleServerServlet.java?rev=731395&r1=731394&r2=731395&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/SimpleServerServlet.java (original)
+++ incubator/uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/SimpleServerServlet.java Sun Jan  4 16:43:41 2009
@@ -55,7 +55,9 @@
 
   public Service server = null;
 
-  private boolean initializationSuccessful = false;
+  // If UIMA-AS is included as an ADD-ON to SimpleServer and UIMA-AS servlet 
+  // is invoked, UIMA-AS servlet will set this flag
+  protected boolean initializationSuccessful = false;
 
   private Logger logger = Logger.getAnonymousLogger();
 
@@ -241,6 +243,8 @@
     this.initializationSuccessful = true;
   }
 
+  // If UIMA-AS is included as an ADD-ON to SimpleServer and UIMA-AS servlet 
+  // is invoked, UIMA-AS servlet will override this method
   protected boolean initServer() {
     File resultSpec = null;
     String resultSpecParamValue = getInitParameter("ResultSpecFile");