uima-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r1041594 - in /uima/uima-as/trunk: uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/client/ uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/service/ uimaj-as-core/src/main/java/org/apache/uima/aae/controller/ uimaj-as...
Date Thu, 02 Dec 2010 21:38:09 GMT
Author: schor
Date: Thu Dec  2 21:38:08 2010
New Revision: 1041594

URL: http://svn.apache.org/viewvc?rev=1041594&view=rev
Log:
change to use static methods in UimaAsVersion.  This is consistent with usage in uimaj-core.
Change 2 places where check is made for compatibility between uimaj core version and uima-as.
 Change message in service to report version of uima-as, not of uimaj core (in case they are
different). Change log message to be more precise when versions not OK.

Modified:
    uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngine_impl.java
    uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/service/UIMA_Service.java
    uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java
    uima/uima-as/trunk/uimaj-as-core/src/main/resources/uimaee_messages.properties
    uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/apache/uima/aae/UimaAsVersion.java

Modified: uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngine_impl.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngine_impl.java?rev=1041594&r1=1041593&r2=1041594&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngine_impl.java
(original)
+++ uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngine_impl.java
Thu Dec  2 21:38:08 2010
@@ -77,6 +77,7 @@ import org.apache.uima.adapter.jms.servi
 import org.apache.uima.analysis_engine.AnalysisEngineDescription;
 import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData;
 import org.apache.uima.cas.CAS;
+import org.apache.uima.impl.UimaVersion;
 import org.apache.uima.internal.util.UUIDGenerator;
 import org.apache.uima.resource.Resource;
 import org.apache.uima.resource.ResourceConfigurationException;
@@ -120,8 +121,6 @@ public class BaseUIMAAsynchronousEngine_
 
   private Object connectionMux = new Object();
 
-  private static final UimaAsVersion uimaAsVersion = new UimaAsVersion();
-
   protected InitialContext jndiContext;
   
   private ObjectName clientJmxObjectName = null;
@@ -538,20 +537,20 @@ public class BaseUIMAAsynchronousEngine_
    */
   public synchronized void initialize(Map anApplicationContext)
           throws ResourceInitializationException {
-    // Check UIMA AS version againg the UIMA Core version. If not the same throw Exception
-    if (!uimaAsVersion.getVersionString().equals(UIMAFramework.getVersionString())) {
+    // Check the version of uimaj that UIMA AS was built with, against the UIMA Core version.
If not the same throw Exception
+    if (!UimaAsVersion.getUimajFullVersionString().equals(UimaVersion.getFullVersionString()))
{
       UIMAFramework.getLogger(CLASS_NAME).logrb(
               Level.WARNING,
-              CLASS_NAME.getName(),
-              "BaseAnalysisEngineController",
+              CLASS_NAME.getName(), 
+              "initialize",
               UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
               "UIMAEE_incompatible_version_WARNING",
-              new Object[] { "UIM AS Client", uimaAsVersion.getVersionString(),
-                  UIMAFramework.getVersionString() });
+              new Object[] { "UIMA AS Client", UimaAsVersion.getUimajFullVersionString(),
+                UimaVersion.getFullVersionString() });
       throw new ResourceInitializationException(new AsynchAEException(
-              "Version of UIMA-AS is Incompatible with a Version of UIMA Core. UIMA-AS Version:"
-                      + uimaAsVersion.getVersionString() + " Core UIMA Version:"
-                      + UIMAFramework.getVersionString()));
+              "Version of UIMA-AS is Incompatible with a Version of UIMA Core. UIMA-AS Version
is built to depend on Core UIMA version:"
+                      + UimaAsVersion.getUimajFullVersionString() + " but is running with
version:"
+                      + UimaVersion.getFullVersionString()));
     }
 
     if (running) {

Modified: uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/service/UIMA_Service.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/service/UIMA_Service.java?rev=1041594&r1=1041593&r2=1041594&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/service/UIMA_Service.java
(original)
+++ uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/service/UIMA_Service.java
Thu Dec  2 21:38:08 2010
@@ -28,6 +28,7 @@ import java.net.Socket;
 import org.apache.uima.UIMAFramework;
 import org.apache.uima.UimaContext;
 import org.apache.uima.UimaContextAdmin;
+import org.apache.uima.aae.UimaAsVersion;
 import org.apache.uima.aae.controller.AnalysisEngineController;
 import org.apache.uima.aae.jmx.monitor.BasicUimaJmxMonitorListener;
 import org.apache.uima.aae.jmx.monitor.JmxMonitor;
@@ -65,7 +66,7 @@ public class UIMA_Service implements App
    */
   public String[] initialize(String[] args) throws Exception {
     UIMAFramework.getLogger(CLASS_NAME).log(Level.INFO,
-            "UIMA-AS version " + UIMAFramework.getVersionString());
+            "UIMA-AS version " + UimaAsVersion.getFullVersionString());
 
     String[] springConfigFileArray = {};
     String[] deploymentDescriptors = {};

Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java?rev=1041594&r1=1041593&r2=1041594&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java
(original)
+++ uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java
Thu Dec  2 21:38:08 2010
@@ -92,6 +92,7 @@ import org.apache.uima.analysis_engine.m
 import org.apache.uima.analysis_engine.metadata.SofaMapping;
 import org.apache.uima.cas.CAS;
 import org.apache.uima.collection.CollectionReaderDescription;
+import org.apache.uima.impl.UimaVersion;
 import org.apache.uima.jcas.cas.StringArray;
 import org.apache.uima.resource.Resource;
 import org.apache.uima.resource.ResourceCreationSpecifier;
@@ -325,20 +326,20 @@ public abstract class BaseAnalysisEngine
     resourceSpecifier = UimaClassFactory.produceResourceSpecifier(aDescriptor);
 
     if (isTopLevelComponent()) {
-      // Check UIMA AS version againg the UIMA Core version. If not the same throw Exception
-      if (!uimaAsVersion.getVersionString().equals(UIMAFramework.getVersionString())) {
+      // Check the version of uimaj that UIMA AS was built with, against the UIMA Core version.
If not the same throw Exception
+      if (!UimaAsVersion.getUimajFullVersionString().equals(UimaVersion.getFullVersionString()))
{
         UIMAFramework.getLogger(CLASS_NAME).logrb(
-                Level.INFO,
+                Level.WARNING,
                 CLASS_NAME.getName(),
                 "BaseAnalysisEngineController",
                 UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                 "UIMAEE_incompatible_version_WARNING",
-                new Object[] { getComponentName(), uimaAsVersion.getVersionString(),
-                    UIMAFramework.getVersionString() });
+                new Object[] { "UIMA AS Client", UimaAsVersion.getUimajFullVersionString(),
+                  UimaVersion.getFullVersionString() });
         throw new ResourceInitializationException(new AsynchAEException(
-                "Version of UIMA-AS is Incompatible with a Version of UIMA Core. UIMA-AS
Version:"
-                        + uimaAsVersion.getVersionString() + " Core UIMA Version:"
-                        + UIMAFramework.getVersionString()));
+                "Version of UIMA-AS is Incompatible with a Version of UIMA Core. UIMA-AS
Version is built to depend on Core UIMA version:"
+                        + UimaAsVersion.getUimajFullVersionString() + " but is running with
version:"
+                        + UimaVersion.getFullVersionString()));
       }
       logPlatformInfo(getComponentName());
     } else {

Modified: uima/uima-as/trunk/uimaj-as-core/src/main/resources/uimaee_messages.properties
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/resources/uimaee_messages.properties?rev=1041594&r1=1041593&r2=1041594&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-core/src/main/resources/uimaee_messages.properties (original)
+++ uima/uima-as/trunk/uimaj-as-core/src/main/resources/uimaee_messages.properties Thu Dec
 2 21:38:08 2010
@@ -221,7 +221,7 @@ UIMAEE_returning_exception_to_client__FI
 UIMAEE_sending_reply_to_client__FINE= Controller: {0} Sending Reply Containing CAS: {1} To
Client: {2}
 UIMAEE_add_endpoint_to_do_not_process_list__INFO= Controller: {0} Adding Endpoint: {1} to
the Do Not Process List.
 UIMAEE_dropping_msg_client_is_dead__INFO= Controller: {0} Received a Message From a Client
That Is No Longer Reachable. Its Reply Queue: {1} Has Been Removed. Dropping Message With
CAS Id: {2}
-UIMAEE_incompatible_version_WARNING = Controller: {0} Unable to Initialize. UIMA-AS Version
is Incompatible with UIMA Core. UIMA-AS Version: {1} UIMA Core Version: {2}
+UIMAEE_incompatible_version_WARNING = Controller: {0} Unable to Initialize. UIMA-AS Version
is Incompatible with UIMA Core. UIMA-AS Version built to depend on UIMA Core version: {1}
but is running with UIMA Core Version: {2}
 UIMAEE_multiple_deployment_not_allowed__WARNING = Controller: {0} Multiple Deployment of
AE: {1} Is Not Allowed. Change OperationalProperties in the AE descriptor or remove scalout
parameter from the deployment descriptor
 UIMAEE_invalid_step__SEVERE = Controller: {0} Invalid Step Object: {1} For CAS:{2}. Terminating
Service. Check Your Descriptor For Invalid AE Keys.
 UIMAEE_dump_threadpool_semaphore_info__FINEST = Time: {0} Thread Id: {1} Acquiring Executor
Semaphore. {2} Current Available Permits= {3}

Modified: uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/apache/uima/aae/UimaAsVersion.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/apache/uima/aae/UimaAsVersion.java?rev=1041594&r1=1041593&r2=1041594&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/apache/uima/aae/UimaAsVersion.java
(original)
+++ uima/uima-as/trunk/uimaj-as-core/src/main/versionJava/org/apache/uima/aae/UimaAsVersion.java
Thu Dec  2 21:38:08 2010
@@ -30,7 +30,7 @@ public class UimaAsVersion {
    * 
    * @return the major version number
    */
-  public short getMajorVersion() {
+  public static short getMajorVersion() {
     return ${parsedVersion.majorVersion}; // major version
   }
 
@@ -39,7 +39,7 @@ public class UimaAsVersion {
    * 
    * @return the minor version number
    */
-  public short getMinorVersion() {
+  public static short getMinorVersion() {
     return ${parsedVersion.minorVersion}; // minor version
   }
 
@@ -48,11 +48,25 @@ public class UimaAsVersion {
    * 
    * @return the build revision number
    */
-  public short getBuildRevision() {
+  public static short getBuildRevision() {
     return ${parsedVersion.incrementalVersion}; // build revision
   }
 
-  public String getVersionString() {
+  public static String getVersionString() {
     return "" + getMajorVersion() + "." + getMinorVersion() + "." + getBuildRevision();
   }
+  
+  /**
+   * @return the build version, including any suffixes, as a String
+   */
+  public static String getFullVersionString() {
+    return "${project.version}";
+  }
+  
+  /**
+   * @return the build version of uimaj that this build depends on, as a String
+   */
+  public static String getUimajFullVersionString() {
+    return "${uimajDependencyVersion}"; // e.g. 2.3.1-SNAPSHOT
+  }
 }



Mime
View raw message