You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2012/08/28 16:51:23 UTC
svn commit: r1378154 - in /uima/uima-as/trunk:
uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/
uimaj-as-activemq/src/test/resources/deployment/
uimaj-as-core/src/main/java/org/apache/uima/aae/controller/
Author: cwiklik
Date: Tue Aug 28 14:51:22 2012
New Revision: 1378154
URL: http://svn.apache.org/viewvc?rev=1378154&view=rev
Log:
UIMA-2461 Support deployment of uima aggregate CM. Add new test case.
Added:
uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/deployment/Deploy_ComplexAggregateWithInnerUimaAggregateCM.xml (with props)
Modified:
uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
Modified: uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java?rev=1378154&r1=1378153&r2=1378154&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java (original)
+++ uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java Tue Aug 28 14:51:22 2012
@@ -1923,6 +1923,14 @@ public class TestUimaASExtended extends
runTest(null, eeUimaEngine, String.valueOf(broker.getMasterConnectorURI()), "TopLevelTaeQueue",
1, PROCESS_LATCH);
}
+ public void testAggregateWithInnerSynchAggregateCM() throws Exception {
+ System.out.println("-------------- testAggregateWithInnerSynchAggregateCM() -------------");
+ BaseUIMAAsynchronousEngine_impl eeUimaEngine = new BaseUIMAAsynchronousEngine_impl();
+ System.setProperty(JmsConstants.SessionTimeoutOverride, "2500000");
+ deployService(eeUimaEngine, relativePath + "/Deploy_ComplexAggregateWithInnerUimaAggregateCM.xml");
+ runTest(null, eeUimaEngine, String.valueOf(broker.getMasterConnectorURI()), "TopLevelTaeQueue",
+ 10, PROCESS_LATCH);
+ }
/**
* Tests exception thrown in the Uima EE Client when the Collection Reader is added after the uima
Added: uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/deployment/Deploy_ComplexAggregateWithInnerUimaAggregateCM.xml
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/deployment/Deploy_ComplexAggregateWithInnerUimaAggregateCM.xml?rev=1378154&view=auto
==============================================================================
--- uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/deployment/Deploy_ComplexAggregateWithInnerUimaAggregateCM.xml (added)
+++ uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/deployment/Deploy_ComplexAggregateWithInnerUimaAggregateCM.xml Tue Aug 28 14:51:22 2012
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!--
+ ***************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ***************************************************************
+ -->
+
+<analysisEngineDeploymentDescription xmlns="http://uima.apache.org/resourceSpecifier">
+
+ <name>Top Level TAE</name>
+ <description></description>
+
+ <deployment protocol="jms" provider="activemq">
+ <casPool numberOfCASes="5"/>
+ <service>
+ <inputQueue endpoint="TopLevelTaeQueue" brokerURL="${DefaultBrokerURL}" prefetch="1"/>
+ <topDescriptor>
+ <import location="../descriptors/analysis_engine/ComplexAggregateWithInnerAggregateCM.xml"/>
+ </topDescriptor>
+ <analysisEngine>
+ <delegates>
+
+ <analysisEngine key="TestMultiplier">
+ <casMultiplier poolSize="5"/>
+ </analysisEngine>
+
+ <analysisEngine key="MeetingDetectorAggregate" async="false">
+ <casMultiplier poolSize="1" initialFsHeapSize="20000" />
+ <asyncAggregateErrorConfiguration>
+ <getMetadataErrors maxRetries="0" timeout="60000" errorAction="terminate"/>
+ <processCasErrors maxRetries="0" timeout="0" continueOnRetryFailure="false" thresholdCount="0" thresholdWindow="0" thresholdAction="terminate"/>
+ <collectionProcessCompleteErrors timeout="0" additionalErrorAction="terminate"/>
+ </asyncAggregateErrorConfiguration>
+ </analysisEngine>
+
+ </delegates>
+ </analysisEngine>
+ </service>
+ </deployment>
+
+</analysisEngineDeploymentDescription>
Propchange: uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/deployment/Deploy_ComplexAggregateWithInnerUimaAggregateCM.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java?rev=1378154&r1=1378153&r2=1378154&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java (original)
+++ uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java Tue Aug 28 14:51:22 2012
@@ -49,12 +49,14 @@ import org.apache.uima.aae.monitor.stati
import org.apache.uima.aae.spi.transport.UimaMessage;
import org.apache.uima.aae.spi.transport.UimaTransport;
import org.apache.uima.analysis_engine.AnalysisEngine;
+import org.apache.uima.analysis_engine.AnalysisEngineDescription;
import org.apache.uima.analysis_engine.AnalysisEngineManagement;
import org.apache.uima.analysis_engine.CasIterator;
import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData;
import org.apache.uima.cas.CAS;
import org.apache.uima.cas.impl.CASImpl;
import org.apache.uima.cas.impl.OutOfTypeSystemData;
+import org.apache.uima.collection.CollectionReaderDescription;
import org.apache.uima.resource.ResourceInitializationException;
import org.apache.uima.resource.ResourceSpecifier;
import org.apache.uima.resource.metadata.ConfigurationParameter;
@@ -382,9 +384,16 @@ public class PrimitiveAnalysisEngineCont
// MBeans to register during initialization of the service. For a Cas Multiplier
// force creation of the Cas Pool and registration of a Cas Pool with the JMX Server.
// Just get the CAS and release it back to the component's Cas Pool.
- if (isCasMultiplier() && !isTopLevelComponent()) {
- CAS cas = (CAS) getUimaContext().getEmptyCas(CAS.class);
- cas.release();
+ if (isCasMultiplier() && !isTopLevelComponent() ) {
+ boolean isUimaAggregate = false;
+ if ( !(resourceSpecifier instanceof CollectionReaderDescription) ) {
+ // determine if this AE is a UIMA aggregate
+ isUimaAggregate = ((AnalysisEngineDescription) resourceSpecifier).isPrimitive() == false ? true : false;
+ }
+ if ( !isUimaAggregate ) { // !uima core aggregate CM
+ CAS cas = (CAS) getUimaContext().getEmptyCas(CAS.class);
+ cas.release();
+ }
}
}