Merge branch 'main' into feature/UIMA-6266-Clean-JSON-Wire-Format-for-CAS
* main:
[UIMA-6413] Memory leak in FSClassRegistry
[UIMA-6413] Memory leak in FSClassRegistry
[UIMA-6413] Memory leak in FSClassRegistry
[UIMA-6373] Format UIMA Core Java SDK codebase
diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSClassRegistry.java b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSClassRegistry.java
index 9223f96..5f4e918 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSClassRegistry.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSClassRegistry.java
@@ -19,6 +19,7 @@
package org.apache.uima.cas.impl;
+import static java.lang.invoke.MethodHandles.lookup;
import static java.lang.invoke.MethodType.methodType;
import java.lang.invoke.CallSite;
@@ -34,10 +35,12 @@
import java.lang.reflect.Modifier;
import java.lang.reflect.Parameter;
import java.util.ArrayList;
-// @formatter:off
import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import org.apache.uima.UIMAFramework;
import org.apache.uima.UIMARuntimeException;
@@ -112,6 +115,14 @@
public abstract class FSClassRegistry { // abstract to prevent instantiating; this class only has
// static methods
+ static final String RECORD_JCAS_CLASSLOADERS = "uima.record_jcas_classloaders";
+ static final boolean IS_RECORD_JCAS_CLASSLOADERS = Misc
+ .getNoValueSystemProperty(RECORD_JCAS_CLASSLOADERS);
+
+ static final String LOG_JCAS_CLASSLOADERS_ON_SHUTDOWN = "uima.log_jcas_classloaders_on_shutdown";
+ static final boolean IS_LOG_JCAS_CLASSLOADERS_ON_SHUTDOWN = Misc
+ .getNoValueSystemProperty(LOG_JCAS_CLASSLOADERS_ON_SHUTDOWN);
+
// private static final boolean IS_TRACE_AUGMENT_TS = false;
// private static final boolean IS_TIME_AUGMENT_FEATURES = false;
/* ========================================================= */
@@ -182,6 +193,7 @@
// @formatter:on
private static final WeakIdentityMap<ClassLoader, Map<String, JCasClassInfo>> cl_to_type2JCas = WeakIdentityMap
.newHashMap(); // identity: key is classloader
+ private static final WeakIdentityMap<ClassLoader, StackTraceElement[]> cl_to_type2JCasStacks;
// private static final Map<ClassLoader, Map<String, JCasClassInfo>> cl_4pears_to_type2JCas =
// Collections.synchronizedMap(new IdentityHashMap<>()); // identity: key is classloader
@@ -315,6 +327,22 @@
MutableCallSite.syncAll(sync);
reportErrors();
+
+ if (IS_LOG_JCAS_CLASSLOADERS_ON_SHUTDOWN || IS_RECORD_JCAS_CLASSLOADERS) {
+ cl_to_type2JCasStacks = WeakIdentityMap.newHashMap();
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ @Override
+ public void run() {
+ log_registered_classloaders(Level.WARN);
+ }
+ });
+ } else {
+ cl_to_type2JCasStacks = null;
+ }
+ }
+
+ static int clToType2JCasSize() {
+ return cl_to_type2JCas.size();
}
private static void loadBuiltins(TypeImpl ti, ClassLoader cl,
@@ -1099,8 +1127,9 @@
try {
for (Field f : jcasClass.getDeclaredFields()) {
String fname = f.getName();
- if (fname.length() <= 5 || !fname.startsWith("_FC_"))
+ if (fname.length() <= 5 || !fname.startsWith("_FC_")) {
continue;
+ }
String featName = fname.substring(4);
// compute range by looking at get method
@@ -1147,8 +1176,9 @@
private static void checkConformance(TypeSystemImpl ts, TypeImpl ti,
Map<String, JCasClassInfo> type2jcci) {
- if (ti.isPrimitive())
+ if (ti.isPrimitive()) {
return;
+ }
JCasClassInfo jcci = type2jcci.get(ti.getJCasClassName());
// if (null == jcci) {
@@ -1265,8 +1295,9 @@
for (Method m : clazz.getDeclaredMethods()) {
String mname = m.getName();
- if (mname.length() <= 3 || !mname.startsWith("get"))
+ if (mname.length() <= 3 || !mname.startsWith("get")) {
continue;
+ }
String suffix = (mname.length() == 4) ? "" : mname.substring(4); // one char past 1st letter
// of feature
String fname = Character.toLowerCase(mname.charAt(3)) + suffix; // entire name, with first
@@ -1276,8 +1307,9 @@
fname = mname.charAt(3) + suffix; // no feature, but look for one with captialized first
// letter
fi = ti.getFeatureByBaseName(fname);
- if (fi == null)
+ if (fi == null) {
continue;
+ }
}
// some users are writing getFeat(some other args) as additional signatures - skip checking
@@ -1286,8 +1318,9 @@
Parameter[] p = m.getParameters();
TypeImpl range = fi.getRangeImpl();
- if (p.length > 1)
+ if (p.length > 1) {
continue; // not a getter, which has either 0 or 1 arg(the index int for arrays)
+ }
if (p.length == 1 && (!range.isArray() || p[0].getType() != int.class)) {
continue; // has 1 arg, but is not an array or the arg is not an int
}
@@ -1327,8 +1360,9 @@
try {
for (Field f : clazz.getDeclaredFields()) {
String fname = f.getName();
- if (fname.length() <= 5 || !fname.startsWith("_FC_"))
+ if (fname.length() <= 5 || !fname.startsWith("_FC_")) {
continue;
+ }
String featName = fname.substring(4);
FeatureImpl fi = ti.getFeatureByBaseName(featName);
if (fi == null) {
@@ -1496,9 +1530,10 @@
private static boolean isAllNull(FsGenerator3[] r) {
for (FsGenerator3 v : r) {
- if (v != null)
+ if (v != null) {
return false;
- }
+ }
+ }
return true;
}
@@ -1587,6 +1622,78 @@
Misc.internalError(e); // never happen
}
}
+
+ /**
+ * For internal use only!
+ */
+ public static void unregister_jcci_classloader(ClassLoader cl) {
+ synchronized (cl_to_type2JCas) {
+ cl_to_type2JCas.remove(cl);
+ if (cl_to_type2JCasStacks != null) {
+ cl_to_type2JCasStacks.remove(cl);
+ }
+ }
+ }
+
+ /**
+ * For internal use only!
+ */
+ public static void log_registered_classloaders(Level aLogLevel) {
+ Logger log = UIMAFramework.getLogger(lookup().lookupClass());
+ if (cl_to_type2JCasStacks == null) {
+ log.warn(
+ "log_registered_classloaders called but classLoader registration stack logging "
+ + "is not turned on. Define the system property [{}] to enable it.",
+ LOG_JCAS_CLASSLOADERS_ON_SHUTDOWN);
+ return;
+ }
+
+ Map<ClassLoader, StackTraceElement[]> clToLog = new LinkedHashMap<>();
+ synchronized (cl_to_type2JCas) {
+ Iterator<ClassLoader> i = cl_to_type2JCas.keyIterator();
+ while (i.hasNext()) {
+ ClassLoader cl = i.next();
+ if (cl == TypeSystemImpl.staticTsi.getClass().getClassLoader()) {
+ // This is usually the default/system classloader and is registered when the
+ // TypeSystemImpl class is statically intialized. It is not interesting for leak
+ // detection.
+ continue;
+ }
+ StackTraceElement[] stack = cl_to_type2JCasStacks.get(cl);
+ if (stack == null) {
+ continue;
+ }
+ clToLog.put(cl, stack);
+ }
+ }
+
+ if (clToLog.isEmpty()) {
+ log.log(aLogLevel, "No classloaders except the system classloader registered.");
+ return;
+ }
+
+ StringBuilder buf = new StringBuilder();
+
+ if (aLogLevel.isGreaterOrEqual(Level.WARN)) {
+ buf.append("On shutdown, there were still " + clToLog.size()
+ + " classloaders registered in the FSClassRegistry. Not destroying "
+ + "ResourceManagers after usage can cause memory leaks.");
+ } else {
+ buf.append(
+ "There are " + clToLog.size() + " classloaders registered in the FSClassRegistry:");
+ }
+
+ int i = 1;
+ for (Entry<ClassLoader, StackTraceElement[]> e : clToLog.entrySet()) {
+ buf.append("[" + i + "] " + e.getKey() + " registered through:\n");
+ for (StackTraceElement s : e.getValue()) {
+ buf.append(" " + s + "\n");
+ }
+ i++;
+ }
+
+ log.log(aLogLevel, buf.toString());
+ }
static Map<String, JCasClassInfo> get_className_to_jcci(ClassLoader cl, boolean is_pear) {
synchronized (cl_to_type2JCas) {
@@ -1601,6 +1708,9 @@
if (cl_to_jcci == null) {
cl_to_jcci = new HashMap<>();
cl_to_type2JCas.put(cl, cl_to_jcci);
+ if (cl_to_type2JCasStacks != null) {
+ cl_to_type2JCasStacks.put(cl, new RuntimeException().getStackTrace());
+ }
}
return cl_to_jcci;
}
diff --git a/uimaj-core/src/main/java/org/apache/uima/internal/util/UIMAClassLoader.java b/uimaj-core/src/main/java/org/apache/uima/internal/util/UIMAClassLoader.java
index 023f77c..f3c4f99 100644
--- a/uimaj-core/src/main/java/org/apache/uima/internal/util/UIMAClassLoader.java
+++ b/uimaj-core/src/main/java/org/apache/uima/internal/util/UIMAClassLoader.java
@@ -28,6 +28,9 @@
import java.util.List;
import java.util.StringTokenizer;
+import org.apache.uima.cas.impl.FSClassRegistry;
+import org.apache.uima.cas.impl.TypeSystemImpl;
+
/**
* UIMAClassLoader is used as extension ClassLoader for UIMA to load additional components like
* annotators and resources. The classpath of the classloader is specified as string.
@@ -282,6 +285,16 @@
@Override
public void close() throws IOException {
isClosed = true;
+ // There is a circular dependency between the static initializer blocks of FSClassRegistry and
+ // TypeSystemImpl which requires that the TypeSystemImpl class must be initialized before the
+ // FSClassRegistry to avoid exceptions. The if-statement here is a red-herring because the
+ // actual comparison does not really matter - under normal circumstances, `staticTsi` cannot be
+ // null.
+ // However, what it really does is trigger the static initialization block of TypeSystemImpl
+ // so that the subsequent call to FSClassRegistry does not trigger an exception.
+ if (TypeSystemImpl.staticTsi != null) {
+ FSClassRegistry.unregister_jcci_classloader(this);
+ }
super.close();
}
diff --git a/uimaj-core/src/test/java/org/apache/uima/cas/impl/FSClassRegistryTest.java b/uimaj-core/src/test/java/org/apache/uima/cas/impl/FSClassRegistryTest.java
new file mode 100644
index 0000000..78379f9
--- /dev/null
+++ b/uimaj-core/src/test/java/org/apache/uima/cas/impl/FSClassRegistryTest.java
@@ -0,0 +1,96 @@
+/*
+ * 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.
+ */
+package org.apache.uima.cas.impl;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.apache.uima.UIMAFramework;
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.resource.ResourceManager;
+import org.apache.uima.util.CasCreationUtils;
+import org.apache.uima.util.Level;
+import org.junit.Before;
+import org.junit.Test;
+
+public class FSClassRegistryTest {
+ @Before
+ public void setup() {
+ System.setProperty(FSClassRegistry.RECORD_JCAS_CLASSLOADERS, "true");
+
+ // Calls to FSClassRegistry will fail unless the static initializer block in TypeSystemImpl
+ // has previously been triggered! During normal UIMA operations, this should not happen,
+ // in particular because FSClassRegistry is not really part of the public UIMA API -
+ // but in the minimal setup here, we need to make sure TypeSystemImpl has been initialized
+ // first.
+ new TypeSystemImpl();
+ }
+
+ @Test
+ public void thatCreatingResourceManagersWithExtensionClassloaderDoesNotFillUpCache()
+ throws Exception {
+ int numberOfCachedClassloadersAtStart = FSClassRegistry.clToType2JCasSize();
+ for (int i = 0; i < 5; i++) {
+ ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
+ resMgr.setExtensionClassLoader(getClass().getClassLoader(), true);
+ JCas jcas = CasCreationUtils.createCas(null, null, null, resMgr).getJCas();
+
+ ClassLoader cl = jcas.getCasImpl().getJCasClassLoader();
+ assertThat(cl.getResource(FSClassRegistryTest.class.getName().replace(".", "/") + ".class")) //
+ .isNotNull();
+
+ assertRegisteredClassLoaders(numberOfCachedClassloadersAtStart + 1,
+ "Only initial classloaders + the one owned by our ResourceManager");
+
+ resMgr.destroy();
+
+ assertRegisteredClassLoaders(numberOfCachedClassloadersAtStart, "Only initial classloaders");
+ }
+ }
+
+ @Test
+ public void thatCreatingResourceManagersWithExtensionPathDoesNotFillUpCache() throws Exception {
+ int numberOfCachedClassloadersAtStart = FSClassRegistry.clToType2JCasSize();
+ for (int i = 0; i < 5; i++) {
+ ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
+ resMgr.setExtensionClassPath("src/test/java", true);
+ JCas jcas = CasCreationUtils.createCas(null, null, null, resMgr).getJCas();
+
+ ClassLoader cl = jcas.getCasImpl().getJCasClassLoader();
+ assertThat(cl.getResource(FSClassRegistryTest.class.getName().replace(".", "/") + ".java")) //
+ .isNotNull();
+
+ assertRegisteredClassLoaders(numberOfCachedClassloadersAtStart + 1,
+ "Only initial classloaders + the one owned by our ResourceManager");
+
+ resMgr.destroy();
+
+ assertRegisteredClassLoaders(numberOfCachedClassloadersAtStart, "Only initial classloaders");
+ }
+ }
+
+ private void assertRegisteredClassLoaders(int aExpectedCount, String aDescription) {
+ if (FSClassRegistry.clToType2JCasSize() > aExpectedCount) {
+ FSClassRegistry.log_registered_classloaders(Level.INFO);
+ }
+
+ assertThat(FSClassRegistry.clToType2JCasSize()) //
+ .as(aDescription) //
+ .isEqualTo(aExpectedCount);
+ }
+}
diff --git a/uimaj-core/src/test/java/org/apache/uima/resource/impl/ResourceManager_implTest.java b/uimaj-core/src/test/java/org/apache/uima/resource/impl/ResourceManager_implTest.java
index 3b6d58a..2aa2150 100644
--- a/uimaj-core/src/test/java/org/apache/uima/resource/impl/ResourceManager_implTest.java
+++ b/uimaj-core/src/test/java/org/apache/uima/resource/impl/ResourceManager_implTest.java
@@ -19,6 +19,7 @@
package org.apache.uima.resource.impl;
+import static org.assertj.core.api.Assertions.assertThatCode;
import static org.junit.Assert.assertTrue;
import java.io.File;
@@ -266,4 +267,13 @@
JUnitExtension.handleException(e);
}
}
+
+ @Test
+ public void testCreateWithExtensionClassloaderAndDestroy() throws Exception {
+ assertThatCode(() -> {
+ ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
+ resMgr.setExtensionClassLoader(getClass().getClassLoader(), false);
+ resMgr.destroy();
+ }).doesNotThrowAnyException();
+ }
}
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/cas_data/impl/vinci/VinciCasDataConverter.java b/uimaj-cpe/src/main/java/org/apache/uima/cas_data/impl/vinci/VinciCasDataConverter.java
index a5e4133..236291b 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/cas_data/impl/vinci/VinciCasDataConverter.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/cas_data/impl/vinci/VinciCasDataConverter.java
@@ -32,14 +32,13 @@
import org.apache.vinci.transport.document.AFrame;
import org.xml.sax.SAXException;
-
/**
* Utilities for converting a VinciFrame to and from a CasData.
*
*
*/
public class VinciCasDataConverter {
-
+
/** The m ueid type. */
private String mUeidType;
@@ -61,12 +60,18 @@
/**
* Creates a new VinciCasDataConverter.
*
- * @param aUeidType CasData type that contains the UEID (may be null)
- * @param aUeidFeature CasData feature that contains the UEID (may be null)
- * @param aCasDataDocTextType CasData type that contains the document text
- * @param aCasDataDocTextFeature CasData feature that contains the document text
- * @param aXCasDocTextTag XCas tag representing the document text
- * @param aIncludeAnnotationSpannedText if true, when generating XCas for an annotation, the spanned text of the annotation
+ * @param aUeidType
+ * CasData type that contains the UEID (may be null)
+ * @param aUeidFeature
+ * CasData feature that contains the UEID (may be null)
+ * @param aCasDataDocTextType
+ * CasData type that contains the document text
+ * @param aCasDataDocTextFeature
+ * CasData feature that contains the document text
+ * @param aXCasDocTextTag
+ * XCas tag representing the document text
+ * @param aIncludeAnnotationSpannedText
+ * if true, when generating XCas for an annotation, the spanned text of the annotation
* will be included as the content of the XCas element.
*/
public VinciCasDataConverter(String aUeidType, String aUeidFeature, String aCasDataDocTextType,
@@ -83,13 +88,17 @@
/**
* Converts a CasData to a VinciFrame.
*
- * @param aCasData CasData to convert
- * @param aParentFrame VinciFrame to be the parent of the frame created from the CasData
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws SAXException the SAX exception
+ * @param aCasData
+ * CasData to convert
+ * @param aParentFrame
+ * VinciFrame to be the parent of the frame created from the CasData
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ * @throws SAXException
+ * the SAX exception
*/
- public void casDataToVinciFrame(CasData aCasData, AFrame aParentFrame) throws IOException,
- SAXException {
+ public void casDataToVinciFrame(CasData aCasData, AFrame aParentFrame)
+ throws IOException, SAXException {
// get UEID if necessary
String ueid = null;
if (mUeidType != null && mUeidFeature != null) {
@@ -118,22 +127,27 @@
/**
* Converts a VinciFrame to a CasData, appending to an existing CasData.
*
- * @param aCasFrame VinciFrame containing XCAS
- * @param aCasData CasData to which FeatureStructures from XCAS will be appended
- * @throws SAXException the SAX exception
+ * @param aCasFrame
+ * VinciFrame containing XCAS
+ * @param aCasData
+ * CasData to which FeatureStructures from XCAS will be appended
+ * @throws SAXException
+ * the SAX exception
* @deprecated Use appendVinciFrameToCasData(Aframe, CasData) or vinciFrameToCasData(AFrame)
*/
@Deprecated
-public void vinciFrameToCasData(AFrame aCasFrame, CasData aCasData) throws SAXException {
+ public void vinciFrameToCasData(AFrame aCasFrame, CasData aCasData) throws SAXException {
appendVinciFrameToCasData(aCasFrame, aCasData);
}
/**
* Converts a VinciFrame to a CasData.
*
- * @param aCasFrame VinciFrame containing XCAS
+ * @param aCasFrame
+ * VinciFrame containing XCAS
* @return a new CasData corrsponding to the XCAS in aCasFrame
- * @throws SAXException the SAX exception
+ * @throws SAXException
+ * the SAX exception
*/
public CasData vinciFrameToCasData(AFrame aCasFrame) throws SAXException {
CasData casData = new CasDataImpl();
@@ -144,9 +158,12 @@
/**
* Converts a VinciFrame to a CasData, appending to an existing CasData.
*
- * @param aCasFrame VinciFrame containing XCAS
- * @param aCasData CasData to which FeatureStructures from XCAS will be appended
- * @throws SAXException the SAX exception
+ * @param aCasFrame
+ * VinciFrame containing XCAS
+ * @param aCasData
+ * CasData to which FeatureStructures from XCAS will be appended
+ * @throws SAXException
+ * the SAX exception
*/
public void appendVinciFrameToCasData(AFrame aCasFrame, CasData aCasData) throws SAXException {
// Use VinciSaxParser to generate SAX events from VinciFrame, and send
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/CasConverter.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/CasConverter.java
index 82234c6..b269e45 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/CasConverter.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/CasConverter.java
@@ -56,7 +56,8 @@
/**
* Sets the name of the CASData FeatureStructure Type that stores the document text.
*
- * @param aDocumentTextTypeName the document text type name
+ * @param aDocumentTextTypeName
+ * the document text type name
*/
public void setDocumentTextTypeName(String aDocumentTextTypeName) {
mDocumentTextTypeName = aDocumentTextTypeName;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/CollectionProcessingEngine_impl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/CollectionProcessingEngine_impl.java
index 0ff9d27..a30fb8e 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/CollectionProcessingEngine_impl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/CollectionProcessingEngine_impl.java
@@ -36,7 +36,6 @@
import org.apache.uima.util.ProcessTrace;
import org.apache.uima.util.Progress;
-
public class CollectionProcessingEngine_impl implements CollectionProcessingEngine {
/**
* CPM instance that handles the processing
@@ -46,8 +45,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.CollectionProcessingEngine#initialize(org.apache.uima.collection.metadata.cpeDescription,
- * java.util.Map)
+ * @see
+ * org.apache.uima.collection.CollectionProcessingEngine#initialize(org.apache.uima.collection.
+ * metadata.cpeDescription, java.util.Map)
*/
@Override
public void initialize(CpeDescription aCpeDescription, Map aAdditionalParams)
@@ -59,12 +59,12 @@
}
// get the ResourceManager (if any) supplied in the aAdditionalParams map
- ResourceManager resMgr = aAdditionalParams == null ? null : (ResourceManager) aAdditionalParams
- .get(Resource.PARAM_RESOURCE_MANAGER);
+ ResourceManager resMgr = aAdditionalParams == null ? null
+ : (ResourceManager) aAdditionalParams.get(Resource.PARAM_RESOURCE_MANAGER);
// get performance tuning settings (if any) supplied in the aAdditionalParams map
- Properties perfSettings = aAdditionalParams == null ? null : (Properties) aAdditionalParams
- .get(Resource.PARAM_PERFORMANCE_TUNING_SETTINGS);
+ Properties perfSettings = aAdditionalParams == null ? null
+ : (Properties) aAdditionalParams.get(Resource.PARAM_PERFORMANCE_TUNING_SETTINGS);
// get ProcessControllerAdapter responsible for launching fenced services
ProcessControllerAdapter pca = aAdditionalParams == null ? null
@@ -86,7 +86,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.CollectionProcessingEngine#addStatusCallbackListener(org.apache.uima.collection.StatusCallbackListener)
+ * @see
+ * org.apache.uima.collection.CollectionProcessingEngine#addStatusCallbackListener(org.apache.uima
+ * .collection.StatusCallbackListener)
*/
@Override
public void addStatusCallbackListener(StatusCallbackListener aListener) {
@@ -96,7 +98,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.CollectionProcessingEngine#removeStatusCallbackListener(org.apache.uima.collection.StatusCallbackListener)
+ * @see
+ * org.apache.uima.collection.CollectionProcessingEngine#removeStatusCallbackListener(org.apache.
+ * uima.collection.StatusCallbackListener)
*/
@Override
public void removeStatusCallbackListener(StatusCallbackListener aListener) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/CasProcessorController.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/CasProcessorController.java
index c4fb083..7185dd7 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/CasProcessorController.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/CasProcessorController.java
@@ -54,7 +54,8 @@
/**
* Sets status of CasProcessor
*
- * @param aStatus -
+ * @param aStatus
+ * -
*/
void setStatus(int aStatus);
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/KillPipelineException.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/KillPipelineException.java
index ecdd5ce..19ea126 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/KillPipelineException.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/KillPipelineException.java
@@ -23,7 +23,6 @@
private static final long serialVersionUID = -4105689778536046179L;
-
public KillPipelineException(String msg) {
super(msg);
}
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/ProcessingContainer.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/ProcessingContainer.java
index 1078ab4..7bf61f8 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/ProcessingContainer.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/ProcessingContainer.java
@@ -34,8 +34,8 @@
* Base interface for implementing a Container object responsible for managing Cas Processor
* instances at runtime. Aggregates stats and totals and helps with error recovery.
*/
-public abstract class ProcessingContainer extends Resource_ImplBase implements
- ConfigurableResource, CasProcessorController {
+public abstract class ProcessingContainer extends Resource_ImplBase
+ implements ConfigurableResource, CasProcessorController {
public abstract boolean processCas(Object[] aCas);
public abstract void releaseCasProcessor(CasProcessor aCasProcessor);
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/deployer/CasProcessorDeployer.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/deployer/CasProcessorDeployer.java
index 994ce7e..f1590e4 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/deployer/CasProcessorDeployer.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/deployer/CasProcessorDeployer.java
@@ -31,17 +31,18 @@
*/
public interface CasProcessorDeployer {
/**
- * Deploys all Cas Processors in <i>aCasProcessorList</i>. The list contains one or more
- * instances of the same Cas Processor.
+ * Deploys all Cas Processors in <i>aCasProcessorList</i>. The list contains one or more instances
+ * of the same Cas Processor.
*
- * @param aCasProcessorList -
- * list of Cas Processors to deploy
- * @param redeploy -
- * true if the Cas Processor is being redeployed as part of the recovery, false otherwise
+ * @param aCasProcessorList
+ * - list of Cas Processors to deploy
+ * @param redeploy
+ * - true if the Cas Processor is being redeployed as part of the recovery, false
+ * otherwise
* @return ProcessingContainer managing deployed Cas Processors
*
- * @throws ResourceConfigurationException -
- * failed to deploy Cas Processor
+ * @throws ResourceConfigurationException
+ * - failed to deploy Cas Processor
*/
ProcessingContainer deployCasProcessor(List aCasProcessorList, boolean redeploy)
throws ResourceConfigurationException;
@@ -49,11 +50,11 @@
/**
* Method used to redeploy a single instance of a Cas Processor.
*
- * @param aProcessingContainer -
- * ProcessingContainer managing deployed Cas Processor to redeploy
+ * @param aProcessingContainer
+ * - ProcessingContainer managing deployed Cas Processor to redeploy
*
- * @throws ResourceConfigurationException -
- * failed to deploy Cas Processor
+ * @throws ResourceConfigurationException
+ * - failed to deploy Cas Processor
*/
void deployCasProcessor(ProcessingContainer aProcessingContainer)
throws ResourceConfigurationException;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/deployer/CasProcessorDeploymentException.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/deployer/CasProcessorDeploymentException.java
index f59e8d0..3ddcba0 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/deployer/CasProcessorDeploymentException.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/base_cpm/container/deployer/CasProcessorDeploymentException.java
@@ -59,8 +59,8 @@
* located.
* @param aMessageKey
* an identifier that maps to the message for this exception. The message may contain
- * placeholders for arguments as defined by the
- * {@link java.text.MessageFormat MessageFormat} class.
+ * placeholders for arguments as defined by the {@link java.text.MessageFormat
+ * MessageFormat} class.
* @param aArguments
* The arguments to the message. <code>null</code> may be used if the message has no
* arguments.
@@ -78,8 +78,8 @@
* located.
* @param aMessageKey
* an identifier that maps to the message for this exception. The message may contain
- * placeholders for arguments as defined by the
- * {@link java.text.MessageFormat MessageFormat} class.
+ * placeholders for arguments as defined by the {@link java.text.MessageFormat
+ * MessageFormat} class.
* @param aArguments
* The arguments to the message. <code>null</code> may be used if the message has no
* arguments.
@@ -96,8 +96,8 @@
*
* @param aMessageKey
* an identifier that maps to the message for this exception. The message may contain
- * placeholders for arguments as defined by the
- * {@link java.text.MessageFormat MessageFormat} class.
+ * placeholders for arguments as defined by the {@link java.text.MessageFormat
+ * MessageFormat} class.
* @param aArguments
* The arguments to the message. <code>null</code> may be used if the message has no
* arguments.
@@ -112,15 +112,16 @@
*
* @param aMessageKey
* an identifier that maps to the message for this exception. The message may contain
- * placeholders for arguments as defined by the
- * {@link java.text.MessageFormat MessageFormat} class.
+ * placeholders for arguments as defined by the {@link java.text.MessageFormat
+ * MessageFormat} class.
* @param aArguments
* The arguments to the message. <code>null</code> may be used if the message has no
* arguments.
* @param aCause
* the original exception that caused this exception to be thrown, if any
*/
- public CasProcessorDeploymentException(String aMessageKey, Object[] aArguments, Throwable aCause) {
+ public CasProcessorDeploymentException(String aMessageKey, Object[] aArguments,
+ Throwable aCause) {
super(aMessageKey, aArguments, aCause);
}
}
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/BaseCPMImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/BaseCPMImpl.java
index 972e7ee..778b373 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/BaseCPMImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/BaseCPMImpl.java
@@ -62,7 +62,6 @@
import org.apache.uima.util.UimaTimer;
import org.apache.uima.util.impl.ProcessTrace_impl;
-
/**
* Main thread that launches CPE and manages it. An application interacts with the running CPE via
* this object. Through an API, an application may start, pause, resume, and stop a CPE.
@@ -70,7 +69,7 @@
*
*/
public class BaseCPMImpl implements BaseCPM, Runnable {
-
+
/** The default process trace. */
private boolean defaultProcessTrace;
@@ -113,9 +112,10 @@
/**
* Instantiates and initializes CPE Factory with a given CPE Descriptor and defaults.
*
- * @param aDescriptor -
- * parsed CPE descriptor
- * @throws Exception -
+ * @param aDescriptor
+ * - parsed CPE descriptor
+ * @throws Exception
+ * -
*/
public BaseCPMImpl(CpeDescription aDescriptor) throws Exception {
this(aDescriptor, null, true, UIMAFramework.getDefaultPerformanceTuningProperties());
@@ -126,14 +126,16 @@
* Instantiates and initializes CPE Factory responsible for creating individual components that
* are part of the processing pipeline.
*
- * @param aDescriptor -
- * parsed CPE descriptor
- * @param aResourceManager -
- * ResourceManager instance to be used by the CPE
- * @param aDefaultProcessTrace -
- * ProcessTrace instance to capture events and stats
- * @param aProps the a props
- * @throws Exception -
+ * @param aDescriptor
+ * - parsed CPE descriptor
+ * @param aResourceManager
+ * - ResourceManager instance to be used by the CPE
+ * @param aDefaultProcessTrace
+ * - ProcessTrace instance to capture events and stats
+ * @param aProps
+ * the a props
+ * @throws Exception
+ * -
*/
public BaseCPMImpl(CpeDescription aDescriptor, ResourceManager aResourceManager,
boolean aDefaultProcessTrace, Properties aProps) throws Exception {
@@ -146,12 +148,14 @@
/**
* Parses CPE descriptor.
*
- * @param mode -
- * indicates if the CPM should use a static descriptor or one provided
- * @param aDescriptor -
- * provided descriptor path
- * @param aResourceManager ResourceManager to be used by CPM
- * @throws Exception -
+ * @param mode
+ * - indicates if the CPM should use a static descriptor or one provided
+ * @param aDescriptor
+ * - provided descriptor path
+ * @param aResourceManager
+ * ResourceManager to be used by CPM
+ * @throws Exception
+ * -
*/
public BaseCPMImpl(Boolean mode, String aDescriptor, ResourceManager aResourceManager)
throws Exception {
@@ -170,7 +174,8 @@
/**
* Plugs in custom perfomance tunning parameters.
*
- * @param aPerformanceTuningSettings the new performance tuning settings
+ * @param aPerformanceTuningSettings
+ * the new performance tuning settings
*/
public void setPerformanceTuningSettings(Properties aPerformanceTuningSettings) {
cpEngine.setPerformanceTuningSettings(aPerformanceTuningSettings);
@@ -180,8 +185,8 @@
* Plugs in a given {@link ProcessControllerAdapter}. The CPM uses this adapter to request Cas
* Processor restarts and shutdown.
*
- * @param aPca -
- * instance of the ProcessControllerAdapter
+ * @param aPca
+ * - instance of the ProcessControllerAdapter
*/
public void setProcessControllerAdapter(ProcessControllerAdapter aPca) {
cpEngine.setProcessControllerAdapter(aPca);
@@ -192,7 +197,8 @@
* use at the end of processing. Jedii-style reporting shows a summary for this run. The CPM
* default report shows more detail information.
*
- * @param aUseJediiReport the new jedii report
+ * @param aUseJediiReport
+ * the new jedii report
*/
public void setJediiReport(boolean aUseJediiReport) {
mEventTypeMap = new HashMap();
@@ -205,9 +211,12 @@
/**
* Instantiates and initializes a CPE.
*
- * @param aDummyCasProcessor -
- * @param aProps the a props
- * @throws Exception -
+ * @param aDummyCasProcessor
+ * -
+ * @param aProps
+ * the a props
+ * @throws Exception
+ * -
*/
public void init(boolean aDummyCasProcessor, Properties aProps) throws Exception {
String uimaTimerClass = cpeFactory.getCPEConfig().getTimerImpl();
@@ -239,8 +248,8 @@
}
if (checkpointFileName != null && checkpointFileName.trim().length() > 0) {
File checkpointFile = new File(checkpointFileName);
- checkpoint = new Checkpoint(this, checkpointFileName, cpeFactory.getCPEConfig()
- .getCheckpoint().getFrequency());
+ checkpoint = new Checkpoint(this, checkpointFileName,
+ cpeFactory.getCPEConfig().getCheckpoint().getFrequency());
// Check if the checkpoint file already exists. If it does, the CPM did not complete
// successfully during the previous run and CPM will start in recovery mode, restoring all
// totals and status's from the recovered checkpoint. The processing pipeline state will
@@ -267,12 +276,8 @@
CasProcessor[] casProcessors = cpeFactory.getCasProcessors();
for (int i = 0; i < casProcessors.length; i++) {
if (UIMAFramework.getLogger().isLoggable(Level.CONFIG)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.CONFIG,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_add_cp__CONFIG",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.CONFIG, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_add_cp__CONFIG",
new Object[] { Thread.currentThread().getName(),
casProcessors[i].getProcessingResourceMetaData().getName() });
}
@@ -299,8 +304,8 @@
cpEngine.setInputQueueSize(casPoolSize == 0 ? iqSize : casPoolSize);
} catch (NumberFormatException e) {
throw new Exception(CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_queue_size_not_defined__WARNING", new Object[] {
- Thread.currentThread().getName(), "inputQueueSize" }));
+ "UIMA_CPM_EXP_queue_size_not_defined__WARNING",
+ new Object[] { Thread.currentThread().getName(), "inputQueueSize" }));
}
try {
int oqSize = 0;
@@ -310,16 +315,17 @@
cpEngine.setOutputQueueSize(casPoolSize == 0 ? oqSize : casPoolSize + 2);
} catch (NumberFormatException e) {
throw new Exception(CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_queue_size_not_defined__WARNING", new Object[] {
- Thread.currentThread().getName(), "outputQueueSize" }));
+ "UIMA_CPM_EXP_queue_size_not_defined__WARNING",
+ new Object[] { Thread.currentThread().getName(), "outputQueueSize" }));
}
try {
int threadCount = cpeFactory.getCpeDescriptor().getCpeCasProcessors().getConcurrentPUCount();
cpEngine.setConcurrentThreadSize(threadCount);
} catch (NumberFormatException e) {
throw new Exception(CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_invalid_component_reference__WARNING", new Object[] {
- Thread.currentThread().getName(), "casProcessors", "processingUnitThreadCount" }));
+ "UIMA_CPM_EXP_invalid_component_reference__WARNING",
+ new Object[] { Thread.currentThread().getName(), "casProcessors",
+ "processingUnitThreadCount" }));
}
}
@@ -327,13 +333,16 @@
* Returns {@link CPEConfig} object holding current CPE configuration.
*
* @return CPEConfig instance
- * @throws Exception -
+ * @throws Exception
+ * -
*/
public CpeConfiguration getCPEConfig() throws Exception {
return cpeFactory.getCPEConfig();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseCPM#getCasProcessors()
*/
/*
@@ -347,29 +356,40 @@
return casProcs == null ? new CasProcessor[0] : casProcs;
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.base_cpm.BaseCPM#addCasProcessor(org.apache.uima.collection.base_cpm.CasProcessor)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.base_cpm.BaseCPM#addCasProcessor(org.apache.uima.collection.base_cpm
+ * .CasProcessor)
*/
/*
* Adds given CasProcessor to the processing pipeline. A new CasProcessor is appended to the
* current list.
*
- * @see org.apache.uima.collection.base_cpm.BaseCPM#addCasProcessor(org.apache.uima.collection.base_cpm.CasProcessor)
+ * @see
+ * org.apache.uima.collection.base_cpm.BaseCPM#addCasProcessor(org.apache.uima.collection.base_cpm
+ * .CasProcessor)
*/
@Override
public void addCasProcessor(CasProcessor aCasProcessor) throws ResourceConfigurationException {
cpEngine.addCasProcessor(aCasProcessor);
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.base_cpm.BaseCPM#addCasProcessor(org.apache.uima.collection.base_cpm.CasProcessor, int)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.base_cpm.BaseCPM#addCasProcessor(org.apache.uima.collection.base_cpm
+ * .CasProcessor, int)
*/
/*
* Adds given CasProcessor to the processing pipeline. A new CasProcessor is inserted into a given
* spot in the current list.
*
- * @see org.apache.uima.collection.base_cpm.BaseCPM#addCasProcessor(org.apache.uima.collection.base_cpm.CasProcessor,
- * int)
+ * @see
+ * org.apache.uima.collection.base_cpm.BaseCPM#addCasProcessor(org.apache.uima.collection.base_cpm
+ * .CasProcessor, int)
*/
@Override
public void addCasProcessor(CasProcessor aCasProcessor, int aIndex)
@@ -377,26 +397,34 @@
cpEngine.addCasProcessor(aCasProcessor, aIndex);
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.base_cpm.BaseCPM#removeCasProcessor(org.apache.uima.collection.base_cpm.CasProcessor)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.collection.base_cpm.BaseCPM#removeCasProcessor(org.apache.uima.collection.
+ * base_cpm.CasProcessor)
*/
/*
* Removes given CasProcessor from the processing pipeline.
*
- * @see org.apache.uima.collection.base_cpm.BaseCPM#removeCasProcessor(org.apache.uima.collection.base_cpm.CasProcessor)
+ * @see org.apache.uima.collection.base_cpm.BaseCPM#removeCasProcessor(org.apache.uima.collection.
+ * base_cpm.CasProcessor)
*/
@Override
public void removeCasProcessor(CasProcessor aCasProcessor) {
cpEngine.removeCasProcessor(0);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseCPM#disableCasProcessor(java.lang.String)
*/
/*
* Disables given CasProcessor in the existing processing pipeline.
*
- * @see org.apache.uima.collection.base_cpm.BaseCPM#disableCasProcessor(org.apache.uima.collection.base_cpm.CasProcessor)
+ * @see
+ * org.apache.uima.collection.base_cpm.BaseCPM#disableCasProcessor(org.apache.uima.collection.
+ * base_cpm.CasProcessor)
*/
@Override
public void disableCasProcessor(String aCasProcessorName) {
@@ -407,19 +435,24 @@
/**
* Enable cas processor.
*
- * @param aCasProcessorName the a cas processor name
+ * @param aCasProcessorName
+ * the a cas processor name
*/
/*
* Disables given CasProcessor in the existing processing pipeline.
*
- * @see org.apache.uima.collection.base_cpm.BaseCPM#disableCasProcessor(org.apache.uima.collection.base_cpm.CasProcessor)
+ * @see
+ * org.apache.uima.collection.base_cpm.BaseCPM#disableCasProcessor(org.apache.uima.collection.
+ * base_cpm.CasProcessor)
*/
public void enableCasProcessor(String aCasProcessorName) {
cpEngine.enableCasProcessor(aCasProcessorName);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseCPM#isSerialProcessingRequired()
*/
/*
@@ -440,7 +473,9 @@
public void setSerialProcessingRequired(boolean aRequired) {
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseCPM#isPauseOnException()
*/
/*
@@ -453,7 +488,9 @@
return cpEngine.isPauseOnException();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseCPM#setPauseOnException(boolean)
*/
/*
@@ -466,34 +503,44 @@
cpEngine.setPauseOnException(aPause);
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.base_cpm.BaseCPM#addStatusCallbackListener(org.apache.uima.collection.base_cpm.BaseStatusCallbackListener)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.collection.base_cpm.BaseCPM#addStatusCallbackListener(org.apache.uima.
+ * collection.base_cpm.BaseStatusCallbackListener)
*/
/*
* Adds Event Listener. Important events like, end of entity processing, exceptions, etc will be
* sent to the registered listeners.
*
- * @see org.apache.uima.collection.base_cpm.BaseCPM#addStatusCallbackListener(org.apache.uima.collection.base_cpm.BaseStatusCallbackListener)
+ * @see org.apache.uima.collection.base_cpm.BaseCPM#addStatusCallbackListener(org.apache.uima.
+ * collection.base_cpm.BaseStatusCallbackListener)
*/
@Override
public void addStatusCallbackListener(BaseStatusCallbackListener aListener) {
cpEngine.addStatusCallbackListener(aListener);
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.base_cpm.BaseCPM#removeStatusCallbackListener(org.apache.uima.collection.base_cpm.BaseStatusCallbackListener)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.collection.base_cpm.BaseCPM#removeStatusCallbackListener(org.apache.uima.
+ * collection.base_cpm.BaseStatusCallbackListener)
*/
/*
* Remoces named listener from the listener list.
*
- * @see org.apache.uima.collection.base_cpm.BaseCPM#removeStatusCallbackListener(org.apache.uima.collection.base_cpm.BaseStatusCallbackListener)
+ * @see org.apache.uima.collection.base_cpm.BaseCPM#removeStatusCallbackListener(org.apache.uima.
+ * collection.base_cpm.BaseStatusCallbackListener)
*/
@Override
public void removeStatusCallbackListener(BaseStatusCallbackListener aListener) {
cpEngine.removeStatusCallbackListener(aListener);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Runnable#run()
*/
/*
@@ -596,7 +643,7 @@
// Notify all listeners that the CPM has finished processing
for (int j = 0; j < statusCbL.size(); j++) {
BaseStatusCallbackListener st = (BaseStatusCallbackListener) statusCbL.get(j);
- if ( st != null ) {
+ if (st != null) {
if (!killed) {
st.collectionProcessComplete();
} else {
@@ -619,10 +666,12 @@
* This method is called by an applications to begin CPM processing with a given Collection. It
* just creates a new thread and starts it.
*
- * @param aCollectionReader the a collection reader
- * @throws ResourceInitializationException the resource initialization exception
+ * @param aCollectionReader
+ * the a collection reader
+ * @throws ResourceInitializationException
+ * the resource initialization exception
* @see org.apache.uima.collection.base_cpm.BaseCPM#process()
- * @deprecated
+ * @deprecated
*/
@Deprecated
public void process(BaseCollectionReader aCollectionReader)
@@ -674,11 +723,14 @@
* This method is called by an applications to begin CPM processing with a given Collection. It
* just creates a new thread and starts it.
*
- * @param aCollectionReader the a collection reader
- * @param aBatchSize the a batch size
- * @throws ResourceInitializationException the resource initialization exception
+ * @param aCollectionReader
+ * the a collection reader
+ * @param aBatchSize
+ * the a batch size
+ * @throws ResourceInitializationException
+ * the resource initialization exception
* @see org.apache.uima.collection.base_cpm.BaseCPM#process()
- * @deprecated
+ * @deprecated
*/
@Deprecated
public void process(BaseCollectionReader aCollectionReader, int aBatchSize)
@@ -726,7 +778,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseCPM#isProcessing()
*/
/*
@@ -740,7 +794,9 @@
return cpEngine.isRunning();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseCPM#pause()
*/
/*
@@ -757,7 +813,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseCPM#isPaused()
*/
/*
@@ -770,7 +828,9 @@
return cpEngine.isPaused();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseCPM#resume(boolean)
*/
/*
@@ -783,7 +843,9 @@
resume();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseCPM#resume()
*/
/*
@@ -825,7 +887,9 @@
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseCPM#stop()
*/
/*
@@ -888,7 +952,8 @@
/**
* Decode status.
*
- * @param aStatus the a status
+ * @param aStatus
+ * the a status
* @return the string
*/
/*
@@ -920,10 +985,14 @@
/**
* Copy component events.
*
- * @param aEvType the a ev type
- * @param aList the a list
- * @param aPTr the a P tr
- * @throws IOException Signals that an I/O exception has occurred.
+ * @param aEvType
+ * the a ev type
+ * @param aList
+ * the a list
+ * @param aPTr
+ * the a P tr
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
*/
/*
* Copies events of a given type found in the list to a provided ProcessTrace instance
@@ -946,10 +1015,10 @@
/**
* Helper method to display stats and totals.
*
- * @param aProcessTrace -
- * trace containing stats
- * @param aNumDocsProcessed -
- * number of entities processed so far
+ * @param aProcessTrace
+ * - trace containing stats
+ * @param aNumDocsProcessed
+ * - number of entities processed so far
*/
public void displayStats(ProcessTrace aProcessTrace, int aNumDocsProcessed) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
@@ -965,10 +1034,8 @@
// get the time.
if ("CPM".equals(event.getComponentName())) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).log(
- Level.FINEST,
- "Current Component::" + event.getComponentName() + " Time::"
- + event.getDuration());
+ UIMAFramework.getLogger(this.getClass()).log(Level.FINEST, "Current Component::"
+ + event.getComponentName() + " Time::" + event.getDuration());
}
continue;
}
@@ -1000,8 +1067,10 @@
/**
* Helper method to help build the CPM report.
*
- * @param aEvent the a event
- * @param aTotalTime the a total time
+ * @param aEvent
+ * the a event
+ * @param aTotalTime
+ * the a total time
*/
public void buildEventTree(ProcessTraceEvent aEvent, int aTotalTime) {
// Skip reporting the CPM time.This time has already been acquired by summing up
@@ -1019,10 +1088,8 @@
}
if (System.getProperty("DEBUG") != null) {
- UIMAFramework.getLogger(this.getClass()).log(
- Level.FINEST,
- "" + pct + "% (" + duration + "ms) - " + aEvent.getComponentName() + " (" + type
- + ")");
+ UIMAFramework.getLogger(this.getClass()).log(Level.FINEST, "" + pct + "% (" + duration
+ + "ms) - " + aEvent.getComponentName() + " (" + type + ")");
}
Iterator it = aEvent.getSubEvents().iterator();
while (it.hasNext()) {
@@ -1103,16 +1170,16 @@
Long totalCollectionReaderTime = (Long) perfReport.get("COLLECTION_READER_TIME");
String readerName = collectionReader.getProcessingResourceMetaData().getName();
if (totalCollectionReaderTime != null) {
- processTrace.addEvent(readerName, "COLLECTION_READER_TIME", String
- .valueOf(totalCollectionReaderTime), 0, null);
+ processTrace.addEvent(readerName, "COLLECTION_READER_TIME",
+ String.valueOf(totalCollectionReaderTime), 0, null);
}
for (int i = 0; i < colReaderProgress.length; i++) {
if (Progress.BYTES.equals(colReaderProgress[i].getUnit())) {
- processTrace.addEvent(readerName, Constants.COLLECTION_READER_BYTES_PROCESSED, String
- .valueOf(colReaderProgress[i].getCompleted()), 0, null);
+ processTrace.addEvent(readerName, Constants.COLLECTION_READER_BYTES_PROCESSED,
+ String.valueOf(colReaderProgress[i].getCompleted()), 0, null);
} else if (Progress.ENTITIES.equals(colReaderProgress[i].getUnit())) {
- processTrace.addEvent(readerName, Constants.COLLECTION_READER_DOCS_PROCESSED, String
- .valueOf(colReaderProgress[i].getCompleted()), 0, null);
+ processTrace.addEvent(readerName, Constants.COLLECTION_READER_DOCS_PROCESSED,
+ String.valueOf(colReaderProgress[i].getCompleted()), 0, null);
}
}
@@ -1133,8 +1200,8 @@
}
copyComponentEvents("Process", eList, processTrace);
- processTrace.addEvent(container.getName(), "Documents Processed", String.valueOf(container
- .getProcessed()), 0, null);
+ processTrace.addEvent(container.getName(), "Documents Processed",
+ String.valueOf(container.getProcessed()), 0, null);
String status = decodeStatus(container.getStatus());
processTrace.addEvent(container.getName(), "Processor Status", status, 0, null);
@@ -1147,20 +1214,20 @@
0, null);
int restartCount = container.getRestartCount();
- processTrace.addEvent(container.getName(), "Processor Restarts", String
- .valueOf(restartCount), 0, null);
+ processTrace.addEvent(container.getName(), "Processor Restarts",
+ String.valueOf(restartCount), 0, null);
int retryCount = container.getRetryCount();
processTrace.addEvent(container.getName(), "Processor Retries", String.valueOf(retryCount),
0, null);
int filteredCount = container.getFilteredCount();
- processTrace.addEvent(container.getName(), "Filtered Entities", String
- .valueOf(filteredCount), 0, null);
+ processTrace.addEvent(container.getName(), "Filtered Entities",
+ String.valueOf(filteredCount), 0, null);
long remainingCount = container.getRemaining();
- processTrace.addEvent(container.getName(), "Processor Remaining", String
- .valueOf(remainingCount), 0, null);
+ processTrace.addEvent(container.getName(), "Processor Remaining",
+ String.valueOf(remainingCount), 0, null);
HashMap aMap = container.getAllStats();
@@ -1181,16 +1248,15 @@
"Custom String Stat-" + key + " Value=" + (String) o);
}
} else if (o instanceof Integer) {
- processTrace.addEvent(container.getName(), key, String.valueOf(((Integer) o)
- .intValue()), 0, null);
+ processTrace.addEvent(container.getName(), key,
+ String.valueOf(((Integer) o).intValue()), 0, null);
if (System.getProperty("SHOW_CUSTOM_STATS") != null) {
UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
"Custom Integer Stat-" + key + " Value=" + o);
- }
+ }
} else {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).log(
- Level.FINEST,
+ UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
"Invalid Type Found When Generating Status For " + key + ". Type::"
+ o.getClass().getName()
+ " Not supported. Use Integer or String instead.");
@@ -1218,9 +1284,12 @@
/**
* Creates the default process trace.
*
- * @param aProcessors the a processors
- * @param srcProcTr the src proc tr
- * @param aProcessTrace the a process trace
+ * @param aProcessors
+ * the a processors
+ * @param srcProcTr
+ * the src proc tr
+ * @param aProcessTrace
+ * the a process trace
*/
private void createDefaultProcessTrace(CasProcessor[] aProcessors, ProcessTrace srcProcTr,
ProcessTrace aProcessTrace) {
@@ -1253,10 +1322,11 @@
/**
* Returns a CPE descriptor as a String.
*
- * @param aList -
- * list of components
+ * @param aList
+ * - list of components
* @return - descriptor populated with a given components
- * @throws ResourceConfigurationException the resource configuration exception
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
public String getDescriptor(List aList) throws ResourceConfigurationException {
return cpeFactory.getDescriptor(aList);
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CPEConfig.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CPEConfig.java
index 6959ae7..7405249 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CPEConfig.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CPEConfig.java
@@ -93,8 +93,8 @@
/**
* Copies Checkpoint configuration
*
- * @param config -
- * checkpoint configuration
+ * @param config
+ * - checkpoint configuration
*/
public void setChConfig(CheckpointConfig config) {
chConfig = config;
@@ -103,8 +103,8 @@
/**
* Copies CPE startup mode
*
- * @param aCpeDeployMode -
- * startup mode
+ * @param aCpeDeployMode
+ * - startup mode
*/
public void setDeployAs(String aCpeDeployMode) {
deployAs = aCpeDeployMode;
@@ -113,8 +113,8 @@
/**
* Copies number of entities to process
*
- * @param aTotalCount -
- * total number of entities to process
+ * @param aTotalCount
+ * - total number of entities to process
*/
public void setNumToProcess(long aTotalCount) {
numToProcess = aTotalCount;
@@ -123,8 +123,8 @@
/**
* Copies ind of the first entity to start reading
*
- * @param aStartEntityId -
- * id of entity
+ * @param aStartEntityId
+ * - id of entity
*/
public void setStartWith(String aStartEntityId) {
startWith = aStartEntityId;
@@ -133,8 +133,8 @@
/**
* Copies a name of the custom {@link UimaTimer} class
*
- * @param aTimerClass -
- * timer class
+ * @param aTimerClass
+ * - timer class
*/
public void setTimerClass(String aTimerClass) {
timerClass = aTimerClass;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CPMImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CPMImpl.java
index d771dbc..f179f80 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CPMImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CPMImpl.java
@@ -43,7 +43,6 @@
super(null, null, aResourceManager);
}
-
@Override
public AnalysisEngine getAnalysisEngine() {
if (super.getCasProcessors()[0] != null) {
@@ -59,7 +58,6 @@
return null;
}
-
@Override
public void setAnalysisEngine(AnalysisEngine aAnalysisEngine)
throws ResourceConfigurationException {
@@ -72,7 +70,6 @@
}
}
-
@Override
public CasConsumer[] getCasConsumers() {
if (consumers != null) {
@@ -90,41 +87,35 @@
return consumers;
}
-
@Override
public void addCasConsumer(CasConsumer aCasConsumer) throws ResourceConfigurationException {
super.addCasProcessor(aCasConsumer);
}
-
@Override
public void removeCasConsumer(CasConsumer aCasConsumer) {
super.removeCasProcessor(aCasConsumer);
}
-
@Override
public void addStatusCallbackListener(StatusCallbackListener aListener) {
super.addStatusCallbackListener(aListener);
}
-
@Override
public void removeStatusCallbackListener(StatusCallbackListener aListener) {
super.removeStatusCallbackListener(aListener);
}
-
@Override
public void process(CollectionReader aCollectionReader) throws ResourceInitializationException {
super.process(aCollectionReader);
}
-
@Override
public void process(CollectionReader aCollectionReader, int aBatchSize)
throws ResourceInitializationException {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/Checkpoint.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/Checkpoint.java
index be1217b..6cef3d7 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/Checkpoint.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/Checkpoint.java
@@ -35,19 +35,18 @@
import org.apache.uima.util.ProcessTrace;
import org.apache.uima.util.ProcessTraceEvent;
-
/**
* Runing in a seperate thread creates a checkpoint file at predefined intervals.
*
*/
public class Checkpoint implements Runnable {
-
+
/** The file name. */
private String fileName = null;
/** The stop. */
- private volatile boolean stop = false; // volatile may be buggy in some JVMs apparently
- // consider changing to use synch
+ private volatile boolean stop = false; // volatile may be buggy in some JVMs apparently
+ // consider changing to use synch
/** The checkpoint frequency. */
private long checkpointFrequency = 3000;
@@ -55,7 +54,7 @@
/**
* The pause.
*
- * @GuardedBy(lockForPause)
+ * @GuardedBy(lockForPause)
*/
private boolean pause = false;
@@ -73,9 +72,12 @@
* Initialize the checkpoint with a reference to controlling cpe, the file where the checkpoint is
* to be stored, and the frequency of checkpoints.
*
- * @param aCpm the a cpm
- * @param aFilename the a filename
- * @param aCheckpointFrequency the a checkpoint frequency
+ * @param aCpm
+ * the a cpm
+ * @param aFilename
+ * the a filename
+ * @param aCheckpointFrequency
+ * the a checkpoint frequency
*/
public Checkpoint(BaseCPMImpl aCpm, String aFilename, long aCheckpointFrequency) {
fileName = aFilename;
@@ -204,7 +206,7 @@
ObjectOutputStream s = null;
try (FileOutputStream out = new FileOutputStream(fileName);
- FileOutputStream synchPointOut = new FileOutputStream(synchPointFileName)) {
+ FileOutputStream synchPointOut = new FileOutputStream(synchPointFileName)) {
s = new ObjectOutputStream(out);
SynchPoint synchPoint = cpm.getSynchPoint();
@@ -214,17 +216,17 @@
if (synchPoint != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
- this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_checkpoint_with_synchpoint__FINEST",
- new Object[] {Thread.currentThread().getName()});
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_checkpoint_with_synchpoint__FINEST",
+ new Object[] { Thread.currentThread().getName() });
}
targetToSave = new CheckpointData(pTrace, synchPoint);
} else {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
- this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_checkpoint_with_pt__FINEST",
- new Object[] {Thread.currentThread().getName()});
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_checkpoint_with_pt__FINEST",
+ new Object[] { Thread.currentThread().getName() });
}
targetToSave = new CheckpointData(pTrace);
}
@@ -240,9 +242,9 @@
}
} catch (Exception e) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
- "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_exception_when_checkpointing__FINEST",
- new Object[] {Thread.currentThread().getName(), e.getMessage()});
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_exception_when_checkpointing__FINEST",
+ new Object[] { Thread.currentThread().getName(), e.getMessage() });
}
} catch (Exception e) {
@@ -256,8 +258,8 @@
/**
* Renames previous checkpoint file.
*
- * @param aFilename -
- * checkpoint file to rename
+ * @param aFilename
+ * - checkpoint file to rename
*/
public void rename(String aFilename) {
File currentFile = new File(aFilename);
@@ -268,7 +270,8 @@
/**
* Prints the stats.
*
- * @param prT the pr T
+ * @param prT
+ * the pr T
*/
public static void printStats(ProcessTrace prT) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
@@ -314,10 +317,8 @@
totDur = prEvent.getDuration();
subEveList = prEvent.getSubEvents();
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(Checkpoint.class).log(
- Level.FINEST,
- tabS + "COMPONENT : " + compNameS + "\tTYPE : " + typeS + "\tDescription : "
- + prEvent.getDescription());
+ UIMAFramework.getLogger(Checkpoint.class).log(Level.FINEST, tabS + "COMPONENT : "
+ + compNameS + "\tTYPE : " + typeS + "\tDescription : " + prEvent.getDescription());
UIMAFramework.getLogger(Checkpoint.class).log(Level.FINEST,
tabS + "TOTAL_TIME : " + totDur + "\tTIME_EXCLUDING_SUBEVENTS : " + dur);
}
@@ -347,7 +348,8 @@
* Retrieves the checkpoint from the filesystem.
*
* @return - desirialized object containing recovery information.
- * @throws IOException -
+ * @throws IOException
+ * -
*/
public synchronized Object restoreFromCheckpoint() throws IOException {
ObjectInputStream stream = null;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CheckpointConfig.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CheckpointConfig.java
index c74a39a..1774e34 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CheckpointConfig.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CheckpointConfig.java
@@ -42,10 +42,10 @@
/**
* Initilizes instance with a file where the checkpoint will be stored and checkpoint frequency.
*
- * @param aChpFile -
- * path to the checkpoint file
- * @param aFrequency -
- * frequency of checkpoints
+ * @param aChpFile
+ * - path to the checkpoint file
+ * @param aFrequency
+ * - frequency of checkpoints
*/
public CheckpointConfig(String aChpFile, String aFrequency) {
checkpointFile = aChpFile;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CheckpointData.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CheckpointData.java
index 350eff4..d003f84 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CheckpointData.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/CheckpointData.java
@@ -48,9 +48,10 @@
/**
* Initialize instance with ProcessTrace and SynchPoint
*
- * @param aProcessTrace -
- * events and timers accumulated so far
- * @param aSynchPoint -
+ * @param aProcessTrace
+ * - events and timers accumulated so far
+ * @param aSynchPoint
+ * -
*/
public CheckpointData(ProcessTrace aProcessTrace, SynchPoint aSynchPoint) {
processTrace = aProcessTrace;
@@ -78,8 +79,8 @@
/**
* Adds ProcessTrace to save in a checkpoint
*
- * @param trace -
- * ProcessTrace to save
+ * @param trace
+ * - ProcessTrace to save
*/
public void setProcessTrace(ProcessTrace trace) {
processTrace = trace;
@@ -88,8 +89,8 @@
/**
* Adds SynchPoint to save in a checkpoint
*
- * @param point -
- * SynchPoint to save
+ * @param point
+ * - SynchPoint to save
*/
public void setSynchPoint(SynchPoint point) {
synchPoint = point;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/StatusCallbackListenerImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/StatusCallbackListenerImpl.java
index 7198d86..2cecb02 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/StatusCallbackListenerImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/StatusCallbackListenerImpl.java
@@ -141,23 +141,16 @@
if (aCas == null) {
for (int i = 0; i < aStatus.getFailedComponentNames().size(); i++) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_failed_component__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_failed_component__FINEST",
new Object[] { Thread.currentThread().getName(),
((String) aStatus.getFailedComponentNames().get(i)) });
}
}
for (int i = 0; i < aStatus.getExceptions().size(); i++) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_component_exception__FINEST",
new Object[] { Thread.currentThread().getName(),
(aStatus.getExceptions().get(i)).toString() });
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CPEContext.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CPEContext.java
index 4419a6f..a1654f2 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CPEContext.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CPEContext.java
@@ -30,7 +30,8 @@
/**
*
- * @param aDescriptorPath -
+ * @param aDescriptorPath
+ * -
*/
public CPEContext(String aDescriptorPath) {
cpeDescriptorPath = aDescriptorPath;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CPEFactory.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CPEFactory.java
index 2b6a9a9..ecbe2ea 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CPEFactory.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CPEFactory.java
@@ -88,7 +88,6 @@
import org.apache.uima.util.Level;
import org.apache.uima.util.XMLInputSource;
-
/**
* Component responsible for generating objects representing cpe descriptor configuration. Provides
* various ways to instantiate object model representing cpe configuration. In the simplest form it
@@ -105,7 +104,7 @@
*
*/
public class CPEFactory {
-
+
/** The Constant CPM_HOME. */
public static final String CPM_HOME = "${CPM_HOME}";
@@ -139,7 +138,8 @@
/**
* Create a new CPEFactory on which we will later call parse(String) to parse a CPE descriptor.
*
- * @param aResourceManager the a resource manager
+ * @param aResourceManager
+ * the a resource manager
*/
public CPEFactory(ResourceManager aResourceManager) {
if (aResourceManager == null) {
@@ -152,18 +152,21 @@
/**
* Create a new CPEFactory for a CpeDescription that's already been parsed.
*
- * @param aDescriptor the a descriptor
- * @param aResourceManager the resource manager that all components of this CPE will share If null, a new
+ * @param aDescriptor
+ * the a descriptor
+ * @param aResourceManager
+ * the resource manager that all components of this CPE will share If null, a new
* ResourceManager will be created.
- * @throws ResourceInitializationException the resource initialization exception
+ * @throws ResourceInitializationException
+ * the resource initialization exception
*/
public CPEFactory(CpeDescription aDescriptor, ResourceManager aResourceManager)
throws ResourceInitializationException {
if (aDescriptor == null) {
- throw new UIMARuntimeException(new InvalidObjectException(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_no_cpe_descriptor__WARNING", new Object[] { Thread
- .currentThread().getName() })));
+ throw new UIMARuntimeException(
+ new InvalidObjectException(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_no_cpe_descriptor__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
if (aResourceManager == null) {
@@ -185,8 +188,8 @@
if (resMgrCfgDesc.get().length() > 0) {
String descriptorPath = CPMUtils.convertToAbsolutePath(System.getProperty("CPM_HOME"),
CPM_HOME, resMgrCfgDesc.get());
- resMgrCfg = UIMAFramework.getXMLParser().parseResourceManagerConfiguration(
- new XMLInputSource(descriptorPath));
+ resMgrCfg = UIMAFramework.getXMLParser()
+ .parseResourceManagerConfiguration(new XMLInputSource(descriptorPath));
aResourceManager.initializeExternalResources(resMgrCfg, "/", null);
}
} catch (InvalidXMLException e) {
@@ -200,24 +203,25 @@
/**
* Creates an object representation for configuration in a given cpe descriptor file.
*
- * @param aDescriptor -
- * path to the descriptor
+ * @param aDescriptor
+ * - path to the descriptor
*
- * @throws InstantiationException -
+ * @throws InstantiationException
+ * -
*/
public void parse(String aDescriptor) throws InstantiationException {
defaultConfig = false;
if (aDescriptor == null || aDescriptor.trim().length() == 0) {
- throw new UIMARuntimeException(new FileNotFoundException(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_no_cpe_descriptor__WARNING", new Object[] { Thread
- .currentThread().getName() })));
+ throw new UIMARuntimeException(
+ new FileNotFoundException(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_no_cpe_descriptor__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
try {
- setCpeDescriptor(CpeDescriptorFactory.produceDescriptor(new FileInputStream(new File(
- aDescriptor))));
+ setCpeDescriptor(
+ CpeDescriptorFactory.produceDescriptor(new FileInputStream(new File(aDescriptor))));
} catch (Exception e) {
throw new UIMARuntimeException(InvalidXMLException.INVALID_DESCRIPTOR_FILE,
@@ -228,18 +232,19 @@
/**
* Creates an object representation for configuration in a given stream.
*
- * @param aDescriptorStream -
- * stream containing cpe description
- * @throws InstantiationException -
+ * @param aDescriptorStream
+ * - stream containing cpe description
+ * @throws InstantiationException
+ * -
*/
public void parse(InputStream aDescriptorStream) throws InstantiationException {
defaultConfig = false;
if (aDescriptorStream == null) {
- throw new UIMARuntimeException(new IOException(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_invalid_cpe_descriptor_stream__WARNING", new Object[] { Thread
- .currentThread().getName() })));
+ throw new UIMARuntimeException(new IOException(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_invalid_cpe_descriptor_stream__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
try {
@@ -252,7 +257,8 @@
/**
* Creates an object representation from default cpe descriptor.
*
- * @throws UIMARuntimeException wraps Exception
+ * @throws UIMARuntimeException
+ * wraps Exception
*/
public void parse() {
defaultConfig = true;
@@ -274,14 +280,15 @@
/**
* Checks if cpe description has been created.
*
- * @throws ResourceConfigurationException the resource configuration exception
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
private void checkForErrors() throws ResourceConfigurationException {
if (cpeDescriptor == null) {
- throw new ResourceConfigurationException(new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_no_cpe_descriptor__WARNING", new Object[] { Thread
- .currentThread().getName() })));
+ throw new ResourceConfigurationException(
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_no_cpe_descriptor__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
}
@@ -291,7 +298,8 @@
* CollectionReader.
*
* @return CollectionReader instance
- * @throws ResourceConfigurationException the resource configuration exception
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
public BaseCollectionReader getCollectionReader() throws ResourceConfigurationException {
checkForErrors();
@@ -300,28 +308,31 @@
CpeCollectionReader reader = (getCpeDescriptor().getAllCollectionCollectionReaders())[0];
if (reader == null) {
throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
- new Object[] { "<collectionReader>", "<cpeDescriptor>" }, new Exception(
- CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_required_element__WARNING", new Object[] {
- Thread.currentThread().getName(), "<collectionReader>" })));
+ new Object[] { "<collectionReader>", "<cpeDescriptor>" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_missing_required_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), "<collectionReader>" })));
}
CpeCollectionReaderIterator cit = reader.getCollectionIterator();
- if (cit == null || cit.getDescriptor() == null ||
- (cit.getDescriptor().getInclude() == null && cit.getDescriptor().getImport() == null)) {
+ if (cit == null || cit.getDescriptor() == null || (cit.getDescriptor().getInclude() == null
+ && cit.getDescriptor().getImport() == null)) {
throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
- new Object[] { "<include>", "<collectionIterator>" }, new Exception(
+ new Object[] { "<include>", "<collectionIterator>" },
+ new Exception(
CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_missing_required_element__WARNING", new Object[] {
Thread.currentThread().getName(), "<include> or <import>" })));
}
- if (cit.getDescriptor().getInclude() != null && cit.getDescriptor().getInclude().get() == null) {
+ if (cit.getDescriptor().getInclude() != null
+ && cit.getDescriptor().getInclude().get() == null) {
throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
- new Object[] { "<href>", "<collectionIterator>" }, new Exception(
- CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING",
- new Object[] { Thread.currentThread().getName(), "<href>",
- "<collectionIterator>" })));
+ new Object[] { "<href>", "<collectionIterator>" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING", new Object[] {
+ Thread.currentThread().getName(), "<href>", "<collectionIterator>" })));
}
URL descriptorUrl = cit.getDescriptor().findAbsoluteUrl(getResourceManager());
@@ -330,7 +341,8 @@
ResourceSpecifier colReaderSp = UIMAFramework.getXMLParser()
.parseCollectionReaderDescription(in1);
- overrideParameterSettings(colReaderSp, cit.getConfigurationParameterSettings(), "Collection Reader");
+ overrideParameterSettings(colReaderSp, cit.getConfigurationParameterSettings(),
+ "Collection Reader");
// compute sofa mapping for the CollectionReader
CpeSofaMappings sofanamemappings = cit.getSofaNameMappings();
@@ -354,39 +366,42 @@
colreader = (BaseCollectionReader) UIMAFramework.produceResource(BaseCollectionReader.class,
colReaderSp, getResourceManager(), additionalParams);
- //set up CAS Initializer
+ // set up CAS Initializer
CpeCollectionReaderCasInitializer casInit = reader.getCasInitializer();
if (casInit != null) {
if (casInit.getDescriptor() == null) {
throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
- new Object[] { "<descriptor>", "<casInitializer>" }, new Exception(
- CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_required_element__WARNING", new Object[] {
- Thread.currentThread().getName(), "<descriptor>" })));
+ new Object[] { "<descriptor>", "<casInitializer>" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_missing_required_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), "<descriptor>" })));
}
- if (casInit.getDescriptor().getInclude() == null && casInit.getDescriptor().getImport() == null) {
+ if (casInit.getDescriptor().getInclude() == null
+ && casInit.getDescriptor().getImport() == null) {
throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
- new Object[] { "<include>", "<casInitializer>" }, new Exception(
- CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_required_element__WARNING", new Object[] {
- Thread.currentThread().getName(), "<include> or <import>" })));
+ new Object[] { "<include>", "<casInitializer>" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_missing_required_element__WARNING", new Object[] {
+ Thread.currentThread().getName(), "<include> or <import>" })));
}
- if (casInit.getDescriptor().getInclude() != null &&
- (casInit.getDescriptor().getInclude().get() == null
- || casInit.getDescriptor().getInclude().get().length() == 0)) {
+ if (casInit.getDescriptor().getInclude() != null
+ && (casInit.getDescriptor().getInclude().get() == null
+ || casInit.getDescriptor().getInclude().get().length() == 0)) {
throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
- new Object[] { "<href>", "<casInitializer>" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING",
- new Object[] { Thread.currentThread().getName(), "<href>",
- "<casInitializer>" })));
+ new Object[] { "<href>", "<casInitializer>" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING", new Object[] {
+ Thread.currentThread().getName(), "<href>", "<casInitializer>" })));
}
URL casInitDescUrl = casInit.getDescriptor().findAbsoluteUrl(getResourceManager());
XMLInputSource in4 = new XMLInputSource(casInitDescUrl);
- ResourceSpecifier casIniSp = UIMAFramework.getXMLParser().parseCasInitializerDescription(
- in4);
+ ResourceSpecifier casIniSp = UIMAFramework.getXMLParser()
+ .parseCasInitializerDescription(in4);
overrideParameterSettings(casIniSp, casInit.getConfigurationParameterSettings(),
"Cas Initializer");
@@ -418,11 +433,11 @@
} else {
throw new ResourceConfigurationException(InvalidXMLException.INVALID_ELEMENT_TYPE,
new Object[] { "CasDataInitializer", initializer.getClass().getName() },
- new Exception(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_incompatible_component__WARNING", new Object[] {
- Thread.currentThread().getName(), "CasInitializer",
- "CasDataInitializer", initializer.getClass().getName() })));
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_incompatible_component__WARNING",
+ new Object[] { Thread.currentThread().getName(), "CasInitializer",
+ "CasDataInitializer", initializer.getClass().getName() })));
}
}
// Retrieve number of entities to process from CPE configuration
@@ -435,34 +450,29 @@
}
// Provide CollectionReader with the number of documents to process
((ConfigurableResource_ImplBase) colreader).setConfigParameterValue("processSize",
- (int) numDocs2Process);
+ (int) numDocs2Process);
CpeConfiguration cpeType = getCpeDescriptor().getCpeConfiguration();
if (cpeType != null && cpeType.getStartingEntityId() != null
&& cpeType.getStartingEntityId().trim().length() > 0) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
- "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_start_doc_id__FINEST",
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_show_start_doc_id__FINEST",
new Object[] { Thread.currentThread().getName(), cpeType.getStartingEntityId() });
}
colreader.getProcessingResourceMetaData().getConfigurationParameterSettings()
.setParameterValue("startNumber", cpeType.getStartingEntityId().trim());
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).log(
- Level.FINEST,
- "Retrieved Documents Starting with DocId ::"
- + colreader.getProcessingResourceMetaData()
- .getConfigurationParameterSettings().getParameterValue(
- "startNumber"));
+ UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
+ "Retrieved Documents Starting with DocId ::" + colreader
+ .getProcessingResourceMetaData().getConfigurationParameterSettings()
+ .getParameterValue("startNumber"));
}
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).log(
- Level.FINEST,
- "Retrieved processSize ::"
- + ((ConfigurableResource_ImplBase) colreader)
- .getConfigParameterValue("processSize"));
+ UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
+ "Retrieved processSize ::" + ((ConfigurableResource_ImplBase) colreader)
+ .getConfigParameterValue("processSize"));
}
return colreader;
} catch (ResourceConfigurationException e) {
@@ -476,17 +486,19 @@
* Returns an array of Cas Processors instantiated from the cpe descriptor.
*
* @return - array of CasProcessor instances
- * @throws ResourceConfigurationException -
+ * @throws ResourceConfigurationException
+ * -
*/
public CasProcessor[] getCasProcessors() throws ResourceConfigurationException {
checkForErrors();
try {
if (getCpeDescriptor().getCpeCasProcessors() == null) {
throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
- new Object[] { "<casProcessors>", "<cpeDescriptor>" }, new Exception(
+ new Object[] { "<casProcessors>", "<cpeDescriptor>" },
+ new Exception(
CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_bad_cpe_descriptor__WARNING", new Object[] { Thread
- .currentThread().getName() })));
+ "UIMA_CPM_EXP_bad_cpe_descriptor__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
CpeCasProcessors ct = getCpeDescriptor().getCpeCasProcessors();
@@ -494,10 +506,11 @@
Vector v = new Vector();
if (casProcessorList == null || casProcessorList.length == 0) {
throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
- new Object[] { "<casProcessor>", "<casProcessors>" }, new Exception(
+ new Object[] { "<casProcessor>", "<casProcessors>" },
+ new Exception(
CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_bad_cpe_descriptor__WARNING", new Object[] { Thread
- .currentThread().getName() })));
+ "UIMA_CPM_EXP_bad_cpe_descriptor__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
Hashtable namesMap = new Hashtable();
@@ -505,19 +518,21 @@
CpeCasProcessor processorType = casProcessorList[i];
if (processorType == null) {
throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
- new Object[] { "<casProcessor>", "<casProcessors>" }, new Exception(
+ new Object[] { "<casProcessor>", "<casProcessors>" },
+ new Exception(
CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_bad_cpe_descriptor__WARNING", new Object[] { Thread
- .currentThread().getName() })));
+ "UIMA_CPM_EXP_bad_cpe_descriptor__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
// Check for duplicate Cas Processor names. Names must be unique
if (namesMap.containsKey(processorType.getName())) {
throw new ResourceConfigurationException(InvalidXMLException.INVALID_CPE_DESCRIPTOR,
- new Object[] { "casProcessor", "name" }, new CPMException(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_duplicate_name__WARNING", new Object[] {
- Thread.currentThread().getName(), processorType.getName() })));
+ new Object[] { "casProcessor", "name" },
+ new CPMException(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_duplicate_name__WARNING",
+ new Object[] { Thread.currentThread().getName(),
+ processorType.getName() })));
} else {
namesMap.put(processorType.getName(), processorType.getName());
}
@@ -525,7 +540,8 @@
String deploymentType = processorType.getDeployment();
if (deploymentType == null) {
throw new ResourceConfigurationException(InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING,
- new Object[] { "deployment", "<casProcessor>" }, new Exception(
+ new Object[] { "deployment", "<casProcessor>" },
+ new Exception(
CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING",
new Object[] { Thread.currentThread().getName(),
@@ -562,11 +578,12 @@
deployModel = Constants.DEPLOYMENT_REMOTE;
} else {
throw new ResourceConfigurationException(InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING,
- new Object[] { "deployment", "<casProcessor>" }, new Exception(
+ new Object[] { "deployment", "<casProcessor>" },
+ new Exception(
CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_Exception_invalid_deployment__WARNING", new Object[] {
- Thread.currentThread().getName(), processorType.getName(),
- deploymentType })));
+ "UIMA_CPM_Exception_invalid_deployment__WARNING",
+ new Object[] { Thread.currentThread().getName(),
+ processorType.getName(), deploymentType })));
}
// Add the casProcessor instantiated above to the map. The map is used to check if
@@ -590,8 +607,8 @@
// the
// CPE descriptor
if (firstTime && Constants.DEPLOYMENT_INTEGRATED.equalsIgnoreCase(deployModel)) {
- throw new ResourceConfigurationException(new CPMException(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ throw new ResourceConfigurationException(new CPMException(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_duplicate_name__WARNING", new Object[] {
Thread.currentThread().getName(), processorType.getName() })));
}
@@ -615,14 +632,15 @@
/**
* Check if a class has appropriate type.
*
- * @param aResourceClass -
- * class to check
- * @param resourceSpecifier -
- * specifier containing expected type
- * @param aDescriptor -
- * descriptor name
+ * @param aResourceClass
+ * - class to check
+ * @param resourceSpecifier
+ * - specifier containing expected type
+ * @param aDescriptor
+ * - descriptor name
* @return true - if class matches type
- * @throws ResourceConfigurationException -
+ * @throws ResourceConfigurationException
+ * -
*/
public boolean isDefinitionInstanceOf(Class aResourceClass, ResourceSpecifier resourceSpecifier,
String aDescriptor) throws ResourceConfigurationException {
@@ -664,15 +682,16 @@
/**
* Instantiates CasData Consumer from a given class.
*
- * @param aResourceClass -
- * CasDataConsumer class
- * @param aSpecifier -
- * specifier
- * @param aAdditionalParams -
- * parameters used to initialize CasDataConsumer
+ * @param aResourceClass
+ * - CasDataConsumer class
+ * @param aSpecifier
+ * - specifier
+ * @param aAdditionalParams
+ * - parameters used to initialize CasDataConsumer
* @return - instance of CasProcessor
*
- * @throws ResourceInitializationException -
+ * @throws ResourceInitializationException
+ * -
*/
public CasProcessor produceCasDataConsumer(Class aResourceClass, ResourceSpecifier aSpecifier,
Map aAdditionalParams) throws ResourceInitializationException {
@@ -707,12 +726,12 @@
new Object[] { className, aSpecifier.getSourceUrlString() }, e);
} catch (IllegalAccessException e) {
throw new ResourceInitializationException(
- ResourceInitializationException.COULD_NOT_INSTANTIATE, new Object[] { className,
- aSpecifier.getSourceUrlString() }, e);
+ ResourceInitializationException.COULD_NOT_INSTANTIATE,
+ new Object[] { className, aSpecifier.getSourceUrlString() }, e);
} catch (InstantiationException e) {
throw new ResourceInitializationException(
- ResourceInitializationException.COULD_NOT_INSTANTIATE, new Object[] { className,
- aSpecifier.getSourceUrlString() }, e);
+ ResourceInitializationException.COULD_NOT_INSTANTIATE,
+ new Object[] { className, aSpecifier.getSourceUrlString() }, e);
}
return null;
@@ -721,13 +740,14 @@
/**
* Instantiates Cas Initializer from a given class. It return
*
- * @param aSpecifier -
- * configuration for Cas Initializer
- * @param aAdditionalParams -
- * parameters to initialize Cas Initializer
+ * @param aSpecifier
+ * - configuration for Cas Initializer
+ * @param aAdditionalParams
+ * - parameters to initialize Cas Initializer
*
* @return instance of CasDataInitializer or CasInitializer
- * @throws ResourceInitializationException -
+ * @throws ResourceInitializationException
+ * -
*/
private Object produceInitializer(ResourceSpecifier aSpecifier, Map aAdditionalParams)
throws ResourceInitializationException {
@@ -745,8 +765,8 @@
((CasDataInitializer) initializer).initialize(aSpecifier, aAdditionalParams);
return initializer;
} else {
- throw new InstantiationException("Unexpected CasInitializer-"
- + initializer.getClass().getName());
+ throw new InstantiationException(
+ "Unexpected CasInitializer-" + initializer.getClass().getName());
}
}
// if an exception occurs, log it but do not throw it... yet
@@ -755,31 +775,33 @@
new Object[] { className, aSpecifier.getSourceUrlString() }, e);
} catch (IllegalAccessException e) {
throw new ResourceInitializationException(
- ResourceInitializationException.COULD_NOT_INSTANTIATE, new Object[] { className,
- aSpecifier.getSourceUrlString() }, e);
+ ResourceInitializationException.COULD_NOT_INSTANTIATE,
+ new Object[] { className, aSpecifier.getSourceUrlString() }, e);
} catch (InstantiationException e) {
throw new ResourceInitializationException(
- ResourceInitializationException.COULD_NOT_INSTANTIATE, new Object[] { className,
- aSpecifier.getSourceUrlString() }, e);
+ ResourceInitializationException.COULD_NOT_INSTANTIATE,
+ new Object[] { className, aSpecifier.getSourceUrlString() }, e);
}
}
/**
* Returns a descriptor path associated with Cas Processor.
*
- * @param aCasProcessorCfg -
- * Cas Processor configuration
+ * @param aCasProcessorCfg
+ * - Cas Processor configuration
* @return - Descriptor path
- * @throws ResourceConfigurationException -
+ * @throws ResourceConfigurationException
+ * -
*/
public URL getDescriptorURL(CpeCasProcessor aCasProcessorCfg)
throws ResourceConfigurationException {
if (aCasProcessorCfg.getCpeComponentDescriptor() == null) {
- throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
- "descriptor", "casProcessor" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_xml_element__WARNING",
- new Object[] { Thread.currentThread().getName(), aCasProcessorCfg.getName(),
- "descriptor" })));
+ throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
+ new Object[] { "descriptor", "casProcessor" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), aCasProcessorCfg.getName(),
+ "descriptor" })));
}
return aCasProcessorCfg.getCpeComponentDescriptor().findAbsoluteUrl(getResourceManager());
}
@@ -787,10 +809,12 @@
/**
* Instantiates a ResourceSpecifier from a given URL.
*
- * @param aDescriptorUrl - URL of descriptor
+ * @param aDescriptorUrl
+ * - URL of descriptor
* @return - ResourceSpecifier
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
public ResourceSpecifier getSpecifier(URL aDescriptorUrl) throws Exception {
XMLInputSource in = new XMLInputSource(aDescriptorUrl);
@@ -801,18 +825,21 @@
/**
* Instantiates a local (managed) Cas Processor.
*
- * @param aCasProcessorCfg -
- * Cas Processor configuration
+ * @param aCasProcessorCfg
+ * - Cas Processor configuration
* @return - Local CasProcessor
- * @throws ResourceConfigurationException -
+ * @throws ResourceConfigurationException
+ * -
*/
private CasProcessor produceLocalCasProcessor(CpeCasProcessor aCasProcessorCfg)
throws ResourceConfigurationException {
if (aCasProcessorCfg == null) {
- throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
- "casProcessor", "casProcessors" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING",
- new Object[] { Thread.currentThread().getName() })));
+ throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
+ new Object[] { "casProcessor", "casProcessors" },
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
CasProcessor casProcessor = new NetworkCasProcessorImpl(aCasProcessorCfg);
return casProcessor;
@@ -821,13 +848,13 @@
/**
* Find a parameter with a given name in the in-memory component descriptor.
*
- * @param aCps -
- * parameter settings from the component's descriptor
- * @param aParamName -
- * name of the parameter to look for
+ * @param aCps
+ * - parameter settings from the component's descriptor
+ * @param aParamName
+ * - name of the parameter to look for
* @return - parameter as {@link NameValuePair} instance. If not found, returns null.
- * @throws Exception -
- * any error
+ * @throws Exception
+ * - any error
*/
private NameValuePair findMatchingNameValuePair(ConfigurationParameterSettings aCps,
String aParamName) throws Exception {
@@ -848,20 +875,23 @@
/**
* Replace a primitive value of a given parameter with a value defined in the CPE descriptor.
*
- * @param aType -
- * type of the primitive value ( String, Integer, Boolean, or Float)
- * @param aMandatoryParam the a mandatory param
- * @param aCps -
- * parameter settings from the component's descriptor
- * @param aCPE_nvp -
- * parameter containing array of values to replace values in the component's descriptor
- * @param aComponentName the a component name
- * @throws Exception -
+ * @param aType
+ * - type of the primitive value ( String, Integer, Boolean, or Float)
+ * @param aMandatoryParam
+ * the a mandatory param
+ * @param aCps
+ * - parameter settings from the component's descriptor
+ * @param aCPE_nvp
+ * - parameter containing array of values to replace values in the component's descriptor
+ * @param aComponentName
+ * the a component name
+ * @throws Exception
+ * -
*/
private void replacePrimitive(String aType, boolean aMandatoryParam,
ConfigurationParameterSettings aCps,
- org.apache.uima.collection.metadata.NameValuePair aCPE_nvp,
- String aComponentName) throws Exception {
+ org.apache.uima.collection.metadata.NameValuePair aCPE_nvp, String aComponentName)
+ throws Exception {
boolean newParamSetting = false;
// Get a new value for the primitive param
@@ -896,21 +926,23 @@
* Replace array values found in the component's descriptor with values found in the CPE
* descriptor.
*
- * @param aType -
- * primitive type of the array (Sting, Integer, Float, or Boolean)
- * @param aMandatoryParam the a mandatory param
- * @param aCps -
- * parameter settings from the component's descriptor
- * @param aCPE_nvp -
- * parameter containing array of values to replace values in the component's descriptor
- * @param aComponentName the a component name
- * @throws Exception -
- * any error
+ * @param aType
+ * - primitive type of the array (Sting, Integer, Float, or Boolean)
+ * @param aMandatoryParam
+ * the a mandatory param
+ * @param aCps
+ * - parameter settings from the component's descriptor
+ * @param aCPE_nvp
+ * - parameter containing array of values to replace values in the component's descriptor
+ * @param aComponentName
+ * the a component name
+ * @throws Exception
+ * - any error
*/
private void replaceArray(String aType, boolean aMandatoryParam,
ConfigurationParameterSettings aCps,
- org.apache.uima.collection.metadata.NameValuePair aCPE_nvp,
- String aComponentName) throws Exception {
+ org.apache.uima.collection.metadata.NameValuePair aCPE_nvp, String aComponentName)
+ throws Exception {
boolean newParamSetting = false;
Object valueObject = aCPE_nvp.getValue();
String param_name = aCPE_nvp.getName();
@@ -942,19 +974,20 @@
* Override component's parameters. This overridde effects the in-memory settings. The actual
* component's descriptor will not be changed.
*
- * @param aResourceSpecifier -
- * in-memory descriptor of the component
- * @param aCPE_nvp -
- * parameter represented as name-value pair. If the name of the parameter is found in the
- * component's descriptor its value will be changed.
- * @param aComponentName the a component name
+ * @param aResourceSpecifier
+ * - in-memory descriptor of the component
+ * @param aCPE_nvp
+ * - parameter represented as name-value pair. If the name of the parameter is found in
+ * the component's descriptor its value will be changed.
+ * @param aComponentName
+ * the a component name
* @return true, if successful
- * @throws Exception -
- * error during processing
+ * @throws Exception
+ * - error during processing
*/
private boolean overrideParameterIfExists(ResourceSpecifier aResourceSpecifier,
- org.apache.uima.collection.metadata.NameValuePair aCPE_nvp,
- String aComponentName) throws Exception {
+ org.apache.uima.collection.metadata.NameValuePair aCPE_nvp, String aComponentName)
+ throws Exception {
// Retrieve component's parameter settings from the in-memory descriptor
ConfigurationParameterDeclarations cpd = ((ResourceCreationSpecifier) aResourceSpecifier)
.getMetaData().getConfigurationParameterDeclarations();
@@ -977,8 +1010,7 @@
replaceArray(cparam.getType(), mandatory, cps, aCPE_nvp, aComponentName);
} else {
// Override primitive parameter with value from the CPE descriptor
- replacePrimitive(cparam.getType(), mandatory, cps, aCPE_nvp,
- aComponentName);
+ replacePrimitive(cparam.getType(), mandatory, cps, aCPE_nvp, aComponentName);
}
return true; // Found a match and did the override
}
@@ -991,16 +1023,18 @@
* Replace component's parameters. Its parameter values will be changed to match those defined in
* the CPE descriptor.
*
- * @param aResourceSpecifier -
- * component's descriptor containing parameters to override
- * @param aCpe_cps the a cpe cps
- * @param aComponentName the a component name
- * @throws Exception -
- * failure during processing
+ * @param aResourceSpecifier
+ * - component's descriptor containing parameters to override
+ * @param aCpe_cps
+ * the a cpe cps
+ * @param aComponentName
+ * the a component name
+ * @throws Exception
+ * - failure during processing
*/
private void overrideParameterSettings(ResourceSpecifier aResourceSpecifier,
- CasProcessorConfigurationParameterSettings aCpe_cps,
- String aComponentName) throws Exception {
+ CasProcessorConfigurationParameterSettings aCpe_cps, String aComponentName)
+ throws Exception {
if (aCpe_cps != null && aCpe_cps.getParameterSettings() != null) {
// Extract new parameters from the CPE descriptor
@@ -1019,9 +1053,11 @@
/**
* Instantiates integrated Cas Processor.
*
- * @param aCasProcessorType the a cas processor type
+ * @param aCasProcessorType
+ * the a cas processor type
* @return - Integrated CasProcessor
- * @throws ResourceConfigurationException -
+ * @throws ResourceConfigurationException
+ * -
*/
private CasProcessor produceIntegratedCasProcessor(CpeCasProcessor aCasProcessorType)
throws ResourceConfigurationException {
@@ -1046,9 +1082,9 @@
}
// Replace parameters in component descriptor with values defined in the CPE descriptor
- overrideParameterSettings(resourceSpecifier, aCasProcessorType
- .getConfigurationParameterSettings(), "CasProcessor:"
- + aCasProcessorType.getName());
+ overrideParameterSettings(resourceSpecifier,
+ aCasProcessorType.getConfigurationParameterSettings(),
+ "CasProcessor:" + aCasProcessorType.getName());
// create child UimaContext and insert into mInitParams map
UimaContextAdmin childContext = uimaContext.createChild(aCasProcessorType.getName(),
@@ -1058,7 +1094,8 @@
// need this check to do specific CasDataConsumer processing
if (resourceSpecifier instanceof CasConsumerDescription
- && !isDefinitionInstanceOf(CasConsumer.class, resourceSpecifier, descriptorUrl.toString())) {
+ && !isDefinitionInstanceOf(CasConsumer.class, resourceSpecifier,
+ descriptorUrl.toString())) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
"process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
@@ -1079,8 +1116,8 @@
// Check if CasProcesser has been instantiated
if (casProcessor == null) {
- throw new ResourceConfigurationException(new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ throw new ResourceConfigurationException(new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_instantiation_exception__WARNING", new Object[] {
Thread.currentThread().getName(), aCasProcessorType.getName() })));
}
@@ -1095,7 +1132,7 @@
// Override the name of the component with the name specified in the cpe descriptor
// Uniqueness of names is enforced on names in the cpe descriptor not those defined
// in the component descriptor
- if ( casProcessor != null && aCasProcessorType != null ) {
+ if (casProcessor != null && aCasProcessorType != null) {
casProcessor.getProcessingResourceMetaData().setName(aCasProcessorType.getName());
}
@@ -1106,9 +1143,11 @@
/**
* Instantiates remote Cas Processor.
*
- * @param aCasProcessorType the a cas processor type
+ * @param aCasProcessorType
+ * the a cas processor type
* @return - Remote CasProcessor
- * @throws ResourceConfigurationException -
+ * @throws ResourceConfigurationException
+ * -
*/
private CasProcessor produceRemoteCasProcessor(CpeCasProcessor aCasProcessorType)
throws ResourceConfigurationException {
@@ -1133,10 +1172,12 @@
* <li>Number of documents to process</li>
* <li>Checkpoint configuration</li>
* <li>id of the document begin processing</li>
- * </ul>.
+ * </ul>
+ * .
*
* @return Global CPE Configuration
- * @throws InstantiationException the instantiation exception
+ * @throws InstantiationException
+ * the instantiation exception
*/
public CpeConfiguration getCPEConfig() throws InstantiationException {
try {
@@ -1150,7 +1191,8 @@
* Returns number of processing threads (Processing Units).
*
* @return Number of processing threads
- * @throws ResourceConfigurationException -
+ * @throws ResourceConfigurationException
+ * -
*/
public int getProcessingUnitThreadCount() throws ResourceConfigurationException {
int threadCount;
@@ -1160,8 +1202,9 @@
} catch (Exception e) {
throw new ResourceConfigurationException(InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING,
- new Object[] { "processingUnitThreadCount" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ new Object[] { "processingUnitThreadCount" },
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING",
new Object[] { Thread.currentThread().getName(), "casProcessors",
"processingUnitThreadCount", "<casProcessors>", })));
@@ -1191,7 +1234,8 @@
/**
* Assigns Cpe configuration to use.
*
- * @param description the new cpe descriptor
+ * @param description
+ * the new cpe descriptor
*/
private void setCpeDescriptor(CpeDescription description) {
cpeDescriptor = description;
@@ -1201,10 +1245,11 @@
* Checks uniqueness of a given name. This name is compared against all Cas Processors already
* defined. Cas Processor names must be unique.
*
- * @param aName -
- * name to check
+ * @param aName
+ * - name to check
* @return - true if name is unique, false otherwise
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
private boolean isUniqueName(String aName) throws CpeDescriptorException {
int index = 0;
@@ -1227,17 +1272,20 @@
* vnsPort. If not found the remote CasProcessor can not be located since the VNS is not
* specified. In this case an exception is thrown.
*
- * @param aCasProcessorName the a cas processor name
- * @param aDepParams the a dep params
- * @throws ResourceConfigurationException -
+ * @param aCasProcessorName
+ * the a cas processor name
+ * @param aDepParams
+ * the a dep params
+ * @throws ResourceConfigurationException
+ * -
*/
private void verifyDeploymentParams(String aCasProcessorName,
CasProcessorDeploymentParams aDepParams) throws ResourceConfigurationException {
if (aDepParams == null) {
- throw new ResourceConfigurationException(new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
- Thread.currentThread().getName(), aCasProcessorName,
+ throw new ResourceConfigurationException(
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), aCasProcessorName,
"<deploymentParameters>" })));
}
if (aDepParams == null || aDepParams.getAll() == null) {
@@ -1249,11 +1297,11 @@
if (param == null || param.getParameterValue() == null
|| param.getParameterValue().trim().length() == 0) {
throw new ResourceConfigurationException(
- ResourceInitializationException.CONFIG_SETTING_ABSENT,
- new Object[] { "parameter" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_deploy_params_not_defined__WARNING", new Object[] {
- Thread.currentThread().getName(), aCasProcessorName,
+ ResourceInitializationException.CONFIG_SETTING_ABSENT, new Object[] { "parameter" },
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_deploy_params_not_defined__WARNING",
+ new Object[] { Thread.currentThread().getName(), aCasProcessorName,
Constants.VNS_HOST })));
}
@@ -1261,11 +1309,11 @@
if (param == null || param.getParameterValue() == null
|| param.getParameterValue().trim().length() == 0) {
throw new ResourceConfigurationException(
- ResourceInitializationException.CONFIG_SETTING_ABSENT,
- new Object[] { "parameter" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_deploy_params_not_defined__WARNING", new Object[] {
- Thread.currentThread().getName(), aCasProcessorName,
+ ResourceInitializationException.CONFIG_SETTING_ABSENT, new Object[] { "parameter" },
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_deploy_params_not_defined__WARNING",
+ new Object[] { Thread.currentThread().getName(), aCasProcessorName,
Constants.VNS_PORT })));
}
@@ -1315,9 +1363,10 @@
/**
* Appends given Cas Processor to the list of CasProcessors.
*
- * @param aCasProcessor -
- * CasProcessor to add
- * @throws ResourceConfigurationException the resource configuration exception
+ * @param aCasProcessor
+ * - CasProcessor to add
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
public void addCasProcessor(CasProcessor aCasProcessor) throws ResourceConfigurationException {
if (!initialized) {
@@ -1328,42 +1377,40 @@
/**
* Adds new Cas Processor with given name.
*
- * @param aCasProcessorName -
- * name of the CasProcessor to add
+ * @param aCasProcessorName
+ * - name of the CasProcessor to add
* @return -
- * @throws ResourceConfigurationException the resource configuration exception
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
private CpeCasProcessor addCasProcessor(String aCasProcessorName)
throws ResourceConfigurationException {
CpeCasProcessor newProcessor = null;
try {
if (!isUniqueName(aCasProcessorName)) {
- throw new ResourceConfigurationException(new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_duplicate_name__WARNING", new Object[] {
- Thread.currentThread().getName(), aCasProcessorName })));
+ throw new ResourceConfigurationException(
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_duplicate_name__WARNING",
+ new Object[] { Thread.currentThread().getName(), aCasProcessorName })));
}
int index = getCpeDescriptor().getCpeCasProcessors().getAllCpeCasProcessors().length; // getcasProcessorCount();
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_add_cp_with_index__FINEST",
- new Object[] { Thread.currentThread().getName(), aCasProcessorName,
- String.valueOf(index) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_add_cp_with_index__FINEST", new Object[] {
+ Thread.currentThread().getName(), aCasProcessorName, String.valueOf(index) });
}
- CpeCasProcessor processor = getCpeDescriptor().getCpeCasProcessors().getCpeCasProcessor(
- index - 1);
+ CpeCasProcessor processor = getCpeDescriptor().getCpeCasProcessors()
+ .getCpeCasProcessor(index - 1);
if (processor.getCheckpoint() == null) {
throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
- new Object[] { "checkpoint", "casProcessor" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
- Thread.currentThread().getName(), aCasProcessorName,
+ new Object[] { "checkpoint", "casProcessor" },
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_missing_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), aCasProcessorName,
"<checkpoint>" })));
}
@@ -1393,26 +1440,21 @@
// newProcessor);
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).log(
- Level.FINEST,
+ UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
"getCpeDescriptor().getCasProcessors().getCasProcessor.getAttributeValue(name) "
+ + " " + getCpeDescriptor().getCpeCasProcessors()
+ .getCpeCasProcessor(processorCount).getAttributeValue("name"));
+ UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
+ "getCpeDescriptor().getCasProcessors().getCasProcessor("
+ + "processorCount).getErrorHandling().getMaxConsecutiveRestarts().getAction() "
+ " "
- + getCpeDescriptor().getCpeCasProcessors().getCpeCasProcessor(
- processorCount).getAttributeValue("name"));
- UIMAFramework
- .getLogger(this.getClass())
- .log(
- Level.FINEST,
- "getCpeDescriptor().getCasProcessors().getCasProcessor("
- + "processorCount).getErrorHandling().getMaxConsecutiveRestarts().getAction() "
- + " "
- + getCpeDescriptor().getCpeCasProcessors().getCpeCasProcessor(
- processorCount).getErrorHandling()
- .getMaxConsecutiveRestarts().getAction());
+ + getCpeDescriptor().getCpeCasProcessors()
+ .getCpeCasProcessor(processorCount).getErrorHandling()
+ .getMaxConsecutiveRestarts().getAction());
}
if (!casProcessorConfigMap.containsKey(aCasProcessorName)) {
- casProcessorConfigMap.put(aCasProcessorName, getCpeDescriptor().getCpeCasProcessors()
- .getCpeCasProcessor(processorCount));
+ casProcessorConfigMap.put(aCasProcessorName,
+ getCpeDescriptor().getCpeCasProcessors().getCpeCasProcessor(processorCount));
}
} catch (Exception e) {
throw new ResourceConfigurationException(e);
@@ -1424,9 +1466,11 @@
/**
* Gets the descriptor.
*
- * @param aList the a list
+ * @param aList
+ * the a list
* @return the cpe descriptor constructed from the list
- * @throws ResourceConfigurationException -
+ * @throws ResourceConfigurationException
+ * -
*/
public String getDescriptor(List aList) throws ResourceConfigurationException {
if (aList.size() == 0) {
@@ -1513,22 +1557,19 @@
/**
* Copy cas processor.
*
- * @param aProcDesc the a proc desc
- * @param aName the a name
+ * @param aProcDesc
+ * the a proc desc
+ * @param aName
+ * the a name
*/
private void copyCasProcessor(CpeCasProcessor aProcDesc, String aName) {
try {
aProcDesc.setName(aName);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass())
- .logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_cp_deployment__FINEST",
- new Object[] { Thread.currentThread().getName(), aName,
- aProcDesc.getDeployment() });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_show_cp_deployment__FINEST", new Object[] {
+ Thread.currentThread().getName(), aName, aProcDesc.getDeployment() });
}
} catch (Exception e) {
e.printStackTrace();
@@ -1538,8 +1579,8 @@
/**
* Adds the collection reader.
*
- * @param collectionReader -
- * collection reader to use by the CPM
+ * @param collectionReader
+ * - collection reader to use by the CPM
*/
public void addCollectionReader(BaseCollectionReader collectionReader) {
// nothing done as of now; If there is any field that will be accessed
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CasObjectNetworkCasProcessorImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CasObjectNetworkCasProcessorImpl.java
index 1132cc9..4eadd2f 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CasObjectNetworkCasProcessorImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CasObjectNetworkCasProcessorImpl.java
@@ -46,7 +46,6 @@
import org.apache.uima.util.Level;
import org.apache.uima.util.ProcessTrace;
-
/**
* Implementation of the {@link CasObjectProcessor} interface used for both Local and Remote
* CasObjectProcessors. This objects plugs in a transport object defined in the CPE Descriptor and
@@ -54,7 +53,7 @@
*
*/
public class CasObjectNetworkCasProcessorImpl implements CasObjectProcessor {
-
+
/** The transport. */
private SocketTransport transport = null;
@@ -74,9 +73,10 @@
* Using information from the CPE descriptor creates an instance of Transport class. The transport
* class will delegate analysis of CAS to a remote object.
*
- * @param aCasProcessor -
- * Cas Process configuration from the CPE descriptor
- * @throws ResourceConfigurationException the resource configuration exception
+ * @param aCasProcessor
+ * - Cas Process configuration from the CPE descriptor
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
public CasObjectNetworkCasProcessorImpl(CpeCasProcessor aCasProcessor)
throws ResourceConfigurationException {
@@ -106,7 +106,8 @@
}
} else {
throw new ResourceConfigurationException(InvalidXMLException.INVALID_CPE_DESCRIPTOR,
- new Object[] { "transport" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ new Object[] { "transport" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_transport__WARNING",
new Object[] { Thread.currentThread().getName() })));
@@ -122,10 +123,11 @@
/**
* Create Transport object from a given class and associate it with this CasProcessor.
*
- * @param aTransportClass -
- * name of the Transport class
+ * @param aTransportClass
+ * - name of the Transport class
* @return - instance of SocketTransport
- * @throws Exception passthru
+ * @throws Exception
+ * passthru
*/
private SocketTransport pluginTransport(String aTransportClass) throws Exception {
Object instance = Class.forName(aTransportClass).newInstance();
@@ -154,9 +156,10 @@
/**
* Connects to a service endpoint defined in the given URL.
*
- * @param aURL -
- * contains service endpoint info (hots and port)
- * @throws ResourceInitializationException wraps SocketException
+ * @param aURL
+ * - contains service endpoint info (hots and port)
+ * @throws ResourceInitializationException
+ * wraps SocketException
*/
public void connect(URL aURL) throws ResourceInitializationException {
try {
@@ -170,8 +173,10 @@
/**
* Uses configured transport to delegate given CAS to the remote service.
*
- * @param aCAS CAS to be analyzed
- * @throws ResourceProcessException wraps Exception, SocketException
+ * @param aCAS
+ * CAS to be analyzed
+ * @throws ResourceProcessException
+ * wraps Exception, SocketException
*/
@Override
public void processCas(CAS aCAS) throws ResourceProcessException {
@@ -188,8 +193,10 @@
/**
* Uses configured transport to delegate given CASes to the remote service.
*
- * @param aCASes - an array of CASes to be analyzed
- * @throws ResourceProcessException wraps SocketException, SocketTimeoutException
+ * @param aCASes
+ * - an array of CASes to be analyzed
+ * @throws ResourceProcessException
+ * wraps SocketException, SocketTimeoutException
*/
@Override
public void processCas(CAS[] aCASes) throws ResourceProcessException {
@@ -208,7 +215,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.base_cpm.CasObjectProcessor#typeSystemInit(org.apache.uima.cas.TypeSystem)
+ * @see org.apache.uima.collection.base_cpm.CasObjectProcessor#typeSystemInit(org.apache.uima.cas.
+ * TypeSystem)
*/
@Override
public void typeSystemInit(TypeSystem aTypeSystem) throws ResourceInitializationException {
@@ -264,11 +272,13 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.base_cpm.CasProcessor#batchProcessComplete(org.apache.uima.util.ProcessTrace)
+ * @see
+ * org.apache.uima.collection.base_cpm.CasProcessor#batchProcessComplete(org.apache.uima.util.
+ * ProcessTrace)
*/
@Override
- public void batchProcessComplete(ProcessTrace aTrace) throws ResourceProcessException,
- IOException {
+ public void batchProcessComplete(ProcessTrace aTrace)
+ throws ResourceProcessException, IOException {
// noop
}
@@ -276,13 +286,16 @@
/**
* Closes the connection to the remote service.
*
- * @param aTrace the a trace
- * @throws ResourceProcessException the resource process exception
- * @throws IOException Signals that an I/O exception has occurred.
+ * @param aTrace
+ * the a trace
+ * @throws ResourceProcessException
+ * the resource process exception
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
*/
@Override
- public void collectionProcessComplete(ProcessTrace aTrace) throws ResourceProcessException,
- IOException {
+ public void collectionProcessComplete(ProcessTrace aTrace)
+ throws ResourceProcessException, IOException {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
"process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_stopping_cp__FINEST",
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CasProcessorConfigurationJAXBImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CasProcessorConfigurationJAXBImpl.java
index 9ed129c..f082784 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CasProcessorConfigurationJAXBImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/CasProcessorConfigurationJAXBImpl.java
@@ -98,37 +98,34 @@
private boolean parallelizable = true; // default
private boolean readOnly = false; // make this explicit
-
+
private ResourceManager resourceManager;
-
+
/**
* Initializes instance and copies configuation from cpe descriptor.
*
- * @param aCasProcessorConfig -
- * configuration object containing Cas Processor configuration
- * @param aResourceManager -
- * needed to resolve import by name
- * @throws ResourceConfigurationException if descriptor error
+ * @param aCasProcessorConfig
+ * - configuration object containing Cas Processor configuration
+ * @param aResourceManager
+ * - needed to resolve import by name
+ * @throws ResourceConfigurationException
+ * if descriptor error
*/
- public CasProcessorConfigurationJAXBImpl(CpeCasProcessor aCasProcessorConfig, ResourceManager aResourceManager)
- throws ResourceConfigurationException {
+ public CasProcessorConfigurationJAXBImpl(CpeCasProcessor aCasProcessorConfig,
+ ResourceManager aResourceManager) throws ResourceConfigurationException {
this.resourceManager = aResourceManager;
-
+
if (aCasProcessorConfig == null) {
- throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
- "<casProcessor>", "<casProcessors>" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_bad_cpe_descriptor__WARNING", new Object[] { Thread
- .currentThread().getName() })));
+ throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
+ new Object[] { "<casProcessor>", "<casProcessors>" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_cpe_descriptor__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
name = aCasProcessorConfig.getName();// getAttributeValue("name");
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_max_restart_action__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_max_restart_action__FINEST",
new Object[] { Thread.currentThread().getName(), name,
aCasProcessorConfig.getErrorHandling().getMaxConsecutiveRestarts().getAction() });
}
@@ -149,7 +146,7 @@
"UIMA_CPM_config_non_java_service__FINEST",
new Object[] { Thread.currentThread().getName(), name });
}
- nonJavaApp = new NonJavaApplication(this, aCasProcessorConfig);
+ nonJavaApp = new NonJavaApplication(this, aCasProcessorConfig);
} else {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
@@ -190,8 +187,8 @@
/**
* Copies runtime information
*
- * @param aJaxbCasProcessorConfig -
- * configuration object containing Cas Processor configuration
+ * @param aJaxbCasProcessorConfig
+ * - configuration object containing Cas Processor configuration
*/
private void addRunInSeparateProcess(CpeCasProcessor aCasProcessorConfig) {
runInSeparateProcess = aCasProcessorConfig.getRunInSeparateProcess() != null;
@@ -200,8 +197,8 @@
/**
* Determines if this Cas Processor should run in java jvm.
*
- * @param aJaxbCasProcessorConfig -
- * configuration object containing Cas Processor configuration
+ * @param aJaxbCasProcessorConfig
+ * - configuration object containing Cas Processor configuration
*/
private void addIsJavaProcess(CpeCasProcessor aCasProcessorConfig) {
isJavaProcess = false;
@@ -216,28 +213,29 @@
/**
* Copies Error handling settings
*
- * @param aJaxbCasProcessorConfig -
- * configuration object containing Cas Processor configuration
+ * @param aJaxbCasProcessorConfig
+ * - configuration object containing Cas Processor configuration
*/
private void addErrorHandling(CpeCasProcessor aCasProcessorConfig)
throws ResourceConfigurationException {
CasProcessorErrorHandling casProcessorErrorHandling = aCasProcessorConfig.getErrorHandling();
if (casProcessorErrorHandling == null) {
- throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
- "errorHandling", "casProcessor" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_xml_element__WARNING",
- new Object[] { Thread.currentThread().getName(), name, "<errorHandling>" })));
+ throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
+ new Object[] { "errorHandling", "casProcessor" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), name, "<errorHandling>" })));
}
CasProcessorMaxRestarts maxRestarts = casProcessorErrorHandling.getMaxConsecutiveRestarts();
if (maxRestarts == null) {
throw new ResourceConfigurationException(
- ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] {
- "maxConsecutiveRestarts", "CPE" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
- Thread.currentThread().getName(), name,
- "<maxConsecutiveRestarts>" })));
+ ResourceConfigurationException.MANDATORY_VALUE_MISSING,
+ new Object[] { "maxConsecutiveRestarts", "CPE" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), name,
+ "<maxConsecutiveRestarts>" })));
}
maxRetryThreshold = maxRestarts.getRestartCount();
waitTimeBetweenRestarts = maxRestarts.getWaitTimeBetweenRetries();
@@ -246,8 +244,9 @@
if (!validActionOnError(maxRestarts.getAction())) {
throw new ResourceConfigurationException(
- ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] { "action",
- "CPE" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ ResourceConfigurationException.MANDATORY_VALUE_MISSING,
+ new Object[] { "action", "CPE" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_action_string__WARNING",
new Object[] { Thread.currentThread().getName(), name,
"<maxConsecutiveRestarts>", maxRestarts.getAction() })));
@@ -259,12 +258,12 @@
.getErrorRateThreshold();
if (errorRateThresholdType == null) {
throw new ResourceConfigurationException(
- ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] {
- "errorRateThreshold", "CPE" },
+ ResourceConfigurationException.MANDATORY_VALUE_MISSING,
+ new Object[] { "errorRateThreshold", "CPE" },
new Exception(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
- Thread.currentThread().getName(), name, "<errorRateThreshold>" })));
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), name,
+ "<errorRateThreshold>" })));
}
errorRate = errorRateThresholdType.getMaxErrorCount();
@@ -272,11 +271,12 @@
if (!validActionOnError(errorRateThresholdType.getAction())) {
throw new ResourceConfigurationException(
- ResourceConfigurationException.MANDATORY_VALUE_MISSING, new Object[] { "action",
- "CPE" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ ResourceConfigurationException.MANDATORY_VALUE_MISSING,
+ new Object[] { "action", "CPE" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_bad_action_string__WARNING",
- new Object[] { Thread.currentThread().getName(), name,
- "<errorRateThreshold>", maxRestarts.getAction() })));
+ new Object[] { Thread.currentThread().getName(), name, "<errorRateThreshold>",
+ maxRestarts.getAction() })));
}
actionOnMaxError = errorRateThresholdType.getAction();
@@ -290,17 +290,18 @@
* Copies deployment parameters associated with this Cas Processor These parameters are used to
* construct appropriate command line for launching the Cas Processor in external process
*
- * @param aJaxbCasProcessorConfig -
- * configuration object containing Cas Processor configuration
+ * @param aJaxbCasProcessorConfig
+ * - configuration object containing Cas Processor configuration
*/
private void addDeploymentParameters(CpeCasProcessor aCasProcessorConfig)
throws ResourceConfigurationException {
if (aCasProcessorConfig == null) {
- throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
- "<casProcessor>", "<casProcessors>" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING", new Object[] { Thread
- .currentThread().getName() })));
+ throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
+ new Object[] { "<casProcessor>", "<casProcessors>" },
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
CasProcessorDeploymentParams deployParams = aCasProcessorConfig.getDeploymentParams();
@@ -309,11 +310,8 @@
for (int i = 0; parameters != null && i < parameters.length; i++) {
try {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_show_cp_deploy_params__FINEST",
new Object[] { Thread.currentThread().getName(), name,
parameters[i].getParameterName(), parameters[i].getParameterValue() });
@@ -349,27 +347,31 @@
/**
* Copies deployment type associated with this Cas Processor
*
- * @param aJaxbCasProcessorConfig - -
- * configuration object containing Cas Processor configuration
- * @throws ResourceConfigurationException -
+ * @param aJaxbCasProcessorConfig
+ * - - configuration object containing Cas Processor configuration
+ * @throws ResourceConfigurationException
+ * -
*/
private void addDeploymentType(CpeCasProcessor aCasProcessorConfig)
throws ResourceConfigurationException {
if (aCasProcessorConfig == null) {
- throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
- "<casProcessor>", "<casProcessors>" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING", new Object[] { Thread
- .currentThread().getName() })));
+ throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
+ new Object[] { "<casProcessor>", "<casProcessors>" },
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
String deployType = aCasProcessorConfig.getDeployment();
if (deployType == null || deployType.trim().length() == 0) {
throw new ResourceConfigurationException(InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING,
- new Object[] { "deployment", "casProcessor" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ new Object[] { "deployment", "casProcessor" },
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING",
new Object[] { Thread.currentThread().getName(),
- aCasProcessorConfig.getName(), "deployment", "<casProcessor>" })));
+ aCasProcessorConfig.getName(), "deployment",
+ "<casProcessor>" })));
}
deploymentType = deployType;
}
@@ -377,17 +379,18 @@
/**
* Copies filter expression used during processing.
*
- * @param aJaxbCasProcessorConfig -
- * configuration object containing Cas Processor configuration
+ * @param aJaxbCasProcessorConfig
+ * - configuration object containing Cas Processor configuration
*/
private void addFiltering(CpeCasProcessor aCasProcessorConfig)
throws ResourceConfigurationException {
if (aCasProcessorConfig == null) {
- throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
- "<casProcessor>", "<casProcessors>" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING", new Object[] { Thread
- .currentThread().getName() })));
+ throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
+ new Object[] { "<casProcessor>", "<casProcessors>" },
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
filterString = aCasProcessorConfig.getCasProcessorFilter();
}
@@ -395,26 +398,27 @@
/**
* Copies batch size associated with this Cas Processor
*
- * @param aJaxbCasProcessorConfig -
- * configuration object containing Cas Processor configuration
+ * @param aJaxbCasProcessorConfig
+ * - configuration object containing Cas Processor configuration
*/
private void addBatchSize(CpeCasProcessor aCasProcessorConfig)
throws ResourceConfigurationException {
if (aCasProcessorConfig == null) {
- throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
- "<casProcessor>", "<casProcessors>" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING", new Object[] { Thread
- .currentThread().getName() })));
+ throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
+ new Object[] { "<casProcessor>", "<casProcessors>" },
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
CpeCheckpoint checkpoint = aCasProcessorConfig.getCheckpoint();
if (checkpoint == null) {
- throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
- "<checkpoint>", "<casProcessor>" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
- Thread.currentThread().getName(), aCasProcessorConfig.getName(),
- "<checkpoint>" })));
+ throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
+ new Object[] { "<checkpoint>", "<casProcessor>" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(),
+ aCasProcessorConfig.getName(), "<checkpoint>" })));
}
try {
@@ -423,8 +427,9 @@
}
} catch (NumberFormatException e) {
throw new ResourceConfigurationException(InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING,
- new Object[] { "batch", "<checkpoint>" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ new Object[] { "batch", "<checkpoint>" },
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING",
new Object[] { Thread.currentThread().getName(),
aCasProcessorConfig.getName(), "batch", "<checkpoint>" })));
@@ -435,31 +440,34 @@
/**
* Copies path of the Cas Processor descriptor.
*
- * @param aJaxbCasProcessorConfig -
- * configuration object holding path to the descriptor
+ * @param aJaxbCasProcessorConfig
+ * - configuration object holding path to the descriptor
*
- * @throws ResourceConfigurationException -
+ * @throws ResourceConfigurationException
+ * -
*/
private void addDescriptor(CpeCasProcessor aCasProcessorConfig)
throws ResourceConfigurationException {
if (aCasProcessorConfig == null) {
- throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
- "<casProcessor>", "<casProcessors>" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING", new Object[] { Thread
- .currentThread().getName() })));
+ throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
+ new Object[] { "<casProcessor>", "<casProcessors>" },
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
descriptor = aCasProcessorConfig.getCpeComponentDescriptor();
-
+
if (descriptor.getInclude() != null) {
String descPath = descriptor.getInclude().get();
if (descPath == null || descPath.trim().length() == 0) {
- throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND, new Object[] {
- "href", "include" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING", new Object[] {
- Thread.currentThread().getName(), aCasProcessorConfig.getName(), "href",
- "<include>" })));
+ throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
+ new Object[] { "href", "include" },
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(),
+ aCasProcessorConfig.getName(), "href", "<include>" })));
}
}
@@ -474,8 +482,8 @@
* <li>kill-pipeline</li>
* <p>
*
- * @param aActionOnError -
- * action string to verify
+ * @param aActionOnError
+ * - action string to verify
*
* @return - true if action is valid, false otherwise
*/
@@ -628,8 +636,7 @@
if (filterExpression != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
- "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_cp_filter__FINEST",
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_show_cp_filter__FINEST",
new Object[] { Thread.currentThread().getName(), name, filterExpression });
}
Filter filter = new Filter();
@@ -637,10 +644,10 @@
}
} catch (Exception e) {
throw new ResourceConfigurationException(InvalidXMLException.INVALID_ELEMENT_TEXT,
- new Object[] { "filter" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
- Thread.currentThread().getName(), name, "filer" })));
+ new Object[] { "filter" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), name, "filer" })));
}
return null;
}
@@ -669,10 +676,10 @@
}
} catch (Exception e) {
throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
- new Object[] { "parameter" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_xml_element__WARNING", new Object[] {
- Thread.currentThread().getName(), name, "parameter" })));
+ new Object[] { "parameter" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_missing_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), name, "parameter" })));
}
return null;
}
@@ -692,17 +699,19 @@
*
* @return object that identifies location of descriptor
*
- * @throws ResourceConfigurationException if an import could not be resolved
+ * @throws ResourceConfigurationException
+ * if an import could not be resolved
*/
@Override
public URL getDescriptorUrl() throws ResourceConfigurationException {
return descriptor.findAbsoluteUrl(resourceManager);
}
-
+
/**
* Returns a value for a given deployment parameter
*
- * @param aDeployParameter - name of the parameter
+ * @param aDeployParameter
+ * - name of the parameter
* @return - value for parameter name
*/
@Override
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/NetworkCasProcessorImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/NetworkCasProcessorImpl.java
index b266dde..fc1376b 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/NetworkCasProcessorImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/NetworkCasProcessorImpl.java
@@ -72,7 +72,8 @@
/**
* Initializes this instance with configuration defined in the CPE descriptor.
*
- * @param aCasProcessorType -
+ * @param aCasProcessorType
+ * -
*/
public NetworkCasProcessorImpl(CpeCasProcessor aCasProcessorType) {
casProcessorType = aCasProcessorType;
@@ -100,8 +101,8 @@
/**
* Associates a proxy to remote annotator service.
*
- * @param aTap -
- * proxy to remote service
+ * @param aTap
+ * - proxy to remote service
*/
public void setProxy(VinciTAP aTap) {
textAnalysisProxy = aTap;
@@ -129,16 +130,17 @@
* Main method used during analysis. The ProcessingUnit calls this method to initiate analysis of
* the content in the CasData instance. This handles one Cas at a time processing mode.
*
- * @param aCas - instance of CasData to analyze
+ * @param aCas
+ * - instance of CasData to analyze
* @return instance containing result of the analysis
*/
@Override
public CasData process(CasData aCas) throws ResourceProcessException {
if (textAnalysisProxy == null) {
- throw new ResourceProcessException(new Exception(Thread.currentThread().getName()
- + CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_no_proxy__WARNING", new Object[] { Thread.currentThread()
- .getName() })));
+ throw new ResourceProcessException(new Exception(
+ Thread.currentThread().getName() + CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_no_proxy__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
CasData casWithAnalysis = null;
@@ -157,11 +159,10 @@
"process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_service_down__INFO",
new Object[] { Thread.currentThread().getName(), name });
}
- throw new ResourceProcessException(new ServiceConnectionException(Thread.currentThread()
- .getName()
- + CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_service_down__WARNING", new Object[] {
- Thread.currentThread().getName(), name })));
+ throw new ResourceProcessException(new ServiceConnectionException(
+ Thread.currentThread().getName() + CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_service_down__WARNING",
+ new Object[] { Thread.currentThread().getName(), name })));
}
throw new ResourceProcessException(e);
} catch (ServiceConnectionException e) {
@@ -176,22 +177,21 @@
* Main method used during analysis. The ProcessingUnit calls this method to initiate analysis of
* the content in the CasData instance. This handles processing of multiple Cas'es at a time.
*
- * @param aCasList - array of CasData instances to analyze
+ * @param aCasList
+ * - array of CasData instances to analyze
* @return CasData - array of CasData instances containing results of the analysis
*/
@Override
public CasData[] process(CasData[] aCasList) throws ResourceProcessException {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).log(
- Level.FINEST,
- Thread.currentThread().getName()
- + " ===================================Calling Proxy");
+ UIMAFramework.getLogger(this.getClass()).log(Level.FINEST, Thread.currentThread().getName()
+ + " ===================================Calling Proxy");
}
if (textAnalysisProxy == null) {
- throw new ResourceProcessException(new Exception(Thread.currentThread().getName()
- + CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_no_proxy__WARNING", new Object[] { Thread.currentThread()
- .getName() })));
+ throw new ResourceProcessException(new Exception(
+ Thread.currentThread().getName() + CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_no_proxy__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
try {
ProcessTrace pt = new ProcessTrace_impl();
@@ -214,16 +214,16 @@
try {
resourceMetadata = textAnalysisProxy.getAnalysisEngineMetaData();
} catch (ResourceServiceException e) {
- //can't throw exception from here so just log it and return the default
+ // can't throw exception from here so just log it and return the default
UIMAFramework.getLogger(this.getClass()).log(Level.SEVERE, e.getMessage(), e);
- return true;
+ return true;
}
}
- OperationalProperties opProps = resourceMetadata.getOperationalProperties();
+ OperationalProperties opProps = resourceMetadata.getOperationalProperties();
if (opProps != null) {
return !opProps.isMultipleDeploymentAllowed();
}
- return true; //default
+ return true; // default
}
/*
@@ -237,16 +237,16 @@
try {
resourceMetadata = textAnalysisProxy.getAnalysisEngineMetaData();
} catch (ResourceServiceException e) {
- //can't throw exception from here so just log it and return the default
+ // can't throw exception from here so just log it and return the default
UIMAFramework.getLogger(this.getClass()).log(Level.SEVERE, e.getMessage(), e);
- return false;
+ return false;
}
}
- OperationalProperties opProps = resourceMetadata.getOperationalProperties();
+ OperationalProperties opProps = resourceMetadata.getOperationalProperties();
if (opProps != null) {
return !opProps.getModifiesCas();
}
- return false; //default
+ return false; // default
}
/**
@@ -269,8 +269,8 @@
"process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_no_metadata__FINEST",
new Object[] { Thread.currentThread().getName(), name });
}
- } else if (metadata.getConfigurationParameterSettings().getParameterValue(
- Constants.CAS_PROCESSOR_CONFIG) == null) {
+ } else if (metadata.getConfigurationParameterSettings()
+ .getParameterValue(Constants.CAS_PROCESSOR_CONFIG) == null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
"process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
@@ -288,8 +288,8 @@
"process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_service_down__INFO",
new Object[] { Thread.currentThread().getName(), name });
}
- throw new ResourceProcessException(new ServiceConnectionException("Service::" + name
- + " appears to be down"));
+ throw new ResourceProcessException(
+ new ServiceConnectionException("Service::" + name + " appears to be down"));
}
if (resourceMetadata == null) {
@@ -299,8 +299,7 @@
} catch (Exception e) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
- "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_unable_to_read_meta__SEVERE",
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_unable_to_read_meta__SEVERE",
new Object[] { Thread.currentThread().getName(), e });
}
}
@@ -314,8 +313,8 @@
* @see org.apache.uima.collection.base_cpm.CasProcessor#batchProcessComplete(org.apache.uima.util.ProcessTrace)
*/
@Override
- public void batchProcessComplete(ProcessTrace aTrace) throws ResourceProcessException,
- IOException {
+ public void batchProcessComplete(ProcessTrace aTrace)
+ throws ResourceProcessException, IOException {
// Check if batch noitification is disabled == 0
if (!doSendNotification()) {
return;
@@ -337,8 +336,8 @@
* @see org.apache.uima.collection.base_cpm.CasProcessor#collectionProcessComplete(org.apache.uima.util.ProcessTrace)
*/
@Override
- public void collectionProcessComplete(ProcessTrace aTrace) throws ResourceProcessException,
- IOException {
+ public void collectionProcessComplete(ProcessTrace aTrace)
+ throws ResourceProcessException, IOException {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
"process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_stopping_cp__FINEST",
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/ProcessingContainer_Impl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/ProcessingContainer_Impl.java
index 2d99722..ae943bb 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/ProcessingContainer_Impl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/ProcessingContainer_Impl.java
@@ -66,7 +66,6 @@
import org.apache.uima.util.ProcessTrace;
import org.apache.uima.util.impl.ProcessTrace_impl;
-
/**
* Manages a pool of CasProcessor instances. Provides access to CasProcessor instance to Processing
* Thread. Processing threads check out an instance of Cas Processor and when done invoking its
@@ -78,7 +77,7 @@
*/
public class ProcessingContainer_Impl extends ProcessingContainer implements RunnableContainer {
-
+
/** The Constant CONTAINER_SLEEP_TIME. */
private static final int CONTAINER_SLEEP_TIME = 100;
@@ -178,7 +177,7 @@
// access this only under monitor lock
/** The is paused. */
- // monitor.notifyall called when switching from true -> false
+ // monitor.notifyall called when switching from true -> false
private boolean isPaused = false;
/** The single fenced instance. */
@@ -201,12 +200,14 @@
* Initialize container with CasProcessor configuration and pool containing instances of
* CasProcessor instances.
*
- * @param aCasProcessorConfig -
- * CasProcessor configuration as defined in cpe descriptor
- * @param aMetaData the a meta data
- * @param aCasProcessorPool -
- * pool of CasProcessor instances
- * @throws ResourceConfigurationException the resource configuration exception
+ * @param aCasProcessorConfig
+ * - CasProcessor configuration as defined in cpe descriptor
+ * @param aMetaData
+ * the a meta data
+ * @param aCasProcessorPool
+ * - pool of CasProcessor instances
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
public ProcessingContainer_Impl(CasProcessorConfiguration aCasProcessorConfig,
ProcessingResourceMetaData aMetaData, ServiceProxyPool aCasProcessorPool)
@@ -235,7 +236,8 @@
/**
* Sets component's input/output capabilities.
*
- * @param aMetadata component capabilities
+ * @param aMetadata
+ * component capabilities
*/
@Override
public void setMetadata(ProcessingResourceMetaData aMetadata) {
@@ -250,15 +252,15 @@
// Convert the types if necessary
for (int i = 0; i < tORf.length; i++) {
newKey = tORf[i].getName();
- if (tORf[i].getName().indexOf(
- org.apache.uima.collection.impl.cpm.Constants.SHORT_DASH_TERM) > -1) {
+ if (tORf[i].getName()
+ .indexOf(org.apache.uima.collection.impl.cpm.Constants.SHORT_DASH_TERM) > -1) {
newKey = StringUtils.replaceAll(tORf[i].getName(),
org.apache.uima.collection.impl.cpm.Constants.SHORT_DASH_TERM,
org.apache.uima.collection.impl.cpm.Constants.LONG_DASH_TERM);
modified = true;
}
- if (tORf[i].getName().indexOf(
- org.apache.uima.collection.impl.cpm.Constants.SHORT_COLON_TERM) > -1) {
+ if (tORf[i].getName()
+ .indexOf(org.apache.uima.collection.impl.cpm.Constants.SHORT_COLON_TERM) > -1) {
newKey = StringUtils.replaceAll(tORf[i].getName(),
org.apache.uima.collection.impl.cpm.Constants.SHORT_COLON_TERM,
org.apache.uima.collection.impl.cpm.Constants.LONG_COLON_TERM);
@@ -277,8 +279,8 @@
/**
* Plug in deployer object used to launch/deploy the CasProcessor instance. Used for restarts.
*
- * @param aDeployer -
- * object responsible for deploying/launching CasProcessor
+ * @param aDeployer
+ * - object responsible for deploying/launching CasProcessor
*/
@Override
public void setCasProcessorDeployer(CasProcessorDeployer aDeployer) {
@@ -337,8 +339,7 @@
} else {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
- "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_logpath_not_defined__FINEST",
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_logpath_not_defined__FINEST",
new Object[] { Thread.currentThread().getName(), getName() });
}
}
@@ -348,8 +349,8 @@
/**
* Logs Cas'es that could not be processed.
*
- * @param abortedCasList -
- * an arrar of Cas'es that could not be processed by this CasProcessor
+ * @param abortedCasList
+ * - an arrar of Cas'es that could not be processed by this CasProcessor
*
*/
@Override
@@ -412,7 +413,8 @@
/**
* Aggregate total bytes ingested by the CasProcessor.
*
- * @param aBytesIn - number of ingested bytes
+ * @param aBytesIn
+ * - number of ingested bytes
*/
@Override
public void addBytesIn(long aBytesIn) {
@@ -433,7 +435,8 @@
/**
* Aggregate total bytes processed by this CasProcessor.
*
- * @param aBytesOut the a bytes out
+ * @param aBytesOut
+ * the a bytes out
*/
@Override
public void addBytesOut(long aBytesOut) {
@@ -443,7 +446,8 @@
/**
* Increment number of times the casProcessor was restarted due to failures.
*
- * @param aCount - restart count
+ * @param aCount
+ * - restart count
*/
@Override
public void incrementRestartCount(int aCount) {
@@ -464,7 +468,8 @@
* Increments number of times CasProceesor failed analyzing Cas'es due to timeout or some other
* problems.
*
- * @param aCount - failure count
+ * @param aCount
+ * - failure count
*/
@Override
public void incrementRetryCount(int aCount) {
@@ -484,7 +489,8 @@
/**
* Increment number of aborted Cas'es due to inability to process the Cas.
*
- * @param aCount - number of aborts while processing Cas'es
+ * @param aCount
+ * - number of aborts while processing Cas'es
*/
@Override
public void incrementAbortCount(int aCount) {
@@ -506,8 +512,8 @@
* features. Features that are required by the Cas Processor to perform analysis. Dependant
* feateurs are defined in the filter expression in the CPE descriptor
*
- * @param aCount -
- * number of filtered Cas'es
+ * @param aCount
+ * - number of filtered Cas'es
*/
@Override
public void incrementFilteredCount(int aCount) {
@@ -538,8 +544,8 @@
/**
* Copies number of entities the CasProcessor has yet to process.
*
- * @param aRemainingCount -
- * number of entities to process
+ * @param aRemainingCount
+ * - number of entities to process
*/
@Override
public synchronized void setRemaining(long aRemainingCount) {
@@ -549,7 +555,8 @@
/**
* Copies id of the last entity processed by the CasProcessor.
*
- * @param aEntityId - id of the entity
+ * @param aEntityId
+ * - id of the entity
*/
@Override
public void setLastProcessedEntityId(String aEntityId) {
@@ -572,8 +579,9 @@
/**
* Copies the last Cas Processed.
*
- * @param aCasObject the new last cas
- * @deprecated
+ * @param aCasObject
+ * the new last cas
+ * @deprecated
*/
@Override
@Deprecated
@@ -585,7 +593,7 @@
* Returns the last Cas processed.
*
* @return the last cas
- * @deprecated
+ * @deprecated
*/
@Override
@Deprecated
@@ -596,7 +604,8 @@
/**
* Increment processed.
*
- * @param aIncrement the a increment
+ * @param aIncrement
+ * the a increment
*/
public void incrementProcessed(int aIncrement) {
processed += aIncrement;
@@ -605,7 +614,8 @@
/**
* Used when recovering from checkpoint, sets the total number of entities before CPE stopped.
*
- * @param aProcessedCount - number of entities processed before CPE stopped
+ * @param aProcessedCount
+ * - number of entities processed before CPE stopped
*/
@Override
public void setProcessed(long aProcessedCount) {
@@ -630,7 +640,9 @@
errorCounter = 0;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.base_cpm.container.ProcessingContainer#resetRestartCount()
*/
@Override
@@ -642,8 +654,8 @@
/**
* Increments total time spend in the process() method of the CasProcessor.
*
- * @param aTime -
- * total time in process()
+ * @param aTime
+ * - total time in process()
*/
@Override
public void incrementTotalTime(long aTime) {
@@ -679,8 +691,8 @@
/**
* Returns true if the Exception cause is SocketTimeoutException.
*
- * @param aThrowable -
- * Exception to check for SocketTimeoutException
+ * @param aThrowable
+ * - Exception to check for SocketTimeoutException
* @return - true if Socket Timeout, false otherwise
*/
private boolean isTimeout(Throwable aThrowable) {
@@ -698,8 +710,10 @@
* run, if it should disable the CasProcessor (and all its instances), or disregard the error and
* continue.
*
- * @param aThrowable - exception to examine
- * @throws Exception the exception
+ * @param aThrowable
+ * - exception to examine
+ * @throws Exception
+ * the exception
*/
@Override
public synchronized void incrementCasProcessorErrors(Throwable aThrowable) throws Exception {
@@ -711,12 +725,8 @@
}
if (System.getProperty("DEBUG_EXCEPTIONS") != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_cp_error_count__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_show_cp_error_count__FINEST",
new Object[] { Thread.currentThread().getName(), getName(),
String.valueOf(errorCounter), aThrowable.getCause().getMessage() });
}
@@ -758,15 +768,10 @@
// Check if configured max restart count has been reached
if (restartCount > rC) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass())
- .logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_max_restart_reached__FINEST",
- new Object[] { Thread.currentThread().getName(), getName(),
- String.valueOf(rC) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_max_restart_reached__FINEST", new Object[] {
+ Thread.currentThread().getName(), getName(), String.valueOf(rC) });
}
// get from configuration action to be taken if max restart count reached
String actionOnMaxRestarts = casProcessorCPEConfiguration.getActionOnMaxRestart();
@@ -790,9 +795,8 @@
new Object[] { Thread.currentThread().getName(), getName() });
}
throw new AbortCasProcessorException(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_configured_to_disable__WARNING", new Object[] {
- Thread.currentThread().getName(), getName() }));
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_configured_to_disable__WARNING",
+ new Object[] { Thread.currentThread().getName(), getName() }));
} else if (Constants.KILL_PROCESSING_PIPELINE.equals(actionOnMaxRestarts)) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
@@ -800,10 +804,10 @@
"UIMA_CPM_kill_pipeline__FINEST",
new Object[] { Thread.currentThread().getName(), getName() });
}
- throw new KillPipelineException(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_configured_to_kill_pipeline__WARNING", new Object[] {
- Thread.currentThread().getName(), getName() }));
+ throw new KillPipelineException(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_configured_to_kill_pipeline__WARNING",
+ new Object[] { Thread.currentThread().getName(), getName() }));
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
@@ -823,12 +827,8 @@
}
if (aThrowable.getCause() != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_other_exception__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_other_exception__FINEST",
new Object[] { Thread.currentThread().getName(), getName(),
aThrowable.getCause().getClass().getName() });
}
@@ -856,11 +856,8 @@
if (errorCounter > configuredErrorRate) {
if (abortCPMOnError()) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.SEVERE,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_abort_exceeded_error_threshold__SEVERE",
new Object[] { Thread.currentThread().getName(), getName(),
String.valueOf(configuredErrorRate) });
@@ -869,11 +866,8 @@
}
if (isAbortable()) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.SEVERE,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_disable_exceeded_error_threshold__SEVERE",
new Object[] { Thread.currentThread().getName(), getName(),
String.valueOf(configuredErrorRate) });
@@ -896,30 +890,30 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.impl.base_cpm.container.ProcessingContainer#isEndOfBatch(org.apache.uima.collection.base_cpm.CasProcessor, int)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.impl.base_cpm.container.ProcessingContainer#isEndOfBatch(org.apache.
+ * uima.collection.base_cpm.CasProcessor, int)
*/
/*
* Called after each entity set is processed and its purpose is to mark end of batch associated
* with this Container. At the end of batch a CasProcessor may perform a specific processing like
* writing to a store or do indexing.
*
- * @see org.apache.uima.collection.base_cpm.container.ProcessingContainer#isEndOfBatch(org.apache.uima.collection.base_cpm.CasProcessor,
- * int)
+ * @see
+ * org.apache.uima.collection.base_cpm.container.ProcessingContainer#isEndOfBatch(org.apache.uima.
+ * collection.base_cpm.CasProcessor, int)
*/
@Override
public synchronized boolean isEndOfBatch(CasProcessor aCasProcessor, int aProcessedSize)
throws ResourceProcessException, IOException {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass())
- .logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_cp_batch_size__FINEST",
- new Object[] { Thread.currentThread().getName(), getName(),
- String.valueOf(batchSize) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_show_cp_batch_size__FINEST",
+ new Object[] { Thread.currentThread().getName(), getName(),
+ String.valueOf(batchSize) });
}
boolean eob = false;
@@ -938,15 +932,10 @@
// Increment the total number of entities processed so far through this container
processed += aProcessedSize;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass())
- .logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_cp_doc_count__FINEST",
- new Object[] { Thread.currentThread().getName(), getName(),
- String.valueOf(processed) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_show_cp_doc_count__FINEST",
+ new Object[] { Thread.currentThread().getName(), getName(),
+ String.valueOf(processed) });
}
// Check for end-of-batch
if (batchCounter > batchSize || batchCounter % batchSize == 0) {
@@ -986,8 +975,8 @@
* all Cas'es must contain required features. If even one Cas does not have them, the entire
* bundle is skipped.
*
- * @param aCasList -
- * bundle containing instances of CAS
+ * @param aCasList
+ * - bundle containing instances of CAS
* @return true, if successful
*/
@Override
@@ -1014,8 +1003,8 @@
* defined in the filter. Filtering is optional and if not present in the cpe descriptor this
* routine always returns true.
*
- * @param aCas -
- * Cas instance to check
+ * @param aCas
+ * - Cas instance to check
*
* @return - true if feature is in the Cas, false otherwise
*/
@@ -1050,8 +1039,8 @@
}
}
Filter.Expression filterExpression = (Filter.Expression) filterList.get(i);
- String featureValue = DATACasUtils.getFeatureValueByType(aCas, filterExpression.getLeftPart()
- .get());
+ String featureValue = DATACasUtils.getFeatureValueByType(aCas,
+ filterExpression.getLeftPart().get());
// This evaluates if the Feature with a given name exist
if (filterExpression.getRightPart() == null) {
if (System.getProperty("DEBUG_FILTER") != null) {
@@ -1065,22 +1054,21 @@
// the featureValue must NOT be null.
// The second check is to see if the the feature does NOT exist in the CAS. In
// this case, the feature MUST be null.
- boolean exists = DATACasUtils.hasFeatureStructure(aCas, filterExpression.getLeftPart()
- .get());
+ boolean exists = DATACasUtils.hasFeatureStructure(aCas,
+ filterExpression.getLeftPart().get());
if (System.getProperty("DEBUG_FILTER") != null) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_filter_enabled_left_part__FINEST",
new Object[] { Thread.currentThread().getName(), getName(),
filterExpression.getLeftPart().get(), String.valueOf(exists) });
}
if ((filterExpression.getOperand() == null
- || filterExpression.getOperand().getOperand() == null || !exists)
- || // this means that the feature must exist in CAS
+ || filterExpression.getOperand().getOperand() == null || !exists) || // this means
+ // that the
+ // feature must
+ // exist in CAS
("!".equals(filterExpression.getOperand().getOperand()) && exists)) // this
// means
// that
@@ -1122,8 +1110,8 @@
/**
* Checks if a given Cas has required features.
*
- * @param aCas -
- * Cas instance to check
+ * @param aCas
+ * - Cas instance to check
*
* @return - true if feature is in the Cas, false otherwise
*/
@@ -1153,7 +1141,7 @@
/**
* Start.
*
- * @deprecated
+ * @deprecated
*/
@Override
@Deprecated
@@ -1164,7 +1152,7 @@
/**
* Stop.
*
- * @deprecated
+ * @deprecated
*/
@Override
@Deprecated
@@ -1203,11 +1191,8 @@
if (!isPaused) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_resuming_container__FINEST",
new Object[] { Thread.currentThread().getName(), getName(),
String.valueOf(CONTAINER_SLEEP_TIME) });
@@ -1249,8 +1234,8 @@
/**
* Returns a given casProcessor instance back to the pool.
*
- * @param aCasProcessor -
- * an instance of CasProcessor to return back to the pool
+ * @param aCasProcessor
+ * - an instance of CasProcessor to return back to the pool
* @see org.apache.uima.collection.impl.base_cpm.container.ProcessingContainer#releaseCasProcessor(org.apache.uima.collection.base_cpm.CasProcessor)
*/
@Override
@@ -1275,8 +1260,8 @@
/**
* Changes the status of the CasProcessor as a group.
*
- * @param aStatus -
- * new status
+ * @param aStatus
+ * - new status
*/
@Override
public void setStatus(int aStatus) {
@@ -1287,7 +1272,7 @@
* Checks if is local.
*
* @return true, if is local
- * @deprecated
+ * @deprecated
*/
@Override
@Deprecated
@@ -1299,7 +1284,7 @@
* Checks if is remote.
*
* @return true, if is remote
- * @deprecated
+ * @deprecated
*/
@Override
@Deprecated
@@ -1311,7 +1296,7 @@
* Checks if is integrated.
*
* @return true, if is integrated
- * @deprecated
+ * @deprecated
*/
@Override
@Deprecated
@@ -1347,11 +1332,8 @@
try {
anAction = casProcessorCPEConfiguration.getActionOnError();
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_show_cp_action_on_error__FINEST",
new Object[] { Thread.currentThread().getName(), getName(),
casProcessorCPEConfiguration.getActionOnError() });
@@ -1390,9 +1372,11 @@
return false;
}
-
- /* (non-Javadoc)
- * @see org.apache.uima.resource.Resource_ImplBase#initialize(org.apache.uima.resource.ResourceSpecifier, java.util.Map)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.resource.Resource_ImplBase#initialize(org.apache.uima.resource.
+ * ResourceSpecifier, java.util.Map)
*/
@Override
public boolean initialize(ResourceSpecifier aSpecifier, Map aAdditionalParams)
@@ -1426,11 +1410,8 @@
@Override
public void destroy() {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_show_cp_proxy_pool_size__FINEST",
new Object[] { Thread.currentThread().getName(), getName(),
String.valueOf(casProcessorPool.getSize()) });
@@ -1499,7 +1480,7 @@
* (non-Javadoc)
*
* @see org.apache.uima.resource.ConfigurableResource#getConfigParameterValue(java.lang.String,
- * java.lang.String)
+ * java.lang.String)
*/
@Override
public Object getConfigParameterValue(String aGroupName, String aParamName) {
@@ -1510,7 +1491,7 @@
* (non-Javadoc)
*
* @see org.apache.uima.resource.ConfigurableResource#setConfigParameterValue(java.lang.String,
- * java.lang.Object)
+ * java.lang.Object)
*/
@Override
public void setConfigParameterValue(String aParamName, Object aValue) {
@@ -1521,7 +1502,7 @@
* (non-Javadoc)
*
* @see org.apache.uima.resource.ConfigurableResource#setConfigParameterValue(java.lang.String,
- * java.lang.String, java.lang.Object)
+ * java.lang.String, java.lang.Object)
*/
@Override
public void setConfigParameterValue(String aGroupName, String aParamName, Object aValue) {
@@ -1547,9 +1528,8 @@
@Override
public String getName() {
if (processorName == null) {
- if (metadata != null
- && Constants.DEPLOYMENT_INTEGRATED.equalsIgnoreCase(casProcessorCPEConfiguration
- .getDeploymentType())) {
+ if (metadata != null && Constants.DEPLOYMENT_INTEGRATED
+ .equalsIgnoreCase(casProcessorCPEConfiguration.getDeploymentType())) {
processorName = metadata.getName().trim();
} else {
processorName = casProcessorCPEConfiguration.getName().trim();
@@ -1571,8 +1551,10 @@
/**
* Increment a value of a given stat.
*
- * @param aStatName the a stat name
- * @param aStat the a stat
+ * @param aStatName
+ * the a stat name
+ * @param aStat
+ * the a stat
*/
@Override
public void incrementStat(String aStatName, Integer aStat) {
@@ -1592,8 +1574,10 @@
/**
* Add an arbitrary object and bind it to a given name.
*
- * @param aStatName the a stat name
- * @param aStat the a stat
+ * @param aStatName
+ * the a stat name
+ * @param aStat
+ * the a stat
*/
@Override
public void addStat(String aStatName, Object aStat) {
@@ -1608,7 +1592,8 @@
/**
* Return an abject identified with a given name.
*
- * @param aStatName the a stat name
+ * @param aStatName
+ * the a stat name
* @return the stat
*/
@Override
@@ -1652,7 +1637,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.base_cpm.container.ProcessingContainer#resume()
*/
@Override
@@ -1668,7 +1655,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.base_cpm.container.ProcessingContainer#isPaused()
*/
@Override
@@ -1678,7 +1667,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.base_cpm.container.ProcessingContainer#getPool()
*/
@Override
@@ -1686,17 +1677,23 @@
return casProcessorPool;
}
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.impl.base_cpm.container.ProcessingContainer#setSingleFencedService(boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.impl.base_cpm.container.ProcessingContainer#setSingleFencedService(
+ * boolean)
*/
@Override
public void setSingleFencedService(boolean aSingleFencedInstance) {
singleFencedInstance = aSingleFencedInstance;
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.impl.base_cpm.container.ProcessingContainer#isSingleFencedService()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.impl.base_cpm.container.ProcessingContainer#isSingleFencedService()
*/
@Override
public boolean isSingleFencedService() {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/ServiceProxyPool.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/ServiceProxyPool.java
index 194aab8..23a309c 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/ServiceProxyPool.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/ServiceProxyPool.java
@@ -38,7 +38,7 @@
private LinkedList mFreeInstances = new LinkedList();
-// private int mNumInstances;
+ // private int mNumInstances;
/**
* Checks out a Resource from the pool.
@@ -57,24 +57,16 @@
}
CasProcessor r = (CasProcessor) mFreeInstances.remove(0);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_cp_pool_size__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_show_cp_pool_size__FINEST",
new Object[] { Thread.currentThread().getName(),
String.valueOf(mAllInstances.size()), String.valueOf(mFreeInstances.size()) });
}
return r;
} else {
if (UIMAFramework.getLogger().isLoggable(Level.WARNING)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.WARNING,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_cp_pool_empty__WARNING",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_cp_pool_empty__WARNING",
new Object[] { Thread.currentThread().getName(),
String.valueOf(mAllInstances.size()), String.valueOf(mFreeInstances.size()) });
}
@@ -86,19 +78,16 @@
* Checks in a Resource to the pool. Also notifies other Threads that may be waiting for available
* instance.
*
- * @param aResource -
- * instance of the CasProcessor to check in
+ * @param aResource
+ * - instance of the CasProcessor to check in
*/
public synchronized void checkIn(CasProcessor aResource) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_checking_in_cp_to_pool__FINEST",
- new Object[] { Thread.currentThread().getName(),
- String.valueOf(mAllInstances.size()), String.valueOf(mFreeInstances.size()) });
+ new Object[] { Thread.currentThread().getName(), String.valueOf(mAllInstances.size()),
+ String.valueOf(mFreeInstances.size()) });
}
// make sure this Resource was actually belongs to this pool and is checked out
if (!mAllInstances.contains(aResource) || mFreeInstances.contains(aResource)) {
@@ -127,14 +116,10 @@
mFreeInstances.add(aResource);
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_cp_pool_size__FINEST",
- new Object[] { Thread.currentThread().getName(),
- String.valueOf(mAllInstances.size()), String.valueOf(mFreeInstances.size()) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_show_cp_pool_size__FINEST",
+ new Object[] { Thread.currentThread().getName(), String.valueOf(mAllInstances.size()),
+ String.valueOf(mFreeInstances.size()) });
}
// Notify any threads waiting on this object
notifyAll();
@@ -180,99 +165,91 @@
*
* @return the available size of this pool
*/
- public synchronized int getSize() { // synch for JVM memory model to get current value
+ public synchronized int getSize() { // synch for JVM memory model to get current value
return mFreeInstances.size();
}
public synchronized void addCasProcessor(CasProcessor aCasProcessor) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_add_cp_to_pool__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_add_cp_to_pool__FINEST",
new Object[] { Thread.currentThread().getName(),
aCasProcessor.getProcessingResourceMetaData().getName() });
}
mAllInstances.add(aCasProcessor);
mFreeInstances.add(aCasProcessor);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_cp_pool_size__FINEST",
- new Object[] { Thread.currentThread().getName(),
- String.valueOf(mAllInstances.size()), String.valueOf(mFreeInstances.size()) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_show_cp_pool_size__FINEST",
+ new Object[] { Thread.currentThread().getName(), String.valueOf(mAllInstances.size()),
+ String.valueOf(mFreeInstances.size()) });
}
}
-// /**
-// * Utility method used in the constructor to fill the pool with Resource instances.
-// *
-// * @param aResourceSpecifier
-// * specifier that describes how to create the Resource instances for the pool
-// * @param aResourceClass
-// * class of resource to instantiate
-// * @param aResourceInitParams
-// * initialization parameters to be passed to the
-// * {@link Resource#initialize(ResourceSpecifier,Map)} method.
-// *
-// *
-// * @throws ResourceInitializationException
-// * if the Resource instances could not be created
-// */
-// protected void fillPool(BoundedWorkQueue portQueue, Map initParams)
-// throws ResourceInitializationException {
-// boolean isServiceLocal = false;
-// if (initParams != null && initParams.containsKey("SERVICE_NAME")) {
-// isServiceLocal = true;
-// }
-// // fill the pool
-// for (int i = 0; i < mNumInstances; i++) {
-// VinciTAP tap = new VinciTAP();
-// if (isServiceLocal) {
-// String portAsString = (String) portQueue.dequeue();
-// int port = -1;
-// try {
-// port = Integer.parseInt(portAsString);
-// } catch (NumberFormatException e) {
-// }
-// String vnsHost = (String) initParams.get("VNS_HOST");
-// String vnsPort = (String) initParams.get("VNS_PORT");
-// tap.setVNSHost(vnsHost);
-// tap.setVNSPort(vnsPort);
-// try {
-// tap.connect("127.0.0.1", port);
-// } catch (ConnectException e) {
-// throw new ResourceInitializationException(e.getMessage(), null);
-// }
-// }
-// mAllInstances.add(tap);
-// mFreeInstances.add(tap);
-// }
-// }
+ // /**
+ // * Utility method used in the constructor to fill the pool with Resource instances.
+ // *
+ // * @param aResourceSpecifier
+ // * specifier that describes how to create the Resource instances for the pool
+ // * @param aResourceClass
+ // * class of resource to instantiate
+ // * @param aResourceInitParams
+ // * initialization parameters to be passed to the
+ // * {@link Resource#initialize(ResourceSpecifier,Map)} method.
+ // *
+ // *
+ // * @throws ResourceInitializationException
+ // * if the Resource instances could not be created
+ // */
+ // protected void fillPool(BoundedWorkQueue portQueue, Map initParams)
+ // throws ResourceInitializationException {
+ // boolean isServiceLocal = false;
+ // if (initParams != null && initParams.containsKey("SERVICE_NAME")) {
+ // isServiceLocal = true;
+ // }
+ // // fill the pool
+ // for (int i = 0; i < mNumInstances; i++) {
+ // VinciTAP tap = new VinciTAP();
+ // if (isServiceLocal) {
+ // String portAsString = (String) portQueue.dequeue();
+ // int port = -1;
+ // try {
+ // port = Integer.parseInt(portAsString);
+ // } catch (NumberFormatException e) {
+ // }
+ // String vnsHost = (String) initParams.get("VNS_HOST");
+ // String vnsPort = (String) initParams.get("VNS_PORT");
+ // tap.setVNSHost(vnsHost);
+ // tap.setVNSPort(vnsPort);
+ // try {
+ // tap.connect("127.0.0.1", port);
+ // } catch (ConnectException e) {
+ // throw new ResourceInitializationException(e.getMessage(), null);
+ // }
+ // }
+ // mAllInstances.add(tap);
+ // mFreeInstances.add(tap);
+ // }
+ // }
// never used
-// /**
-// * Returns all instances in the pool
-// *
-// * @return - list of CasProcessor instances
-// */
-// protected synchronized LinkedList getAllInstances() {
-// return mAllInstances;
-// }
-//
-// /**
-// * Returns a list of CasProcessor instances not currently in use
-// *
-// * @return -list of free proxies
-// */
-// protected synchronized LinkedList getFreeInstances() {
-// return mFreeInstances;
-// }
+ // /**
+ // * Returns all instances in the pool
+ // *
+ // * @return - list of CasProcessor instances
+ // */
+ // protected synchronized LinkedList getAllInstances() {
+ // return mAllInstances;
+ // }
+ //
+ // /**
+ // * Returns a list of CasProcessor instances not currently in use
+ // *
+ // * @return -list of free proxies
+ // */
+ // protected synchronized LinkedList getFreeInstances() {
+ // return mFreeInstances;
+ // }
public synchronized int getAllInstanceCount() {
return mAllInstances.size();
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/CPEDeployerDefaultImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/CPEDeployerDefaultImpl.java
index f71fee5..78a2065 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/CPEDeployerDefaultImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/CPEDeployerDefaultImpl.java
@@ -46,12 +46,11 @@
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.Level;
-
/**
* Implements {@link CasProcessorDeployer}. Used to instantiate integrated Cas Processor.
*/
public class CPEDeployerDefaultImpl implements CasProcessorDeployer {
-
+
/** The cas processor pool. */
private ServiceProxyPool casProcessorPool = null;
@@ -64,8 +63,8 @@
/**
* Initializes this instance with a reference to the CPE configuration.
*
- * @param aCpeFactory -
- * reference to CPE configuration
+ * @param aCpeFactory
+ * - reference to CPE configuration
*/
public CPEDeployerDefaultImpl(CPEFactory aCpeFactory) {
cpeFactory = aCpeFactory;
@@ -77,11 +76,15 @@
* processing thread created here. The <i>aCasProcessorList</i> contains instantiated Cas
* Processors. These are instantiated by the CPEFactory.
*
- * @param aCasProcessorList - list containing instantiated Cas Processors
- * @param aEngine the CPM engine
- * @param redeploy - true when redeploying failed Cas Processor
+ * @param aCasProcessorList
+ * - list containing instantiated Cas Processors
+ * @param aEngine
+ * the CPM engine
+ * @param redeploy
+ * - true when redeploying failed Cas Processor
* @return - ProcessingContainer containing pool of CasProcessors
- * @throws ResourceConfigurationException the resource configuration exception
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
public ProcessingContainer deployCasProcessor(List aCasProcessorList, CPMEngine aEngine,
boolean redeploy) throws ResourceConfigurationException {
@@ -95,10 +98,13 @@
* processing thread created here. The <i>aCasProcessorList</i> contains instantiated Cas
* Processors. These are instantiated by the CPEFactory.
*
- * @param aCasProcessorList - list containing instantiated Cas Processors
- * @param redeploy - true when redeploying failed Cas Processor
+ * @param aCasProcessorList
+ * - list containing instantiated Cas Processors
+ * @param redeploy
+ * - true when redeploying failed Cas Processor
* @return - ProcessingContainer containing pool of CasProcessors
- * @throws ResourceConfigurationException the resource configuration exception
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
@Override
public ProcessingContainer deployCasProcessor(List aCasProcessorList, boolean redeploy)
@@ -134,14 +140,12 @@
}
casProcessorPool = new ServiceProxyPool();
// Instantiate an object that encapsulates CasProcessor configuration
- casProcessorConfig = new CasProcessorConfigurationJAXBImpl(cpeCasProcessor, cpeFactory.getResourceManager());
+ casProcessorConfig = new CasProcessorConfigurationJAXBImpl(cpeCasProcessor,
+ cpeFactory.getResourceManager());
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_cp_checkpoint__FINEST",
new Object[] { Thread.currentThread().getName(),
String.valueOf(casProcessorConfig.getBatchSize()) });// Checkpoint().getBatch())});
@@ -166,9 +170,9 @@
"UIMA_CPM_cp_no_name__SEVERE",
new Object[] { Thread.currentThread().getName() });
}
- throw new ResourceConfigurationException(
- InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING, new Object[] { "name",
- "casProcessor" }, new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ throw new ResourceConfigurationException(InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING,
+ new Object[] { "name", "casProcessor" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING",
new Object[] { Thread.currentThread().getName(), "n/a", "name",
@@ -180,11 +184,11 @@
casProcessorConfig = processingContainer.getCasProcessorConfiguration();
if (casProcessorConfig == null) {
throw new ResourceConfigurationException(InvalidXMLException.ELEMENT_NOT_FOUND,
- new Object[] { "<casProcessor>", "<casProcessors>" }, new Exception(
- CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING",
- new Object[] { Thread.currentThread().getName() })));
+ new Object[] { "<casProcessor>", "<casProcessors>" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_bad_cpe_descriptor_no_cp__WARNING",
+ new Object[] { Thread.currentThread().getName() })));
}
}
// Add CasProcess to the instance pool
@@ -212,9 +216,10 @@
* Deploys integrated Cas Processor using configuration available in a given Container. This
* routine is called when the CasProcessor fails and needs to be restarted.
*
- * @param aProcessingContainer -
- * container managing Cas Processor
- * @throws ResourceConfigurationException the resource configuration exception
+ * @param aProcessingContainer
+ * - container managing Cas Processor
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
@Override
public void deployCasProcessor(ProcessingContainer aProcessingContainer)
@@ -244,10 +249,11 @@
/**
* Creates an instance of integrated Cas Processor from a given descriptor.
*
- * @param aDescriptor -
- * Cas Processor descriptor
+ * @param aDescriptor
+ * - Cas Processor descriptor
* @return - instantiated CasProcessor
- * @throws ResourceConfigurationException wraps Exception
+ * @throws ResourceConfigurationException
+ * wraps Exception
*/
private CasProcessor produceIntegratedCasProcessor(URL aDescriptor)
throws ResourceConfigurationException {
@@ -257,19 +263,20 @@
ResourceSpecifier resourceSpecifier = cpeFactory.getSpecifier(aDescriptor);
if (resourceSpecifier instanceof AnalysisEngineDescription) {
- casProcessor = UIMAFramework.produceAnalysisEngine(resourceSpecifier, this.cpeFactory
- .getResourceManager(), null);
+ casProcessor = UIMAFramework.produceAnalysisEngine(resourceSpecifier,
+ this.cpeFactory.getResourceManager(), null);
// casProcessor.
} else if (resourceSpecifier instanceof CasConsumerDescription) {
- if (cpeFactory.isDefinitionInstanceOf(CasConsumer.class, resourceSpecifier, aDescriptor.toString())) {
+ if (cpeFactory.isDefinitionInstanceOf(CasConsumer.class, resourceSpecifier,
+ aDescriptor.toString())) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_producing_cas_consumer__FINEST",
new Object[] { Thread.currentThread().getName() });
}
- casProcessor = UIMAFramework.produceCasConsumer(resourceSpecifier, this.cpeFactory
- .getResourceManager(), null);
+ casProcessor = UIMAFramework.produceCasConsumer(resourceSpecifier,
+ this.cpeFactory.getResourceManager(), null);
} else if (cpeFactory.isDefinitionInstanceOf(CasProcessor.class, resourceSpecifier,
aDescriptor.toString())) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
@@ -286,7 +293,8 @@
// Check if CasProcesser has been instantiated
if (casProcessor == null) {
throw new ResourceConfigurationException(ResourceServiceException.RESOURCE_UNAVAILABLE,
- new Object[] {}, new Exception(CpmLocalizedMessage.getLocalizedMessage(
+ new Object[] {},
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_instantiation_exception__WARNING", new Object[] {
Thread.currentThread().getName(), "Integrated Cas Processor" })));
@@ -297,18 +305,21 @@
} catch (Exception e) {
e.printStackTrace();
throw new ResourceConfigurationException(ResourceServiceException.RESOURCE_UNAVAILABLE,
- new Object[] {}, new Exception(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_instantiation_exception__WARNING", new Object[] {
- Thread.currentThread().getName(), "Integrated Cas Processor" })));
+ new Object[] {},
+ new Exception(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_instantiation_exception__WARNING", new Object[] {
+ Thread.currentThread().getName(), "Integrated Cas Processor" })));
}
return casProcessor;
}
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer#undeploy()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer#undeploy()
*/
@Override
public void undeploy() throws CasProcessorDeploymentException {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/DeployFactory.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/DeployFactory.java
index 1b90182..2bfd886 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/DeployFactory.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/DeployFactory.java
@@ -49,17 +49,21 @@
private DeployFactory() {
}
-
+
/**
* Returns a
* {@link org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer} object
* that specializes in deploying components as either local, remote, or integrated.
*
- * @param aCpeFactory cpe factory
- * @param aCasProcessorConfig cpe configuration reference
- * @param aPca mode of deployment.
+ * @param aCpeFactory
+ * cpe factory
+ * @param aCasProcessorConfig
+ * cpe configuration reference
+ * @param aPca
+ * mode of deployment.
* @return appropriate deployer object for the mode of depolyment
- * @throws ResourceConfigurationException missing protocol or other deployment error
+ * @throws ResourceConfigurationException
+ * missing protocol or other deployment error
*/
public static CasProcessorDeployer getDeployer(CPEFactory aCpeFactory,
@@ -73,8 +77,8 @@
String protocol = getProtocol(aCasProcessorConfig, aCpeFactory.getResourceManager());
if (protocol == null || protocol.trim().length() == 0) {
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_invalid_service_descriptor__SEVERE", new Object[] {
- Thread.currentThread().getName(), "<uriSpecifier>", "<protocol>" },
+ "UIMA_CPM_invalid_service_descriptor__SEVERE",
+ new Object[] { Thread.currentThread().getName(), "<uriSpecifier>", "<protocol>" },
new Exception(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_EXP_invalid_service_descriptor__WARNING", new Object[] {
@@ -94,28 +98,32 @@
return new CPEDeployerDefaultImpl(aCpeFactory);
}
throw new ResourceConfigurationException(InvalidXMLException.REQUIRED_ATTRIBUTE_MISSING,
- new Object[] { "deployment", "casProcessor" }, new Exception(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_Exception_invalid_deployment__WARNING", new Object[] {
- Thread.currentThread().getName(), aCasProcessorConfig.getName(),
- deployMode })));
+ new Object[] { "deployment", "casProcessor" },
+ new Exception(CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_Exception_invalid_deployment__WARNING",
+ new Object[] { Thread.currentThread().getName(), aCasProcessorConfig.getName(),
+ deployMode })));
}
/**
* Retrieve protocol from the service descriptor
*
- * @param aCasProcessorConfig Cas Processor configuration
- * @param aResourceManager needed to resolve import by name
+ * @param aCasProcessorConfig
+ * Cas Processor configuration
+ * @param aResourceManager
+ * needed to resolve import by name
* @return - protocol as string (vinci, socket)
*
- * @throws ResourceConfigurationException wraps Exception
+ * @throws ResourceConfigurationException
+ * wraps Exception
*/
- public static String getProtocol(CpeCasProcessor aCasProcessorConfig, ResourceManager aResourceManager)
- throws ResourceConfigurationException {
+ public static String getProtocol(CpeCasProcessor aCasProcessorConfig,
+ ResourceManager aResourceManager) throws ResourceConfigurationException {
try {
- URL clientServiceDescriptor = aCasProcessorConfig.getCpeComponentDescriptor().findAbsoluteUrl(aResourceManager);
- ResourceSpecifier resourceSpecifier = UIMAFramework.getXMLParser().parseResourceSpecifier(
- new XMLInputSource(clientServiceDescriptor));
+ URL clientServiceDescriptor = aCasProcessorConfig.getCpeComponentDescriptor()
+ .findAbsoluteUrl(aResourceManager);
+ ResourceSpecifier resourceSpecifier = UIMAFramework.getXMLParser()
+ .parseResourceSpecifier(new XMLInputSource(clientServiceDescriptor));
if (resourceSpecifier instanceof URISpecifier) {
return ((URISpecifier) resourceSpecifier).getProtocol();
}
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/FencedProcessReaper.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/FencedProcessReaper.java
index 96d6ba0..47a233e 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/FencedProcessReaper.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/FencedProcessReaper.java
@@ -28,7 +28,6 @@
*/
public class FencedProcessReaper {
-
public FencedProcessReaper() {
}
@@ -36,8 +35,8 @@
/**
* When running on linux this method kill a process identified by a given PID.
*
- * @param aPid -
- * process id to kill
+ * @param aPid
+ * - process id to kill
*/
public void killProcess(String aPid) {
try {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/JavaApplication.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/JavaApplication.java
index b462583..3487250 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/JavaApplication.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/JavaApplication.java
@@ -34,7 +34,6 @@
import org.apache.uima.util.Level;
import org.apache.uima.util.UriUtils;
-
/**
* Component responsible for configuring command line for java based CasProcessor. Each CasProcessor
* is configured via CPE descriptor either statically (xml file) or dynamically by means of APIs. In
@@ -44,28 +43,32 @@
*
*/
public class JavaApplication extends RunnableApplication {
-
+
/**
* Creates an instance of component responsible for configuring java based CasProcessor.
*
- * @param aCasProcessorConfiguration -
- * configuration for CasProcessor
- * @param aJaxbCasProcessorConfig the a jaxb cas processor config
- * @throws ResourceConfigurationException passthru
+ * @param aCasProcessorConfiguration
+ * - configuration for CasProcessor
+ * @param aJaxbCasProcessorConfig
+ * the a jaxb cas processor config
+ * @throws ResourceConfigurationException
+ * passthru
*/
public JavaApplication(CasProcessorConfiguration aCasProcessorConfiguration,
CpeCasProcessor aJaxbCasProcessorConfig) throws ResourceConfigurationException {
- addApplicationInfo(aCasProcessorConfiguration, aJaxbCasProcessorConfig);
+ addApplicationInfo(aCasProcessorConfiguration, aJaxbCasProcessorConfig);
}
/**
* Sets up command line used to launch Cas Processor in a separate process. Combines environment
* variables setup in the CPE descriptor with a System environment variables.
*
- * @param aCasProcessorConfiguration -
- * access to Cas Processor configuration
- * @param aCasProcessor the a cas processor
- * @throws ResourceConfigurationException passthru
+ * @param aCasProcessorConfiguration
+ * - access to Cas Processor configuration
+ * @param aCasProcessor
+ * the a cas processor
+ * @throws ResourceConfigurationException
+ * passthru
*/
@Override
protected void addApplicationInfo(CasProcessorConfiguration aCasProcessorConfiguration,
@@ -80,18 +83,19 @@
* Adds to command line any program arguments configured for this Cas Processor in the CPE
* descriptor.
*
- * @param aCasProcessorConfiguration -
- * Cas Processor configuration
- * @param argList -
- * list of arguments set up in the CPE descriptor
- * @param aExecutable -
- * executable program
+ * @param aCasProcessorConfiguration
+ * - Cas Processor configuration
+ * @param argList
+ * - list of arguments set up in the CPE descriptor
+ * @param aExecutable
+ * - executable program
* @return - complete command line ready for use
- * @throws ResourceConfigurationException the resource configuration exception
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
protected String[] addApplicationCmdLineArguments(
- CasProcessorConfiguration aCasProcessorConfiguration, List argList, String aExecutable)
- throws ResourceConfigurationException {
+ CasProcessorConfiguration aCasProcessorConfiguration, List argList, String aExecutable)
+ throws ResourceConfigurationException {
ArrayList cmdArgs = new ArrayList();
// build commandline
cmdArgs.add(aExecutable);
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/NonJavaApplication.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/NonJavaApplication.java
index ec2e54f..7b4127b 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/NonJavaApplication.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/NonJavaApplication.java
@@ -51,10 +51,12 @@
* Sets up command line used to launch Cas Processor in a seperate process. Combines environment
* variables setup in the CPE descriptor with a System environment variables.
*
- * @param aCasProcessorConfiguration -
- * access to Cas Processor configuration
- * @param aCasProcessor -
- * @throws ResourceConfigurationException passthru
+ * @param aCasProcessorConfiguration
+ * - access to Cas Processor configuration
+ * @param aCasProcessor
+ * -
+ * @throws ResourceConfigurationException
+ * passthru
*/
@Override
protected void addApplicationInfo(CasProcessorConfiguration aCasProcessorConfiguration,
@@ -71,19 +73,19 @@
/**
* Returns final command line as array of Strings.
*
- * @param aCasProcessorConfiguration -
- * Cas Processor configuration
- * @param argList -
- * arguments configured for the CasProcessor in cpe descriptor
- * @param aExecutable -
- * name of the program to launch
+ * @param aCasProcessorConfiguration
+ * - Cas Processor configuration
+ * @param argList
+ * - arguments configured for the CasProcessor in cpe descriptor
+ * @param aExecutable
+ * - name of the program to launch
* @return - command line as array of Strings
- * @throws ResourceConfigurationException -
+ * @throws ResourceConfigurationException
+ * -
*/
protected String[] addApplicationCmdLineArguments(
- CasProcessorConfiguration aCasProcessorConfiguration, List argList, String aExecutable)
- throws ResourceConfigurationException
- {
+ CasProcessorConfiguration aCasProcessorConfiguration, List argList, String aExecutable)
+ throws ResourceConfigurationException {
ArrayList cmdArgs = new ArrayList();
cmdArgs.add(aExecutable);
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/RunnableApplication.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/RunnableApplication.java
index 5afaff1..31ed78b 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/RunnableApplication.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/RunnableApplication.java
@@ -37,12 +37,11 @@
import org.apache.uima.resource.ResourceConfigurationException;
import org.apache.uima.util.Level;
-
/**
* The Class RunnableApplication.
*/
public class RunnableApplication {
-
+
/** The executable. */
protected String executable;
@@ -54,7 +53,7 @@
/** The arg list. */
protected List argList = new ArrayList();
-
+
/** The sys env vars. */
private Properties sysEnvVars = null;
@@ -62,10 +61,12 @@
* Sets up command line used to launch Cas Processor in a separate process. Combines environment
* variables setup in the CPE descriptor with a System environment variables.
*
- * @param aCasProcessorConfiguration -
- * access to Cas Processor configuration
- * @param aCasProcessor the a cas processor
- * @throws ResourceConfigurationException wraps Exception
+ * @param aCasProcessorConfiguration
+ * - access to Cas Processor configuration
+ * @param aCasProcessor
+ * the a cas processor
+ * @throws ResourceConfigurationException
+ * wraps Exception
*/
protected void addApplicationInfo(CasProcessorConfiguration aCasProcessorConfiguration,
CpeCasProcessor aCasProcessor) throws ResourceConfigurationException {
@@ -102,12 +103,12 @@
environment.clear();
boolean pathDone = false;
boolean classpathDone = false;
-
+
if (descrptrEnvVars != null) {
// First copy all env vars from the CPE Descriptor treating PATH and CLASSPATH as special
// cases
-
+
for (CasProcessorRuntimeEnvParam descrptrEv : descrptrEnvVars) {
String key = descrptrEv.getEnvParamName();
String value = descrptrEv.getEnvParamValue();
@@ -127,8 +128,8 @@
if (key.equalsIgnoreCase("CLASSPATH")) {
String classpath = getSysEnvVarValue(key);
if (classpath != null) {
- environment.add(key + "=" + value + System.getProperty("path.separator")
- + classpath);
+ environment
+ .add(key + "=" + value + System.getProperty("path.separator") + classpath);
} else {
environment.add(key + "=" + value + System.getProperty("path.separator"));
}
@@ -146,8 +147,8 @@
while (envKeys.hasMoreElements()) {
String key = (String) envKeys.nextElement();
// Skip those vars that we've already setup above
- if ((key.equalsIgnoreCase("PATH") && pathDone) ||
- (key.equalsIgnoreCase("CLASSPATH") && classpathDone)) {
+ if ((key.equalsIgnoreCase("PATH") && pathDone)
+ || (key.equalsIgnoreCase("CLASSPATH") && classpathDone)) {
continue;
}
environment.add(key + "=" + sysEnvVars.getProperty(key));
@@ -156,7 +157,7 @@
String[] envArray = new String[environment.size()];
environment.toArray(envArray);
exec.setEnvironment(envArray);
-
+
CasProcessorExecArg[] args = rip.getExecutable().getAllCasProcessorExecArgs();
for (int i = 0; args != null && i < args.length; i++) {
argList.add(args[i]);
@@ -193,14 +194,14 @@
/**
* Returns a value of a given environment variable.
*
- * @param aKey -
- * name of the environment variable
+ * @param aKey
+ * - name of the environment variable
* @return - value correspnding to environment variable
*/
protected String getSysEnvVarValue(String aKey) {
try {
// Retrieve all env variables
-// sysEnv = SystemEnvReader.getEnvVars(); // already done, do only once
+ // sysEnv = SystemEnvReader.getEnvVars(); // already done, do only once
Enumeration sysKeys = sysEnvVars.keys();
while (sysKeys.hasMoreElements()) {
String key = (String) sysKeys.nextElement();
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/VinciTAP.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/VinciTAP.java
index 8daf030..1197b1a 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/VinciTAP.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/VinciTAP.java
@@ -61,7 +61,6 @@
import org.apache.vinci.transport.context.VinciContext;
import org.apache.vinci.transport.document.AFrame;
-
/**
* Vinci Proxy to remote Cas Processor vinci service. This component is used for both local(
* managed) and remote ( unmanaged) Cas Processors. Its main purpose is to invoke remote APIs on Cas
@@ -70,7 +69,7 @@
*/
public class VinciTAP {
-
+
/** The service host. */
private String serviceHost;
@@ -139,8 +138,8 @@
/**
* Defines subject of analysis.
*
- * @param aContentTag -
- * subject of analysis
+ * @param aContentTag
+ * - subject of analysis
*/
public void setContentTag(String aContentTag) {
contentTag = aContentTag;
@@ -149,8 +148,8 @@
/**
* Defines a custom timer to use for stats.
*
- * @param aTimer -
- * custom timer
+ * @param aTimer
+ * - custom timer
*/
public void setTimer(UimaTimer aTimer) {
uimaTimer = aTimer;
@@ -159,8 +158,8 @@
/**
* Defines types as array that will not be sent to the Cas Processor service.
*
- * @param aKeys2Drop -
- * array of types excluded from the request
+ * @param aKeys2Drop
+ * - array of types excluded from the request
*/
public void setKeys2Drop(String[] aKeys2Drop) {
keys2Drop = aKeys2Drop;
@@ -169,12 +168,13 @@
/**
* Connects the proxy to Cas Processor running as a vinci service on a given host and port number.
*
- * @param aHost -
- * name of the host where the service is running
- * @param aPort -
- * port number where the service listens for requests
+ * @param aHost
+ * - name of the host where the service is running
+ * @param aPort
+ * - port number where the service listens for requests
*
- * @throws ConnectException wraps Exception or unable to connect
+ * @throws ConnectException
+ * wraps Exception or unable to connect
*/
public void connect(String aHost, int aPort) throws ConnectException {
int attemptCount = 0;
@@ -265,15 +265,10 @@
} catch (Exception e) {
if (e instanceof ConnectException) {
if (UIMAFramework.getLogger().isLoggable(Level.WARNING)) {
- UIMAFramework.getLogger(this.getClass())
- .logrb(
- Level.WARNING,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_connection_not_established__WARNING",
- new Object[] { Thread.currentThread().getName(), aHost,
- String.valueOf(aPort) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_connection_not_established__WARNING", new Object[] {
+ Thread.currentThread().getName(), aHost, String.valueOf(aPort) });
}
try {
Thread.sleep(100);
@@ -289,8 +284,7 @@
}
if (UIMAFramework.getLogger().isLoggable(Level.WARNING)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
- "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_connection_failed__WARNING",
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_connection_failed__WARNING",
new Object[] { Thread.currentThread().getName(), aHost, String.valueOf(aPort) });
}
throw new ConnectException(CpmLocalizedMessage.getLocalizedMessage(
@@ -301,8 +295,8 @@
/**
* Define the max time in millis the proxy will wait for response from remote service.
*
- * @param aTimeout -
- * number of millis to wait
+ * @param aTimeout
+ * - number of millis to wait
*/
public void setTimeout(int aTimeout) {
timeout = aTimeout;
@@ -311,9 +305,10 @@
/**
* Connects to external service using service name as a way to locate it.
*
- * @param aServiceName -
- * name of the service
- * @throws ServiceConnectionException the service connection exception
+ * @param aServiceName
+ * - name of the service
+ * @throws ServiceConnectionException
+ * the service connection exception
*/
public void connect(String aServiceName) throws ServiceConnectionException {
// To locate the service by name the VNS is critical. Make sure we know where it is
@@ -321,8 +316,7 @@
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
- "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_vns_not_provided__SEVERE",
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_vns_not_provided__SEVERE",
new Object[] { Thread.currentThread().getName() });
}
throw new ServiceConnectionException(CpmLocalizedMessage.getLocalizedMessage(
@@ -335,12 +329,8 @@
try {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_locating_service__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_locating_service__FINEST",
new Object[] { Thread.currentThread().getName(), aServiceName,
System.getProperty("VNS_HOST"), System.getProperty("VNS_PORT") });
}
@@ -350,8 +340,7 @@
vctx.setVNSPort(Integer.parseInt(getVNSPort()));
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).log(
- Level.FINEST,
+ UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
Thread.currentThread().getName() + " Connecting to::" + aServiceName
+ " VinciContext.getVNSHost():" + vctx.getVNSHost()
+ " VinciContext.getVNSPort():" + vctx.getVNSPort()); // getVNSHost());
@@ -361,11 +350,8 @@
conn.setSocketTimeout(timeout);
conn.setRetry(false);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_set_service_timeout__FINEST",
new Object[] { Thread.currentThread().getName(),
aServiceName + ":" + String.valueOf(timeout) });
@@ -383,8 +369,8 @@
"UIMA_CPM_connection_failed__WARNING",
new Object[] { Thread.currentThread().getName(), aServiceName, "" });
- UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
- Thread.currentThread().getName(), e);
+ UIMAFramework.getLogger(this.getClass()).log(Level.FINEST, Thread.currentThread().getName(),
+ e);
}
}
@@ -397,8 +383,10 @@
/**
* Test and reconnect.
*
- * @throws ServiceException the service exception
- * @throws ServiceConnectionException the service connection exception
+ * @throws ServiceException
+ * the service exception
+ * @throws ServiceConnectionException
+ * the service connection exception
*/
private void testAndReconnect() throws ServiceException, ServiceConnectionException {
// Make sure there is valid connection to the service and if there isnt one establish it
@@ -420,10 +408,10 @@
}
} catch (ConnectException ce) {
if (serviceName != null) {
- throw new ServiceException(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_unable_to_connect_toservice__WARNING", new Object[] {
- Thread.currentThread().getName(), serviceName }));
+ throw new ServiceException(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_unable_to_connect_toservice__WARNING",
+ new Object[] { Thread.currentThread().getName(), serviceName }));
} else {
throw new ServiceException(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_unable_to_connect__WARNING",
@@ -441,22 +429,20 @@
/**
* Send a given Vinci Frame to the remote vinci service and return result.
*
- * @param aFrame -
- * Vinci Frame containing request
+ * @param aFrame
+ * - Vinci Frame containing request
* @return AFrame - Frame containing result
- * @throws ServiceException the service exception
- * @throws ServiceConnectionException the service connection exception
+ * @throws ServiceException
+ * the service exception
+ * @throws ServiceConnectionException
+ * the service connection exception
*/
public AFrame sendAndReceive(AFrame aFrame) throws ServiceException, ServiceConnectionException {
int currentTimeout = 0;
currentTimeout = conn.getSocketTimeout();
if (UIMAFramework.getLogger().isLoggable(Level.FINE)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINE,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_sending_process_req__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINE, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_sending_process_req__FINEST",
new Object[] { Thread.currentThread().getName(), serviceHost, servicePort,
String.valueOf(currentTimeout) });
}
@@ -471,11 +457,8 @@
long memStart = Runtime.getRuntime().freeMemory();
if (System.getProperty("SHOW_MEMORY") != null) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_show_memory_before_call__FINEST",
new Object[] { Thread.currentThread().getName(),
String.valueOf(Runtime.getRuntime().totalMemory() / 1024),
@@ -483,11 +466,8 @@
}
responseFrame = (AFrame) conn.sendAndReceive(aFrame, AFrame.getAFrameFactory(), timeout);
if (System.getProperty("SHOW_MEMORY") != null) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_show_memory_after_call__FINEST",
new Object[] { Thread.currentThread().getName(),
String.valueOf(Runtime.getRuntime().totalMemory() / 1024),
@@ -500,11 +480,8 @@
}
return responseFrame;
} catch (VNSException vnse) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.WARNING,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_failed_service_request__WARNING",
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()) });
@@ -514,11 +491,8 @@
conn.close();
throw new ServiceException(vnse.getMessage());
} catch (ServiceDownException sde) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.WARNING,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_failed_service_request__WARNING",
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()) });
@@ -527,11 +501,8 @@
conn.close();
throw new ServiceConnectionException(sde.getMessage());
} catch (ServiceException sde) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.WARNING,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_failed_service_request__WARNING",
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()) });
@@ -542,11 +513,8 @@
}
throw new ServiceConnectionException(sde.getMessage());
} catch (IOException e) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.WARNING,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_failed_service_request__WARNING",
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()) });
@@ -566,11 +534,8 @@
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()), String.valueOf(currentTimeout) }));
} catch (Exception e) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.WARNING,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_failed_service_request__WARNING",
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()) });
@@ -587,13 +552,14 @@
* Appends keys (types) from XCAS to provided CasData instance doing conversions of ':' in WF keys
* to '_colon_' and '-' to '_dash_' to enforce UIMA compliance.
*
- * @param dataCas -
- * instance of CasData where the keys will be appended
- * @param aFrame -
- * source of keys (data)
+ * @param dataCas
+ * - instance of CasData where the keys will be appended
+ * @param aFrame
+ * - source of keys (data)
* @return - modified CasData
*
- * @throws Exception passthru
+ * @throws Exception
+ * passthru
*/
public static CasData addKeysToDataCas(CasData dataCas, AFrame aFrame) throws Exception {
try {
@@ -636,7 +602,8 @@
/**
* Prints to stdout contents of a given CasData instance.
*
- * @param aCAS the a CAS
+ * @param aCAS
+ * the a CAS
*/
private static void dumpFeatures(CasData aCAS) {
@@ -672,14 +639,15 @@
* Produces XCas from a given Cas. It selectively copies features from the Cas excluding those
* types that are defined in a given dropKeyList.
*
- * @param aCasData -
- * Cas for which XCAS is built
- * @param dataFrame -
- * XCas frame for data
- * @param aDropKeyList -
- * list of types to exclude from XCas
+ * @param aCasData
+ * - Cas for which XCAS is built
+ * @param dataFrame
+ * - XCas frame for data
+ * @param aDropKeyList
+ * - list of types to exclude from XCas
*
- * @throws Exception passthru
+ * @throws Exception
+ * passthru
*/
private void produceXCASRequestFrame(CasData aCasData, AFrame dataFrame, String[] aDropKeyList)
throws Exception {
@@ -741,8 +709,8 @@
/**
* Returns true if a given feature represents any of the content (SoFa) types.
*
- * @param feature -
- * type to check
+ * @param feature
+ * - type to check
*
* @return - true if SoFa, false otherwise
*/
@@ -757,15 +725,17 @@
/**
* Performs Analysis of the CAS by the remote vinci service Cas Processor.
*
- * @param aCas -
- * Cas to analayze
- * @param aPT -
- * performance trace object for stats and totals
- * @param aResourceName -
- * name of the Cas Processor
+ * @param aCas
+ * - Cas to analayze
+ * @param aPT
+ * - performance trace object for stats and totals
+ * @param aResourceName
+ * - name of the Cas Processor
* @return - CAS containing results of analysis
- * @throws ServiceException - passthru, wraps Exception
- * @throws ServiceConnectionException passthru
+ * @throws ServiceException
+ * - passthru, wraps Exception
+ * @throws ServiceConnectionException
+ * passthru
*/
public CasData analyze(CasData aCas, ProcessTrace aPT, String aResourceName)
throws ServiceException, ServiceConnectionException {
@@ -793,8 +763,8 @@
if (casDataFs != null) {
newCasData.addFeatureStructure(casDataFs);
}
- vinciCasDataConverter.appendVinciFrameToCasData(responseFrame.fgetAFrame("DATA").fgetAFrame(
- "KEYS"), newCasData);
+ vinciCasDataConverter.appendVinciFrameToCasData(
+ responseFrame.fgetAFrame("DATA").fgetAFrame("KEYS"), newCasData);
aCas = newCasData;
aPT.endEvent(aResourceName, "Vinci Response Frame to CAS", "");
@@ -848,8 +818,10 @@
/**
* Drop named types.
*
- * @param aKeyFrame the a key frame
- * @param aDropKeyList the a drop key list
+ * @param aKeyFrame
+ * the a key frame
+ * @param aDropKeyList
+ * the a drop key list
*/
private void dropNamedTypes(AFrame aKeyFrame, String[] aDropKeyList) {
// Now drop keys this annotator does not want to see
@@ -888,15 +860,18 @@
* frame. These keys are not required by the annotator thus it is waste of bandwidth to include
* them in the request.
*
- * @param aCasList -
- * a list of Cas to send to service for analysis
- * @param aPT -
- * Process Trace object to aggrate time and stats
- * @param aResourceName -
- * name of the Cas Processor
+ * @param aCasList
+ * - a list of Cas to send to service for analysis
+ * @param aPT
+ * - Process Trace object to aggrate time and stats
+ * @param aResourceName
+ * - name of the Cas Processor
* @return - List of Cas instances containing results of analysis
- * @throws ServiceException - passthru, wraps Exception
- * @throws ServiceConnectionException passthru */
+ * @throws ServiceException
+ * - passthru, wraps Exception
+ * @throws ServiceConnectionException
+ * passthru
+ */
public CasData[] analyze(CasData[] aCasList, ProcessTrace aPT, String aResourceName)
throws ServiceException, ServiceConnectionException {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
@@ -979,7 +954,7 @@
return aCasList;
}
ArrayList d = new ArrayList();
- if ( responseFrame != null ) {
+ if (responseFrame != null) {
d = responseFrame.fget("DATA");
}
int instanceCount = 0;
@@ -1041,12 +1016,8 @@
instanceCount++;
} catch (Exception e) {
if (UIMAFramework.getLogger().isLoggable(Level.FINER)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINER,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_exception__FINER",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINER, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_exception__FINER",
new Object[] { Thread.currentThread().getName(), e.getMessage(),
dataFrame.toXML() });
e.printStackTrace();
@@ -1091,16 +1062,13 @@
* service.
*
* @return the analysis engine meta data
- * @throws ResourceServiceException the resource service exception
+ * @throws ResourceServiceException
+ * the resource service exception
*/
public ProcessingResourceMetaData getAnalysisEngineMetaData() throws ResourceServiceException {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_request_metadata__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_request_metadata__FINEST",
new Object[] { Thread.currentThread().getName(), serviceName, conn.getHost(),
String.valueOf(conn.getPort()) });
}
@@ -1114,12 +1082,8 @@
// Send the request to the service and wait for response
resultFrame = (AFrame) conn.sendAndReceive(queryFrame, AFrame.getAFrameFactory(), timeout);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_return_meta__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_return_meta__FINEST",
new Object[] { Thread.currentThread().getName(), serviceName, conn.getHost(),
String.valueOf(conn.getPort()) });
}
@@ -1133,12 +1097,8 @@
ProcessingResourceMetaData metadata = (ProcessingResourceMetaData) saxDeser.getObject();
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_done_parsing_meta__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_done_parsing_meta__FINEST",
new Object[] { Thread.currentThread().getName(), serviceName, conn.getHost(),
String.valueOf(conn.getPort()) });
}
@@ -1157,15 +1117,10 @@
} catch (Exception e) {
if ("No Such Command supported".equals(e.getMessage())) {
if (UIMAFramework.getLogger().isLoggable(Level.WARNING)) {
- UIMAFramework.getLogger(this.getClass())
- .logrb(
- Level.WARNING,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_service_rejected_requested__WARNING",
- new Object[] { Thread.currentThread().getName(), serviceName,
- resultFrame.toXML() });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_service_rejected_requested__WARNING", new Object[] {
+ Thread.currentThread().getName(), serviceName, resultFrame.toXML() });
}
return null;
}
@@ -1183,7 +1138,8 @@
* Let the remote service now that end of batch marker has been reached, the notification is
* one-way meaning the CPE does not expect anything back from the service.
*
- * @throws ResourceServiceException the resource service exception
+ * @throws ResourceServiceException
+ * the resource service exception
*/
public void batchProcessComplete() throws ResourceServiceException {
// For some installations, like WF, dont bother sending end-of-batch marker.
@@ -1196,11 +1152,8 @@
VinciFrame query = new VinciFrame();
query.fadd("vinci:COMMAND", Constants.BATCH_PROCESS_COMPLETE);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_send_batch_complete__FINEST",
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()), query.toXML() });
@@ -1223,7 +1176,8 @@
* service before returning. This ensures that the request is accepted and the desired logic
* handling end of processing has completed.
*
- * @throws ResourceServiceException wraps Exception
+ * @throws ResourceServiceException
+ * wraps Exception
*/
public void collectionProcessComplete() throws ResourceServiceException {
try {
@@ -1231,11 +1185,8 @@
VinciFrame query = new VinciFrame();
query.fadd("vinci:COMMAND", Constants.COLLECTION_PROCESS_COMPLETE);
if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_send_collection_complete__FINEST",
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()), query.toXML() });
@@ -1262,43 +1213,28 @@
* service shut itself down. It does not even wait for response. It is up to the service to clean
* itself up and terminate.
*
- * @param shutdownService -
- * flag indicating if a shutdown command should be sent to the service
- * @param aDoSendNotification -
- * indicates whether or not to sent CollectionProcessComplete frame to service
+ * @param shutdownService
+ * - flag indicating if a shutdown command should be sent to the service
+ * @param aDoSendNotification
+ * - indicates whether or not to sent CollectionProcessComplete frame to service
* @return - true if shutdown message has been sent without error, false otherwise
*/
public boolean shutdown(boolean shutdownService, boolean aDoSendNotification) {
if (System.getProperty("SHOW_STATS") != null) {
- UIMAFramework.getLogger(this.getClass())
- .logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_time_spent_serializing_xcas__FINEST",
- new Object[] { Thread.currentThread().getName(),
- String.valueOf(totalSerializeTime) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_time_spent_serializing_xcas__FINEST", new Object[] {
+ Thread.currentThread().getName(), String.valueOf(totalSerializeTime) });
- UIMAFramework.getLogger(this.getClass())
- .logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_time_spent_deserializing_xcas__FINEST",
- new Object[] { Thread.currentThread().getName(),
- String.valueOf(totalDeSerializeTime) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_time_spent_deserializing_xcas__FINEST", new Object[] {
+ Thread.currentThread().getName(), String.valueOf(totalDeSerializeTime) });
- UIMAFramework.getLogger(this.getClass())
- .logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_time_spent_in_transit__FINEST",
- new Object[] { Thread.currentThread().getName(),
- String.valueOf(totalRoundTripTime) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_time_spent_in_transit__FINEST",
+ new Object[] { Thread.currentThread().getName(),
+ String.valueOf(totalRoundTripTime) });
}
try {
@@ -1313,11 +1249,8 @@
VinciFrame query = new VinciFrame();
query.fadd("vinci:COMMAND", Constants.SHUTDOWN);
if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.INFO,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_stopping_service__INFO",
new Object[] { Thread.currentThread().getName(), conn.getHost(),
String.valueOf(conn.getPort()), query.toXML() });
@@ -1372,23 +1305,19 @@
try {
// establish ownership of query object, otherwise IllegalMonitorStateException is
// thrown. Than give the service time to cleanly exit.
-
- if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_waiting_for_service_shutdown__FINEST",
- new Object[] { Thread.currentThread().getName(), String.valueOf(10 - retry),
- "10" });
- }
- Thread.sleep(100); // wait for 100ms to give the service time to exit cleanly
- if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
- " Resuming CPE shutdown.Service should be down now.");
- }
-
+
+ if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_waiting_for_service_shutdown__FINEST", new Object[] {
+ Thread.currentThread().getName(), String.valueOf(10 - retry), "10" });
+ }
+ Thread.sleep(100); // wait for 100ms to give the service time to exit cleanly
+ if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
+ UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
+ " Resuming CPE shutdown.Service should be down now.");
+ }
+
} catch (InterruptedException e) {
}
if (retry-- <= 0) {
@@ -1419,8 +1348,8 @@
/**
* Sets the VNS port this proxy will use to locate service.
*
- * @param aVNSPort -
- * vns port to use
+ * @param aVNSPort
+ * - vns port to use
*/
public void setVNSPort(String aVNSPort) {
System.setProperty(Vinci.VNS_PORT, aVNSPort);
@@ -1430,8 +1359,8 @@
/**
* Sets the VNS host this proxy will use to locate service.
*
- * @param aVNSHost -
- * name of the VNS host
+ * @param aVNSHost
+ * - name of the VNS host
*/
public void setVNSHost(String aVNSHost) {
vnsHost = aVNSHost;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/OFSocketTransportImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/OFSocketTransportImpl.java
index 178cd28..a897361 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/OFSocketTransportImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/OFSocketTransportImpl.java
@@ -33,13 +33,11 @@
import org.apache.uima.resource.metadata.ProcessingResourceMetaData;
import org.apache.uima.util.Level;
-
/**
* The Class OFSocketTransportImpl.
*/
public class OFSocketTransportImpl implements SocketTransport {
-
/**
* Instantiates a new OF socket transport impl.
*/
@@ -61,8 +59,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.impl.cpm.container.deployer.socket.SocketTransport#connect(java.net.URL,
- * long)
+ * @see
+ * org.apache.uima.collection.impl.cpm.container.deployer.socket.SocketTransport#connect(java.net.
+ * URL, long)
*/
@Override
public Socket connect(URL aURI, long aTimeout) throws SocketException {
@@ -82,8 +81,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.impl.cpm.container.deployer.socket.SocketTransport#invoke(java.net.Socket,
- * org.apache.uima.cas.CAS)
+ * @see
+ * org.apache.uima.collection.impl.cpm.container.deployer.socket.SocketTransport#invoke(java.net.
+ * Socket, org.apache.uima.cas.CAS)
*/
@Override
public CAS process(Socket aSocket, CAS aCas) throws SocketTimeoutException, SocketException {
@@ -93,8 +93,9 @@
try {
if (aSocket.isClosed()) {
- aSocket = connect(new URL("http", aSocket.getInetAddress().getHostName(),
- aSocket.getPort(), ""), 100000);
+ aSocket = connect(
+ new URL("http", aSocket.getInetAddress().getHostName(), aSocket.getPort(), ""),
+ 100000);
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
@@ -146,7 +147,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.impl.cpm.container.deployer.socket.SocketTransport#getProcessingResourceMetaData()
+ * @see org.apache.uima.collection.impl.cpm.container.deployer.socket.SocketTransport#
+ * getProcessingResourceMetaData()
*/
@Override
public ProcessingResourceMetaData getProcessingResourceMetaData(Socket aSocket)
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/ProcessControllerAdapter.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/ProcessControllerAdapter.java
index 32c6c23..c03eba4 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/ProcessControllerAdapter.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/ProcessControllerAdapter.java
@@ -21,29 +21,32 @@
import java.net.URL;
-
/**
* Interface for the custom deployer component responsible for launching and terminating fenced
* CasProcessors.
*
*/
public interface ProcessControllerAdapter {
-
+
/**
* Deploys given number of CasProcessors and returns their endpoint configuration( host,port).
* This method blocks until all Connections are resolved or an error occurs.
*
- * @param aCasProcessorName -name of the fenced CasProcessor
- * @param howMany - how many CasProcessor instances to deploy
+ * @param aCasProcessorName
+ * -name of the fenced CasProcessor
+ * @param howMany
+ * - how many CasProcessor instances to deploy
* @return URL[] - list of URLs containing endpoint info
- * @throws Exception the exception
+ * @throws Exception
+ * the exception
*/
URL[] deploy(String aCasProcessorName, int howMany) throws Exception;
/**
* Stops a given CasProcessor service.
*
- * @param aURL - service endpoint.
+ * @param aURL
+ * - service endpoint.
*
*/
void undeploy(URL aURL);
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/SocketCasProcessorDeployer.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/SocketCasProcessorDeployer.java
index 1f72862..51db432 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/SocketCasProcessorDeployer.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/SocketCasProcessorDeployer.java
@@ -42,7 +42,6 @@
import org.apache.uima.resource.metadata.ProcessingResourceMetaData;
import org.apache.uima.util.Level;
-
/**
* Reference implementation of the {@link CasProcessorDeployer} component responsible for launch and
* termination of the fenced CasProcessor. It uses a plug-in {@link ProcessControllerAdapter} object
@@ -50,7 +49,7 @@
*
*/
public class SocketCasProcessorDeployer implements CasProcessorDeployer {
-
+
/** The cpe factory. */
private CPEFactory cpeFactory = null;
@@ -62,12 +61,13 @@
/** The controller. */
private ProcessControllerAdapter controller = null;
-
/**
* Instantiates a new socket cas processor deployer.
*
- * @param aController the a controller
- * @param aCpeFactory the a cpe factory
+ * @param aController
+ * the a controller
+ * @param aCpeFactory
+ * the a cpe factory
*/
public SocketCasProcessorDeployer(ProcessControllerAdapter aController, CPEFactory aCpeFactory) {
controller = aController;
@@ -77,7 +77,8 @@
/**
* Instantiates a new socket cas processor deployer.
*
- * @param aController the a controller
+ * @param aController
+ * the a controller
*/
public SocketCasProcessorDeployer(ProcessControllerAdapter aController) {
controller = aController;
@@ -89,11 +90,15 @@
* processing thread created here. The <i>aCasProcessorList</i> contains instantiated Cas
* Processors. These are instantiated by the CPEFactory.
*
- * @param aCasProcessorList - list containing instantiated Cas Processors
- * @param aEngine the a engine
- * @param redeploy - true when redeploying failed Cas Processor
+ * @param aCasProcessorList
+ * - list containing instantiated Cas Processors
+ * @param aEngine
+ * the a engine
+ * @param redeploy
+ * - true when redeploying failed Cas Processor
* @return - ProcessingContainer containing pool of CasProcessors
- * @throws ResourceConfigurationException the resource configuration exception
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
public ProcessingContainer deployCasProcessor(List aCasProcessorList, CPMEngine aEngine,
boolean redeploy) throws ResourceConfigurationException {
@@ -103,10 +108,13 @@
/**
* Uses ProcessControllerAdapter instance to launch fenced CasProcessor.
*
- * @param aCasProcessorList the a cas processor list
- * @param redeploy the redeploy
+ * @param aCasProcessorList
+ * the a cas processor list
+ * @param redeploy
+ * the redeploy
* @return the processing container
- * @throws ResourceConfigurationException the resource configuration exception
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
@Override
public ProcessingContainer deployCasProcessor(List aCasProcessorList, boolean redeploy)
@@ -152,7 +160,8 @@
// through
// getCasProcessor() and releaseProcessor() methods.
// Create CasProcess Configuration holding info defined in the CPE descriptor
- casProcessorConfig = new CasProcessorConfigurationJAXBImpl(casProcessorType, cpeFactory.getResourceManager());
+ casProcessorConfig = new CasProcessorConfigurationJAXBImpl(casProcessorType,
+ cpeFactory.getResourceManager());
// Associate CasProcessor configuration from CPE descriptor with this container
processingContainer = new ProcessingContainer_Impl(casProcessorConfig, metaData,
@@ -170,8 +179,8 @@
"UIMA_CPM_unable_to_read_meta__SEVERE", Thread.currentThread().getName());
}
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_casprocessor_no_name_found__SEVERE", new Object[] { Thread
- .currentThread().getName() });
+ "UIMA_CPM_casprocessor_no_name_found__SEVERE",
+ new Object[] { Thread.currentThread().getName() });
}
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
@@ -199,15 +208,15 @@
// There is one instance of ProcessingContainer for set of CasProcessors
if (processingContainer == null) {
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_invalid_container__SEVERE", new Object[] { Thread.currentThread()
- .getName() });
+ "UIMA_CPM_invalid_container__SEVERE",
+ new Object[] { Thread.currentThread().getName() });
}
// Assumption is that the container already exists and it contains CasProcessor configuration
casProcessorConfig = processingContainer.getCasProcessorConfiguration();
if (casProcessorConfig == null) {
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_container_configuration_not_found__SEVERE", new Object[] { Thread
- .currentThread().getName() });
+ "UIMA_CPM_container_configuration_not_found__SEVERE",
+ new Object[] { Thread.currentThread().getName() });
}
} catch (ResourceConfigurationException e) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
@@ -226,8 +235,10 @@
/**
* Uses ProcessControllerAdapter instance to launch fenced CasProcessor.
*
- * @param aProcessingContainer the a processing container
- * @throws ResourceConfigurationException the resource configuration exception
+ * @param aProcessingContainer
+ * the a processing container
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
@Override
public void deployCasProcessor(ProcessingContainer aProcessingContainer)
@@ -240,15 +251,10 @@
ServiceProxyPool pool = aProcessingContainer.getPool();
if (pool == null) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
- UIMAFramework.getLogger(this.getClass())
- .logrb(
- Level.SEVERE,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_no_service_proxy__SEVERE",
- new Object[] { Thread.currentThread().getName(),
- aProcessingContainer.getName() });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_no_service_proxy__SEVERE", new Object[] {
+ Thread.currentThread().getName(), aProcessingContainer.getName() });
}
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_no_service_proxy__SEVERE", new Object[] {
@@ -259,16 +265,12 @@
while (totalPoolSize != pool.getSize()) {
try {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.SEVERE,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_wait_for_service_proxy_pool__FINEST",
- new Object[] { Thread.currentThread().getName(),
- aProcessingContainer.getName() });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE,
+ this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_wait_for_service_proxy_pool__FINEST", new Object[] {
+ Thread.currentThread().getName(), aProcessingContainer.getName() });
}
- pool.wait(); // pool has notifyall when it changes the pool.getSize() result
+ pool.wait(); // pool has notifyall when it changes the pool.getSize() result
} catch (Exception e) {
}
}
@@ -280,15 +282,10 @@
pool.checkIn(cProcessor);
cProcessor = null;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass())
- .logrb(
- Level.SEVERE,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_deploying_service__FINEST",
- new Object[] { Thread.currentThread().getName(),
- aProcessingContainer.getName() });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_deploying_service__FINEST", new Object[] {
+ Thread.currentThread().getName(), aProcessingContainer.getName() });
}
// Launch fenced CasProcessor instances (the same number as totalPoolSize)
@@ -332,11 +329,8 @@
public void undeploy(URL aURL) throws CasProcessorDeploymentException {
try {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.SEVERE,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_undeploying_service__FINEST",
new Object[] { Thread.currentThread().getName(), aURL.getHost(),
String.valueOf(aURL.getPort()) });
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/SocketTransport.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/SocketTransport.java
index ae5f299..96561cf 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/SocketTransport.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/socket/SocketTransport.java
@@ -28,12 +28,11 @@
import org.apache.uima.cas.CAS;
import org.apache.uima.resource.metadata.ProcessingResourceMetaData;
-
/**
* The Interface SocketTransport.
*/
public interface SocketTransport {
-
+
/**
* Returns transport identifier.
*
@@ -45,36 +44,46 @@
* Creates a socket connection to a given endpoint. This method blocks until all Connections are
* resolved or an error occurs.
*
- * @param aURI URI containing service endpoint info: host & port
- * @param aTimeout max time in millis to wait for response
+ * @param aURI
+ * URI containing service endpoint info: host & port
+ * @param aTimeout
+ * max time in millis to wait for response
*
* @return Socket bound to a given endpoint
*
- * @throws SocketException Failed to connect
+ * @throws SocketException
+ * Failed to connect
*/
Socket connect(URL aURI, long aTimeout) throws SocketException;
/**
* Invokes fenced CasProcessor.
*
- * @param aSocket - Socket bound to fenced CasProcessor
- * @param aCas - CAS to be sent to the CasProcessor for analysis
+ * @param aSocket
+ * - Socket bound to fenced CasProcessor
+ * @param aCas
+ * - CAS to be sent to the CasProcessor for analysis
* @return - CAS - CAS returned from the fenced CasProcessor
- * @throws SocketTimeoutException the socket timeout exception
- * @throws SocketException the socket exception
- * @throws AnalysisEngineProcessException the analysis engine process exception
+ * @throws SocketTimeoutException
+ * the socket timeout exception
+ * @throws SocketException
+ * the socket exception
+ * @throws AnalysisEngineProcessException
+ * the analysis engine process exception
*/
- CAS process(Socket aSocket, CAS aCas) throws SocketTimeoutException, SocketException,
- AnalysisEngineProcessException;
+ CAS process(Socket aSocket, CAS aCas)
+ throws SocketTimeoutException, SocketException, AnalysisEngineProcessException;
/**
* Returns metadata associated with the fenced CasProcessor.
*
- * @param aSocket -
- * socket to the fenced CasProcessor
+ * @param aSocket
+ * - socket to the fenced CasProcessor
* @return - metadata
- * @throws SocketException passthru
- * @throws AnalysisEngineProcessException passthru
+ * @throws SocketException
+ * passthru
+ * @throws AnalysisEngineProcessException
+ * passthru
*/
ProcessingResourceMetaData getProcessingResourceMetaData(Socket aSocket)
throws SocketException, AnalysisEngineProcessException;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/vinci/VinciCasProcessorDeployer.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/vinci/VinciCasProcessorDeployer.java
index 8bef471..390dcfb 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/vinci/VinciCasProcessorDeployer.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/vinci/VinciCasProcessorDeployer.java
@@ -63,7 +63,6 @@
import org.apache.vinci.transport.ServiceDownException;
import org.apache.vinci.transport.ServiceException;
-
/**
* Reference implementation of
* {@link org.apache.uima.collection.impl.base_cpm.container.deployer.CasProcessorDeployer} This
@@ -91,7 +90,7 @@
*
*/
public class VinciCasProcessorDeployer implements CasProcessorDeployer {
-
+
/** The Constant LOCAL_VNS. */
public static final String LOCAL_VNS = "LOCAL_VNS";
@@ -144,7 +143,7 @@
private CPEFactory cpeFactory = null;
/** The monitor. */
- private final Object monitor = new Object(); // must be unique object, used for synch
+ private final Object monitor = new Object(); // must be unique object, used for synch
/** The current service list. */
private ArrayList currentServiceList = null;
@@ -152,7 +151,8 @@
/**
* Instantiaes the class and gives it access to CPE configuration.
*
- * @param aCpeFactory the a cpe factory
+ * @param aCpeFactory
+ * the a cpe factory
*/
public VinciCasProcessorDeployer(CPEFactory aCpeFactory) {
cpeFactory = aCpeFactory;
@@ -164,11 +164,15 @@
* processing thread created here. The <i>aCasProcessorList</i> contains instantiated Cas
* Processors. These are instantiated by the CPEFactory.
*
- * @param aCasProcessorList - list containing instantiated Cas Processors
- * @param aEngine the a engine
- * @param redeploy - true when redeploying failed Cas Processor
+ * @param aCasProcessorList
+ * - list containing instantiated Cas Processors
+ * @param aEngine
+ * the a engine
+ * @param redeploy
+ * - true when redeploying failed Cas Processor
* @return - ProcessingContainer containing pool of CasProcessors
- * @throws ResourceConfigurationException the resource configuration exception
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
public ProcessingContainer deployCasProcessor(List aCasProcessorList, CPMEngine aEngine,
boolean redeploy) throws ResourceConfigurationException {
@@ -179,9 +183,10 @@
* Deploys CasProcessor using configuration from provided container. This method is used for
* re-launching failed Cas Processor.
*
- * @param aProcessingContainer -
- * container for deployed CasProcessor.
- * @throws ResourceConfigurationException the resource configuration exception
+ * @param aProcessingContainer
+ * - container for deployed CasProcessor.
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
@Override
public void deployCasProcessor(ProcessingContainer aProcessingContainer)
@@ -203,8 +208,8 @@
throw e;
} catch (Exception e) {
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_unable_to_deploy_service__SEVERE", new Object[] {
- Thread.currentThread().getName(),
+ "UIMA_CPM_unable_to_deploy_service__SEVERE",
+ new Object[] { Thread.currentThread().getName(),
aProcessingContainer.getCasProcessorConfiguration().getName() });
}
}
@@ -217,12 +222,13 @@
* vinci service and creating a connection to it. For un-managed Cas Processor the CPE establishes
* the connection.
*
- * @param aCasProcessorList -
- * list of CasProcessors to deploy
- * @param redeploy -
- * true if intent is to redeploy failed service
+ * @param aCasProcessorList
+ * - list of CasProcessors to deploy
+ * @param redeploy
+ * - true if intent is to redeploy failed service
* @return ProcessinContainer - instance of Container
- * @throws ResourceConfigurationException the resource configuration exception
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
*/
@Override
public ProcessingContainer deployCasProcessor(List aCasProcessorList, boolean redeploy)
@@ -255,7 +261,8 @@
// getCasProcessor() and releaseProcessor() methods.
casProcessorPool = new ServiceProxyPool();
// Create CasProcess Configuration holding info defined in the CPE descriptor
- casProcessorConfig = new CasProcessorConfigurationJAXBImpl(casProcessorType, cpeFactory.getResourceManager());
+ casProcessorConfig = new CasProcessorConfigurationJAXBImpl(casProcessorType,
+ cpeFactory.getResourceManager());
// Associate CasProcessor configuration from CPE descriptor with this container
processingContainer = new ProcessingContainer_Impl(casProcessorConfig, metaData,
@@ -272,8 +279,8 @@
"UIMA_CPM_unable_to_read_meta__SEVERE", Thread.currentThread().getName());
}
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_casprocessor_no_name_found__SEVERE", new Object[] { Thread
- .currentThread().getName() });
+ "UIMA_CPM_casprocessor_no_name_found__SEVERE",
+ new Object[] { Thread.currentThread().getName() });
}
}
// Add CasProcess to the instance pool
@@ -283,15 +290,15 @@
// There is one instance of ProcessingContainer for set of CasProcessors
if (processingContainer == null) {
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_invalid_container__SEVERE", new Object[] { Thread.currentThread()
- .getName() });
+ "UIMA_CPM_invalid_container__SEVERE",
+ new Object[] { Thread.currentThread().getName() });
}
// Assumption is that the container already exists and it contains CasProcessor configuration
casProcessorConfig = processingContainer.getCasProcessorConfiguration();
if (casProcessorConfig == null) {
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_container_configuration_not_found__SEVERE", new Object[] { Thread
- .currentThread().getName() });
+ "UIMA_CPM_container_configuration_not_found__SEVERE",
+ new Object[] { Thread.currentThread().getName() });
}
deployBasedOnModel(processingContainer, casProcessorConfig, false);
@@ -306,14 +313,15 @@
/**
* Deploys CasProcessor according to configured deployment mode.
*
- * @param aProcessingContainer -
- * container managing instances of CasProcessor
- * @param aCasProcessorConfig -
- * CasProcessor configuration
- * @param redeploy -
- * flag indicating if this re-deployment of CasProcessor that failed
+ * @param aProcessingContainer
+ * - container managing instances of CasProcessor
+ * @param aCasProcessorConfig
+ * - CasProcessor configuration
+ * @param redeploy
+ * - flag indicating if this re-deployment of CasProcessor that failed
*
- * @throws ResourceConfigurationException if unknown deployment type
+ * @throws ResourceConfigurationException
+ * if unknown deployment type
*/
private void deployBasedOnModel(ProcessingContainer aProcessingContainer,
CasProcessorConfiguration aCasProcessorConfig, boolean redeploy)
@@ -345,8 +353,8 @@
new Object[] { Thread.currentThread().getName(), name, deployModel });
}
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_unsupported_deploy_mode__SEVERE", new Object[] {
- Thread.currentThread().getName(), name, deployModel });
+ "UIMA_CPM_unsupported_deploy_mode__SEVERE",
+ new Object[] { Thread.currentThread().getName(), name, deployModel });
}
}
@@ -360,11 +368,12 @@
* is the responsibility of the Cas Processor to to read this information and use it to locate VNS
* the CPE is managing.
*
- * @param aProcessingContainer -
- * container object that will hold proxies to Cas Processor when it is launched
- * @param redeploy -
- * true if intent is to redeploy failed service
- * @throws ResourceConfigurationException if the descriptor is invalid or for any internal Exception (wrapped)
+ * @param aProcessingContainer
+ * - container object that will hold proxies to Cas Processor when it is launched
+ * @param redeploy
+ * - true if intent is to redeploy failed service
+ * @throws ResourceConfigurationException
+ * if the descriptor is invalid or for any internal Exception (wrapped)
*/
private void deployLocal(ProcessingContainer aProcessingContainer, boolean redeploy)
throws ResourceConfigurationException {
@@ -408,11 +417,8 @@
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_deploy_with_mode__FINEST",
new Object[] { Thread.currentThread().getName(), casProcessorConfig.getName(),
casProcessorConfig.getDeploymentType() });
@@ -428,8 +434,8 @@
associateMetadataWithContainer(aProcessingContainer);
} else {
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_invalid_cpe_descriptor__SEVERE", new Object[] {
- Thread.currentThread().getName(), name, "runInSeparateProcess" });
+ "UIMA_CPM_invalid_cpe_descriptor__SEVERE",
+ new Object[] { Thread.currentThread().getName(), name, "runInSeparateProcess" });
}
} catch (Exception e) {
throw new ResourceConfigurationException(e);
@@ -439,8 +445,8 @@
/**
* Retrieve the metadata from the service and add it to the container.
*
- * @param aProcessingContainer -
- * container where the metadata will be saved
+ * @param aProcessingContainer
+ * - container where the metadata will be saved
*/
private void associateMetadataWithContainer(ProcessingContainer aProcessingContainer) {
CasProcessor processor = null;
@@ -467,14 +473,16 @@
* Launches an application as a seperate process using java's Process object. Actually, it
* launches as many copies of the application as given in the <i>howMany</i> parameter.
*
- * @param aProcessingContainer the a processing container
- * @param casProcessorConfig -
- * Configuration containing start up command
- * @param redeploy -
- * true if intent is to redeploy failed application
- * @param howMany -
- * how many seperate process to spawn
- * @throws CasProcessorDeploymentException wraps any exception
+ * @param aProcessingContainer
+ * the a processing container
+ * @param casProcessorConfig
+ * - Configuration containing start up command
+ * @param redeploy
+ * - true if intent is to redeploy failed application
+ * @param howMany
+ * - how many seperate process to spawn
+ * @throws CasProcessorDeploymentException
+ * wraps any exception
*/
private void launchLocalService(ProcessingContainer aProcessingContainer,
CasProcessorConfiguration casProcessorConfig, boolean redeploy, int howMany)
@@ -529,11 +537,8 @@
for (int i = 0; cmd != null && i < cmd.length; i++) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_launching_with_service_cmd__FINEST",
new Object[] { Thread.currentThread().getName(), casProcessorConfig.getName(),
String.valueOf(i), cmd[i] });
@@ -544,25 +549,19 @@
if ((env = exec.getEnvironment()) != null && env.length > 0) {
for (int i = 0; i < env.length; i++) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_launching_with_service_env__FINEST",
- new Object[] { Thread.currentThread().getName(),
- casProcessorConfig.getName(), String.valueOf(i), env[i] });
+ new Object[] { Thread.currentThread().getName(), casProcessorConfig.getName(),
+ String.valueOf(i), env[i] });
}
}
if (System.getProperty("os.name").equalsIgnoreCase("linux")) {
for (int i = 0; execCommand != null && i < execCommand.length; i++) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_launching_with_service_exec__FINEST",
new Object[] { Thread.currentThread().getName(),
casProcessorConfig.getName(), String.valueOf(i), execCommand[i] });
@@ -577,11 +576,8 @@
if (System.getProperty("os.name").equalsIgnoreCase("linux")) {
for (int i = 0; execCommand != null && i < execCommand.length; i++) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_launching_with_service_exec__FINEST",
new Object[] { Thread.currentThread().getName(),
casProcessorConfig.getName(), String.valueOf(i), execCommand[i] });
@@ -615,9 +611,12 @@
* No-op for integrated deployment. Integrated CasProcessors are instantiated using UIMA framework
* factory in the CPEFactory.
*
- * @param aProcessingContainer the a processing container
- * @param redeploy the redeploy
- * @throws ResourceConfigurationException tbd
+ * @param aProcessingContainer
+ * the a processing container
+ * @param redeploy
+ * the redeploy
+ * @throws ResourceConfigurationException
+ * tbd
*/
private void deployIntegrated(ProcessingContainer aProcessingContainer, boolean redeploy)
throws ResourceConfigurationException {
@@ -630,11 +629,12 @@
* Processor via provided VNS. The exact VNS used here is defined on per Cas Processor in the cpe
* descriptor.
*
- * @param aProcessingContainer -
- * container that will manage instances of the CasProcessor
- * @param redeploy -
- * flag indicating if this redeployment of failed CasProcessor
- * @throws ResourceConfigurationException wraps exception
+ * @param aProcessingContainer
+ * - container that will manage instances of the CasProcessor
+ * @param redeploy
+ * - flag indicating if this redeployment of failed CasProcessor
+ * @throws ResourceConfigurationException
+ * wraps exception
*/
private void deployRemote(ProcessingContainer aProcessingContainer, boolean redeploy)
throws ResourceConfigurationException {
@@ -643,12 +643,8 @@
String name = casProcessorConfig.getName();
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_deploy_with_mode__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_deploy_with_mode__FINEST",
new Object[] { Thread.currentThread().getName(), name,
casProcessorConfig.getDeploymentType() });
}
@@ -694,11 +690,8 @@
if (processor instanceof NetworkCasProcessorImpl) {
if (((NetworkCasProcessorImpl) processor).getProxy() == null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_reducing_cp_instance_count__FINEST",
new Object[] { Thread.currentThread().getName(), name,
casProcessorConfig.getDeploymentType() });
@@ -724,20 +717,20 @@
* Create and attach a proxies to vinci services. For services with exclusive access, makes sure
* that there is only one proxy per service. Otherwise the services are shared.
*
- * @param redeploy -
- * true if the connection is made as part of the recovery due to previous service crash
+ * @param redeploy
+ * - true if the connection is made as part of the recovery due to previous service crash
* or termination.
- * @param aServiceUri -
- * servie uri, this is a vinci service name
- * @param howMany -
- * how many proxies to create and connect
- * @param aProcessingContainer -
- * hosting container for the proxies. Proxies are assigned to a pool managed by the
+ * @param aServiceUri
+ * - servie uri, this is a vinci service name
+ * @param howMany
+ * - how many proxies to create and connect
+ * @param aProcessingContainer
+ * - hosting container for the proxies. Proxies are assigned to a pool managed by the
* container.
*
* @return - how many proxies were created
- * @throws Exception -
- * error
+ * @throws Exception
+ * - error
*/
private int attachToServices(boolean redeploy, String aServiceUri, int howMany,
ProcessingContainer aProcessingContainer) throws Exception {
@@ -754,11 +747,8 @@
String serviceAccess = casProcessorConfig.getDeploymentParameter("service-access");
if (serviceAccess != null && serviceAccess.equalsIgnoreCase("exclusive")) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_cp_with_exclusive_access__FINEST",
new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
casProcessorConfig.getDeploymentType() });
@@ -771,11 +761,8 @@
// In case the service starts on the same port as before it crashed, mark it as
// available in the current service list
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_retrieve_cp_from_failed_cplist__FINEST",
new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
casProcessorConfig.getDeploymentType() });
@@ -808,8 +795,8 @@
if (serviceList == null || serviceList.size() == 0 && redeploy == false) {
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_no_service_in_vns__FINEST", new Object[] {
- Thread.currentThread().getName(), aServiceUri,
+ "UIMA_CPM_no_service_in_vns__FINEST",
+ new Object[] { Thread.currentThread().getName(), aServiceUri,
casProcessorConfig.getDeploymentType(),
casProcessorConfig.getDeploymentParameter(Constants.VNS_HOST),
casProcessorConfig.getDeploymentParameter(Constants.VNS_PORT) });
@@ -846,11 +833,8 @@
for (int i = 0; i < howMany; i++) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_activating_service__FINEST",
new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
String.valueOf(i), String.valueOf(howMany) });
@@ -910,14 +894,10 @@
if (ex.getCause() instanceof ServiceException
|| ex.getCause() instanceof ServiceDownException) {
if (UIMAFramework.getLogger().isLoggable(Level.WARNING)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.WARNING,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_activating_service__WARNING",
- new Object[] { Thread.currentThread().getName(),
- aProcessingContainer.getName() });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING,
+ this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_activating_service__WARNING", new Object[] {
+ Thread.currentThread().getName(), aProcessingContainer.getName() });
}
// Increment number of CasProcessor restarts (redeploys)
restartCount++;
@@ -940,7 +920,8 @@
/**
* Gets the next available.
*
- * @param aServiceList the a service list
+ * @param aServiceList
+ * the a service list
* @return the next available
*/
private VinciServiceInfo getNextAvailable(ArrayList aServiceList) {
@@ -962,12 +943,13 @@
/**
* Query configured VNS for a list of services with a given service URI.
*
- * @param aServiceUri -
- * named service endpoint
- * @param aCasProcessorConfig -
- * Cas Processor configuration
+ * @param aServiceUri
+ * - named service endpoint
+ * @param aCasProcessorConfig
+ * - Cas Processor configuration
* @return - List of services provided by VNS
- * @throws Exception passthru
+ * @throws Exception
+ * passthru
*/
private ArrayList getNewServiceList(String aServiceUri,
CasProcessorConfiguration aCasProcessorConfig) throws Exception {
@@ -982,10 +964,11 @@
* Handles situation when max restart threshold is reached while connecting to CasProcessor.
*
*
- * @param aProcessingContainer -
- * container holding CasProcessor configuration
+ * @param aProcessingContainer
+ * - container holding CasProcessor configuration
*
- * @throws ResourceConfigurationException when max restarts limit reached
+ * @throws ResourceConfigurationException
+ * when max restarts limit reached
*/
private void handleMaxRestartThresholdReached(ProcessingContainer aProcessingContainer)
throws ResourceConfigurationException {
@@ -993,23 +976,15 @@
.getCasProcessorConfiguration();
String name = casProcessorConfig.getName();
if (UIMAFramework.getLogger().isLoggable(Level.WARNING)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.WARNING,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_restart_exceeded__WARNING",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_restart_exceeded__WARNING",
new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
String.valueOf(casProcessorConfig.getMaxRestartCount()) });
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_restart_exceeded__WARNING",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_restart_exceeded__WARNING",
new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
casProcessorConfig.getActionOnMaxRestart() });
}
@@ -1017,26 +992,24 @@
if (Constants.TERMINATE_CPE.equals(casProcessorConfig.getActionOnMaxRestart())) {
if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),
- "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_terminate_onerrors__INFO",
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_terminate_onerrors__INFO",
new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName() });
}
- throw new ResourceConfigurationException(new AbortCPMException(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_configured_to_abort__WARNING", new Object[] {
- Thread.currentThread().getName(), name })));
+ throw new ResourceConfigurationException(
+ new AbortCPMException(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_configured_to_abort__WARNING",
+ new Object[] { Thread.currentThread().getName(), name })));
}
if (Constants.KILL_PROCESSING_PIPELINE.equals(casProcessorConfig.getActionOnMaxRestart())) {
if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),
- "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_terminate_pipeline__INFO",
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_terminate_pipeline__INFO",
new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName() });
}
- throw new ResourceConfigurationException(new KillPipelineException(CpmLocalizedMessage
- .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_configured_to_kill_pipeline__WARNING", new Object[] {
- Thread.currentThread().getName(), name })));
+ throw new ResourceConfigurationException(new KillPipelineException(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_configured_to_kill_pipeline__WARNING",
+ new Object[] { Thread.currentThread().getName(), name })));
} else if (Constants.DISABLE_CASPROCESSOR.equals(casProcessorConfig.getActionOnMaxRestart())) {
aProcessingContainer.setStatus(Constants.CAS_PROCESSOR_DISABLED);
if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {
@@ -1056,10 +1029,11 @@
/**
* Returns CasProcessor service name from a descriptor.
*
- * @param aCasProcessorConfig -
- * CasProcessor configuration containing service descriptor path
+ * @param aCasProcessorConfig
+ * - CasProcessor configuration containing service descriptor path
* @return - name of the service
- * @throws ResourceConfigurationException if the uri is missing or empty
+ * @throws ResourceConfigurationException
+ * if the uri is missing or empty
*/
private String getServiceUri(CasProcessorConfiguration aCasProcessorConfig)
throws ResourceConfigurationException {
@@ -1070,8 +1044,8 @@
String uri = uriSpecifier.getUri();
if (uri == null || uri.trim().length() == 0) {
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_invalid_deployment__SEVERE", new Object[] {
- Thread.currentThread().getName(), descriptorUrl, uri });
+ "UIMA_CPM_invalid_deployment__SEVERE",
+ new Object[] { Thread.currentThread().getName(), descriptorUrl, uri });
}
return uri;
@@ -1080,17 +1054,19 @@
/**
* Returns URISpecifier.
*
- * @param aDescriptorUrl the a descriptor url
+ * @param aDescriptorUrl
+ * the a descriptor url
* @return URISpecifier
- * @throws ResourceConfigurationException if the resource specifier in the URI is not a URISpecifier
+ * @throws ResourceConfigurationException
+ * if the resource specifier in the URI is not a URISpecifier
*/
private URISpecifier getURISpecifier(URL aDescriptorUrl) throws ResourceConfigurationException {
ResourceSpecifier resourceSpecifier = getSpecifier(aDescriptorUrl);
if (!(resourceSpecifier instanceof URISpecifier)) {
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_invalid_deployment__SEVERE", new Object[] {
- Thread.currentThread().getName(), aDescriptorUrl, null });
+ "UIMA_CPM_invalid_deployment__SEVERE",
+ new Object[] { Thread.currentThread().getName(), aDescriptorUrl, null });
}
return (URISpecifier) resourceSpecifier;
}
@@ -1098,10 +1074,11 @@
/**
* Parses given service descriptor and returns initialized ResourceSpecifier.
*
- * @param aUrl -
- * URL of the descriptor
+ * @param aUrl
+ * - URL of the descriptor
* @return - ResourceSpecifier parsed from descriptor
- * @throws ResourceConfigurationException wraps Exception
+ * @throws ResourceConfigurationException
+ * wraps Exception
*/
private ResourceSpecifier getSpecifier(URL aUrl) throws ResourceConfigurationException {
try {
@@ -1110,28 +1087,26 @@
} catch (Exception e) {
e.printStackTrace();
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_invalid_deployment__SEVERE", new Object[] {
- Thread.currentThread().getName(), aUrl, null });
+ "UIMA_CPM_invalid_deployment__SEVERE",
+ new Object[] { Thread.currentThread().getName(), aUrl, null });
}
}
/**
* Deploys internal VNS for use with local CasProcessor deployments.
*
- * @param casProcessorConfig -
- * CasProcessor configuration
- * @param redeploy -
- * flag indicating if VNS being redeployed
- * @throws CasProcessorDeploymentException wraps Exception
+ * @param casProcessorConfig
+ * - CasProcessor configuration
+ * @param redeploy
+ * - flag indicating if VNS being redeployed
+ * @throws CasProcessorDeploymentException
+ * wraps Exception
*/
private void deployVNS(CasProcessorConfiguration casProcessorConfig, boolean redeploy)
throws CasProcessorDeploymentException {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.SEVERE,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_deploy_vns_redeploy__FINEST",
new Object[] { Thread.currentThread().getName(), String.valueOf(redeploy),
String.valueOf(restartCount) });
@@ -1164,10 +1139,10 @@
try {
vns = new LocalVNS(startPort, maxPort, vnsPort);
vns.setConnectionPool(portQueue);
-
+
localVNSThread = new Thread(vns);
localVNSThread.start();
-
+
} catch (Exception e) {
throw new CasProcessorDeploymentException(e);
}
@@ -1176,77 +1151,83 @@
}
// Never called
-// /**
-// * Creates a proxy and connects it to Vinci service running on a given port. Once connected the
-// * proxy is associated with Cas Processor.
-// *
-// * @param aCasProcessorConfig -
-// * CasProcessor configuration
-// * @param port -
-// * port wher vinci service is listening
-// * @return Connected proxy to service
-// *
-// * @throws ResourceInitializationException
-// * @throws ResourceConfigurationException
-// */
-// private synchronized boolean activateProcessor(CasProcessorConfiguration aCasProcessorConfig,
-// String aHost, int aPort) throws ResourceInitializationException,
-// ResourceConfigurationException {
-// // Instantiate proxy from given configuration
-// VinciTAP tap = getTextAnalysisProxy(aCasProcessorConfig);
-// if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
-// UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
-// "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
-// "UIMA_CPM_activating_service_on_port__FINEST",
-// new Object[] { Thread.currentThread().getName(), String.valueOf(aPort) });
-// }
-// boolean tryAgain = true;
-// int maxCount = aCasProcessorConfig.getMaxRestartCount();
-// while (tryAgain) {
-// try {
-// // Connect proxy to service running on given port on the same machine as the CPM
-// tap.connect(aHost, aPort);
-// // Connection established no need to retry
-// tryAgain = false;
-// } catch (Exception e) {
-// if (maxCount-- == 0) {
-// e.printStackTrace();
-// if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
-// UIMAFramework.getLogger(this.getClass()).log(Level.SEVERE,
-// Thread.currentThread().getName() + "", e);
-// }
-// throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
-// "UIMA_CPM_no_service_connection__SEVERE", new Object[] {
-// Thread.currentThread().getName(), String.valueOf(aPort), aHost,
-// aCasProcessorConfig.getName() });
-// }
-// try {
-// synchronized (monitor) {
-// monitor.wait(SLEEP_TIME);
-// }
-// } catch (InterruptedException ex) {
-// }
-// }
-// }
-// // At this point there is a connected proxy (tap), now we need to add it to container that will
-// // menage it.
-// bindProxyToNetworkCasProcessor(tap);
-// return true;
-// }
+ // /**
+ // * Creates a proxy and connects it to Vinci service running on a given port. Once connected the
+ // * proxy is associated with Cas Processor.
+ // *
+ // * @param aCasProcessorConfig -
+ // * CasProcessor configuration
+ // * @param port -
+ // * port wher vinci service is listening
+ // * @return Connected proxy to service
+ // *
+ // * @throws ResourceInitializationException
+ // * @throws ResourceConfigurationException
+ // */
+ // private synchronized boolean activateProcessor(CasProcessorConfiguration aCasProcessorConfig,
+ // String aHost, int aPort) throws ResourceInitializationException,
+ // ResourceConfigurationException {
+ // // Instantiate proxy from given configuration
+ // VinciTAP tap = getTextAnalysisProxy(aCasProcessorConfig);
+ // if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
+ // UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
+ // "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ // "UIMA_CPM_activating_service_on_port__FINEST",
+ // new Object[] { Thread.currentThread().getName(), String.valueOf(aPort) });
+ // }
+ // boolean tryAgain = true;
+ // int maxCount = aCasProcessorConfig.getMaxRestartCount();
+ // while (tryAgain) {
+ // try {
+ // // Connect proxy to service running on given port on the same machine as the CPM
+ // tap.connect(aHost, aPort);
+ // // Connection established no need to retry
+ // tryAgain = false;
+ // } catch (Exception e) {
+ // if (maxCount-- == 0) {
+ // e.printStackTrace();
+ // if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
+ // UIMAFramework.getLogger(this.getClass()).log(Level.SEVERE,
+ // Thread.currentThread().getName() + "", e);
+ // }
+ // throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ // "UIMA_CPM_no_service_connection__SEVERE", new Object[] {
+ // Thread.currentThread().getName(), String.valueOf(aPort), aHost,
+ // aCasProcessorConfig.getName() });
+ // }
+ // try {
+ // synchronized (monitor) {
+ // monitor.wait(SLEEP_TIME);
+ // }
+ // } catch (InterruptedException ex) {
+ // }
+ // }
+ // }
+ // // At this point there is a connected proxy (tap), now we need to add it to container that will
+ // // menage it.
+ // bindProxyToNetworkCasProcessor(tap);
+ // return true;
+ // }
/**
* Creates a proxy and connects it to Vinci service running on a given port. Once connected the
* proxy is associated with Cas Processor.
*
- * @param aCasProcessorConfig -
- * CasProcessor configuration
- * @param aHost the a host
- * @param aPort the a port
- * @param aProcessingContainer the a processing container
- * @param redeploy the redeploy
+ * @param aCasProcessorConfig
+ * - CasProcessor configuration
+ * @param aHost
+ * the a host
+ * @param aPort
+ * the a port
+ * @param aProcessingContainer
+ * the a processing container
+ * @param redeploy
+ * the redeploy
* @return Connected proxy to service
- * @throws ResourceConfigurationException wraps Exception
- * @throws Exception passthru
+ * @throws ResourceConfigurationException
+ * wraps Exception
+ * @throws Exception
+ * passthru
*/
private synchronized boolean activateProcessor(CasProcessorConfiguration aCasProcessorConfig,
String aHost, int aPort, ProcessingContainer aProcessingContainer, boolean redeploy)
@@ -1275,8 +1256,8 @@
Thread.currentThread().getName() + "", e);
}
throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_no_service_connection__SEVERE", new Object[] {
- Thread.currentThread().getName(), String.valueOf(aPort), aHost,
+ "UIMA_CPM_no_service_connection__SEVERE",
+ new Object[] { Thread.currentThread().getName(), String.valueOf(aPort), aHost,
aCasProcessorConfig.getName() });
}
try {
@@ -1296,14 +1277,17 @@
/**
* Creates a proxy and connects it to Vinci service. Uses VNS to locate service by name.
*
- * @param aCasProcessorConfig -
- * CasProcees configuration
- * @param aService -
- * name of the vinci service
- * @param aProcessingContainer the a processing container
- * @param redeploy the redeploy
+ * @param aCasProcessorConfig
+ * - CasProcees configuration
+ * @param aService
+ * - name of the vinci service
+ * @param aProcessingContainer
+ * the a processing container
+ * @param redeploy
+ * the redeploy
* @return - connected Proxy
- * @throws Exception passthru
+ * @throws Exception
+ * passthru
*/
private synchronized boolean activateProcessor(CasProcessorConfiguration aCasProcessorConfig,
String aService, ProcessingContainer aProcessingContainer, boolean redeploy) // throws
@@ -1330,7 +1314,7 @@
while (tryAgain) {
try {
- if ( sleepBetweenRetries ) {
+ if (sleepBetweenRetries) {
wait(maxTimeToWait);
} else {
sleepBetweenRetries = true;
@@ -1354,17 +1338,14 @@
if (maxCount-- == 0) {
e.printStackTrace();
if (UIMAFramework.getLogger().isLoggable(Level.WARNING)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.WARNING,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_max_connect_retries_exceeded__FINEST",
- new Object[] { Thread.currentThread().getName(), aService,
- String.valueOf(maxCount) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_max_connect_retries_exceeded__FINEST", new Object[] {
+ Thread.currentThread().getName(), aService, String.valueOf(maxCount) });
}
- throw new ResourceInitializationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE, new Object[] {
- Thread.currentThread().getName(), aService, String.valueOf(maxCount) },
+ throw new ResourceInitializationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ new Object[] { Thread.currentThread().getName(), aService,
+ String.valueOf(maxCount) },
new ServiceConnectionException("Unable to connect to service :::" + aService));
}
}
@@ -1376,142 +1357,142 @@
}
// Never called
-// /**
-// * Associates connected proxy with an instance of CasProcessor.
-// *
-// * @param aTap -
-// * connected proxy
-// */
-// private void bindProxyToNetworkCasProcessor(VinciTAP aTap) {
-// if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
-// UIMAFramework.getLogger(this.getClass())
-// .logrb(
-// Level.FINEST,
-// this.getClass().getName(),
-// "initialize",
-// CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
-// "UIMA_CPM_get_cp_from_pool__FINEST",
-// new Object[] { Thread.currentThread().getName(), aTap.getServiceHost(),
-// String.valueOf(aTap.getServicePort()),
-// String.valueOf(casProcessorPool.getSize()) });
-// }
-// synchronized (casProcessorPool) {
-// if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
-// UIMAFramework.getLogger(this.getClass()).logrb(
-// Level.FINEST,
-// this.getClass().getName(),
-// "initialize",
-// CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
-// "UIMA_CPM_get_cp_from_pool__FINEST",
-// new Object[] { Thread.currentThread().getName(), aTap.getServiceHost(),
-// String.valueOf(aTap.getServicePort()),
-// String.valueOf(casProcessorPool.getSize()) });
-// }
-// CasProcessor processor = null;
-// // There are as many Cas Processors as there are Procesing Threads. All of them have been
-// // already created and exist
-// // in the cas processor pool. Cas Processor may or may not already have an associated proxy.
-// // So here we cycle through all Cas Processors until we find one that has not yet have a proxy
-// // and
-// // add it.
-// for (int i = 0; i < casProcessorPool.getSize(); i++) {
-// try {
-// // Check out the next Cas Processor from the pool
-// processor = casProcessorPool.checkOut();
-// if (processor == null) {
-// if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
-// UIMAFramework.getLogger(this.getClass()).logrb(
-// Level.SEVERE,
-// this.getClass().getName(),
-// "initialize",
-// CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
-// "UIMA_CPM_get_cp_from_pool_error__SEVERE",
-// new Object[] { Thread.currentThread().getName(), aTap.getServiceHost(),
-// String.valueOf(aTap.getServicePort()),
-// String.valueOf(casProcessorPool.getSize()) });
-// }
-// continue;
-// }
-// // Add proxy only to instances of NetworkCasProcessorImpl
-// if (processor instanceof NetworkCasProcessorImpl) {
-// NetworkCasProcessorImpl netProcessor = (NetworkCasProcessorImpl) processor;
-// // Check if this Cas Processor has already been assigned a proxy. If so,
-// // get the next Cas Processor
-// if (netProcessor.getProxy() != null && netProcessor.getProxy().isConnected()) {
-// if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
-// UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
-// this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
-// "UIMA_CPM_already_allocated__FINEST",
-// new Object[] { Thread.currentThread().getName(), String.valueOf(i) });
-// }
-// continue;
-// }
-// if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
-// UIMAFramework.getLogger(this.getClass()).logrb(
-// Level.FINEST,
-// this.getClass().getName(),
-// "initialize",
-// CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
-// "UIMA_CPM_assign_cp_to_service__FINEST",
-// new Object[] { Thread.currentThread().getName(), String.valueOf(i),
-// aTap.getServiceHost(), String.valueOf(aTap.getServicePort()) });
-// }
-// // Associate the proxy with this Cas Processor
-// ((NetworkCasProcessorImpl) processor).setProxy(aTap);
-// synchronized (monitor) {
-//
-// monitor.notifyAll();
-// }
-// }
-// break;
-// } catch (Exception e) {
-// e.printStackTrace();
-// } finally {
-// if (processor != null) {
-// if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
-// UIMAFramework.getLogger(this.getClass()).logrb(
-// Level.FINEST,
-// this.getClass().getName(),
-// "initialize",
-// CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
-// "UIMA_CPM_checkin_cp_to_pool__FINEST",
-// new Object[] { Thread.currentThread().getName(), String.valueOf(i),
-// aTap.getServiceHost(), String.valueOf(aTap.getServicePort()) });
-// }
-// casProcessorPool.checkIn(processor);
-// if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
-// UIMAFramework.getLogger(this.getClass()).logrb(
-// Level.FINEST,
-// this.getClass().getName(),
-// "initialize",
-// CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
-// "UIMA_CPM_checked_in_cp_to_pool__FINEST",
-// new Object[] { Thread.currentThread().getName(), String.valueOf(i),
-// aTap.getServiceHost(), String.valueOf(aTap.getServicePort()) });
-// }
-// }
-// }
-// }
-// }
-// }
+ // /**
+ // * Associates connected proxy with an instance of CasProcessor.
+ // *
+ // * @param aTap -
+ // * connected proxy
+ // */
+ // private void bindProxyToNetworkCasProcessor(VinciTAP aTap) {
+ // if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
+ // UIMAFramework.getLogger(this.getClass())
+ // .logrb(
+ // Level.FINEST,
+ // this.getClass().getName(),
+ // "initialize",
+ // CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ // "UIMA_CPM_get_cp_from_pool__FINEST",
+ // new Object[] { Thread.currentThread().getName(), aTap.getServiceHost(),
+ // String.valueOf(aTap.getServicePort()),
+ // String.valueOf(casProcessorPool.getSize()) });
+ // }
+ // synchronized (casProcessorPool) {
+ // if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
+ // UIMAFramework.getLogger(this.getClass()).logrb(
+ // Level.FINEST,
+ // this.getClass().getName(),
+ // "initialize",
+ // CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ // "UIMA_CPM_get_cp_from_pool__FINEST",
+ // new Object[] { Thread.currentThread().getName(), aTap.getServiceHost(),
+ // String.valueOf(aTap.getServicePort()),
+ // String.valueOf(casProcessorPool.getSize()) });
+ // }
+ // CasProcessor processor = null;
+ // // There are as many Cas Processors as there are Procesing Threads. All of them have been
+ // // already created and exist
+ // // in the cas processor pool. Cas Processor may or may not already have an associated proxy.
+ // // So here we cycle through all Cas Processors until we find one that has not yet have a proxy
+ // // and
+ // // add it.
+ // for (int i = 0; i < casProcessorPool.getSize(); i++) {
+ // try {
+ // // Check out the next Cas Processor from the pool
+ // processor = casProcessorPool.checkOut();
+ // if (processor == null) {
+ // if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
+ // UIMAFramework.getLogger(this.getClass()).logrb(
+ // Level.SEVERE,
+ // this.getClass().getName(),
+ // "initialize",
+ // CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ // "UIMA_CPM_get_cp_from_pool_error__SEVERE",
+ // new Object[] { Thread.currentThread().getName(), aTap.getServiceHost(),
+ // String.valueOf(aTap.getServicePort()),
+ // String.valueOf(casProcessorPool.getSize()) });
+ // }
+ // continue;
+ // }
+ // // Add proxy only to instances of NetworkCasProcessorImpl
+ // if (processor instanceof NetworkCasProcessorImpl) {
+ // NetworkCasProcessorImpl netProcessor = (NetworkCasProcessorImpl) processor;
+ // // Check if this Cas Processor has already been assigned a proxy. If so,
+ // // get the next Cas Processor
+ // if (netProcessor.getProxy() != null && netProcessor.getProxy().isConnected()) {
+ // if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
+ // UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ // this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ // "UIMA_CPM_already_allocated__FINEST",
+ // new Object[] { Thread.currentThread().getName(), String.valueOf(i) });
+ // }
+ // continue;
+ // }
+ // if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
+ // UIMAFramework.getLogger(this.getClass()).logrb(
+ // Level.FINEST,
+ // this.getClass().getName(),
+ // "initialize",
+ // CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ // "UIMA_CPM_assign_cp_to_service__FINEST",
+ // new Object[] { Thread.currentThread().getName(), String.valueOf(i),
+ // aTap.getServiceHost(), String.valueOf(aTap.getServicePort()) });
+ // }
+ // // Associate the proxy with this Cas Processor
+ // ((NetworkCasProcessorImpl) processor).setProxy(aTap);
+ // synchronized (monitor) {
+ //
+ // monitor.notifyAll();
+ // }
+ // }
+ // break;
+ // } catch (Exception e) {
+ // e.printStackTrace();
+ // } finally {
+ // if (processor != null) {
+ // if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
+ // UIMAFramework.getLogger(this.getClass()).logrb(
+ // Level.FINEST,
+ // this.getClass().getName(),
+ // "initialize",
+ // CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ // "UIMA_CPM_checkin_cp_to_pool__FINEST",
+ // new Object[] { Thread.currentThread().getName(), String.valueOf(i),
+ // aTap.getServiceHost(), String.valueOf(aTap.getServicePort()) });
+ // }
+ // casProcessorPool.checkIn(processor);
+ // if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
+ // UIMAFramework.getLogger(this.getClass()).logrb(
+ // Level.FINEST,
+ // this.getClass().getName(),
+ // "initialize",
+ // CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ // "UIMA_CPM_checked_in_cp_to_pool__FINEST",
+ // new Object[] { Thread.currentThread().getName(), String.valueOf(i),
+ // aTap.getServiceHost(), String.valueOf(aTap.getServicePort()) });
+ // }
+ // }
+ // }
+ // }
+ // }
+ // }
/**
* Associates connected proxy with an instance of CasProcessor.
*
- * @param aTap -
- * connected proxy
- * @param aProcessingContainer the a processing container
- * @param redeploy the redeploy
- * @throws Exception the exception
+ * @param aTap
+ * - connected proxy
+ * @param aProcessingContainer
+ * the a processing container
+ * @param redeploy
+ * the redeploy
+ * @throws Exception
+ * the exception
*/
private void bindProxyToNetworkCasProcessor(VinciTAP aTap,
ProcessingContainer aProcessingContainer, boolean redeploy) throws Exception {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_checked_in_cp_to_pool__FINEST",
new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
aTap.getServiceHost(), String.valueOf(aTap.getServicePort()) });
@@ -1523,8 +1504,8 @@
// Check out the next Cas Processor from the pool
if (((ProcessingContainer_Impl) aProcessingContainer).failedCasProcessorList.isEmpty()) {
throw new ResourceProcessException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_no_cp_instance_in_failed_list__FINEST", new Object[] {
- Thread.currentThread().getName(), aProcessingContainer.getName(),
+ "UIMA_CPM_no_cp_instance_in_failed_list__FINEST",
+ new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
aTap.getServiceHost(), String.valueOf(aTap.getServicePort()) },
new Exception(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
@@ -1538,15 +1519,11 @@
if (processor instanceof NetworkCasProcessorImpl) {
// NetworkCasProcessorImpl netProcessor = (NetworkCasProcessorImpl) processor;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_assign_cp_to_service__FINEST",
- new Object[] { Thread.currentThread().getName(),
- aProcessingContainer.getName(), aTap.getServiceHost(),
- String.valueOf(aTap.getServicePort()) });
+ new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
+ aTap.getServiceHost(), String.valueOf(aTap.getServicePort()) });
}
// Associate the proxy with this Cas Processor
((NetworkCasProcessorImpl) processor).setProxy(aTap);
@@ -1564,11 +1541,8 @@
processor = casProcessorPool.checkOut();
if (processor == null) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.SEVERE,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE,
+ this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_get_cp_from_pool_error__SEVERE",
new Object[] { Thread.currentThread().getName(), aTap.getServiceHost(),
String.valueOf(aTap.getServicePort()),
@@ -1592,11 +1566,8 @@
continue;
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_assign_cp_to_service__FINEST",
new Object[] { Thread.currentThread().getName(), String.valueOf(i),
aTap.getServiceHost(), String.valueOf(aTap.getServicePort()) });
@@ -1620,28 +1591,20 @@
if (processor != null) {
if (processorAssigned) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_checkin_cp_to_pool__FINEST",
- new Object[] { Thread.currentThread().getName(),
- aProcessingContainer.getName(), aTap.getServiceHost(),
- String.valueOf(aTap.getServicePort()) });
+ new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
+ aTap.getServiceHost(), String.valueOf(aTap.getServicePort()) });
}
casProcessorPool.checkIn(processor);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_checked_in_cp_to_pool__FINEST",
- new Object[] { Thread.currentThread().getName(),
- aProcessingContainer.getName(), aTap.getServiceHost(),
- String.valueOf(aTap.getServicePort()) });
+ new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
+ aTap.getServiceHost(), String.valueOf(aTap.getServicePort()) });
}
} else {
// Put it back into the failed Cas Processor List for subsequent retries
@@ -1655,10 +1618,11 @@
/**
* Creates and initializes proxy that will be used to connect to Vinci service.
*
- * @param aCasProcessorConfig -
- * CasProcessor configuration
+ * @param aCasProcessorConfig
+ * - CasProcessor configuration
* @return - new proxy (not yet connected to service)
- * @throws ResourceConfigurationException wraps Exception
+ * @throws ResourceConfigurationException
+ * wraps Exception
*/
private VinciTAP getTextAnalysisProxy(CasProcessorConfiguration aCasProcessorConfig)
throws ResourceConfigurationException {
@@ -1667,8 +1631,8 @@
String vnsPort = null;
// For 'local' or managed Cas Processor, get the VNS port
- if (aCasProcessorConfig.getDeploymentType() != null
- && Constants.DEPLOYMENT_LOCAL.equalsIgnoreCase(aCasProcessorConfig.getDeploymentType())) {
+ if (aCasProcessorConfig.getDeploymentType() != null && Constants.DEPLOYMENT_LOCAL
+ .equalsIgnoreCase(aCasProcessorConfig.getDeploymentType())) {
vnsHost = "localhost"; // default for local deployment
vnsPort = ""; // intialize
try {
@@ -1723,15 +1687,16 @@
* command line) 4) Use Hardcoded default ( VNS_HOST=localhost VNS_PORT=9000)
*
*
- * @param aVNSParamKey -
- * name of the VNS parameter for which the value is sought
- * @param aCasProcessorConfig -
- * CPE descriptor settings
- * @param aDefault -
- * default value for the named parameter if parameter is not defined
+ * @param aVNSParamKey
+ * - name of the VNS parameter for which the value is sought
+ * @param aCasProcessorConfig
+ * - CPE descriptor settings
+ * @param aDefault
+ * - default value for the named parameter if parameter is not defined
*
* @return - value for a named VNS parameter
- * @throws ResourceConfigurationException passthru
+ * @throws ResourceConfigurationException
+ * passthru
*/
private String getVNSSettingFor(String aVNSParamKey,
CasProcessorConfiguration aCasProcessorConfig, String aDefault)
@@ -1777,26 +1742,23 @@
* contacts local vns and is assigned a port to run on. The same port is added to the port queue
* and used here for establishing a connection.
*
- * @param aProcessingContainer the a processing container
- * @param casProcessorConfig -
- * CasProcessor configuration
- * @param redeploy -
- * flag indicating if if this is restart
- * @param howMany -
- * indicates how many connections to make
- * @throws ConnectException -
- * unable to establish connection to Cas Processor
+ * @param aProcessingContainer
+ * the a processing container
+ * @param casProcessorConfig
+ * - CasProcessor configuration
+ * @param redeploy
+ * - flag indicating if if this is restart
+ * @param howMany
+ * - indicates how many connections to make
+ * @throws ConnectException
+ * - unable to establish connection to Cas Processor
*/
private void connectToServices(ProcessingContainer aProcessingContainer,
CasProcessorConfiguration casProcessorConfig, boolean redeploy, int howMany)
throws ConnectException {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_thread_count__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_thread_count__FINEST",
new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
String.valueOf(howMany) });
}
@@ -1806,11 +1768,8 @@
// managed by the CPE.
for (int i = 0; i < howMany; i++) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_activating_service_on_port2__FINEST",
new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
String.valueOf(i), String.valueOf(howMany) });
@@ -1856,11 +1815,8 @@
// on a given port.
try {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_activating_service_on_port__FINEST",
new Object[] { Thread.currentThread().getName(), aProcessingContainer.getName(),
String.valueOf(port) });
@@ -1879,18 +1835,21 @@
* Used during a launch of the managed (local) Cas Processor this method returns a port number on
* which the Cas Processor is waiting for requests. Each Cas Processor was a given a port by the
* local vns where it is expected to accept requests from clients. The ports assigned to Cas
- * Processors are managed by the local instance of the VNS and available in the queue <i>portQueue</i>.
+ * Processors are managed by the local instance of the VNS and available in the queue
+ * <i>portQueue</i>.
*
- * @param portQueue -
- * queue containing ports assigned to services by local VNS
+ * @param portQueue
+ * - queue containing ports assigned to services by local VNS
* @return - port as String
- * @throws TimeLimitExceededException timeout waiting for port
+ * @throws TimeLimitExceededException
+ * timeout waiting for port
*/
private String getPort(BoundedWorkQueue portQueue) throws TimeLimitExceededException {
int waitCount = MAX_WAIT_TRIES; // default
try {
- waitCount = System.getProperty(CONN_RETRY_COUNT) != null ? Integer.parseInt(System
- .getProperty(CONN_RETRY_COUNT)) : MAX_WAIT_TRIES;
+ waitCount = System.getProperty(CONN_RETRY_COUNT) != null
+ ? Integer.parseInt(System.getProperty(CONN_RETRY_COUNT))
+ : MAX_WAIT_TRIES;
} catch (NumberFormatException e) {
if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),
@@ -1906,26 +1865,25 @@
new Object[] { Thread.currentThread().getName(), "" });
}
while (portQueue.getCurrentSize() == 0) {
-
- try {
- if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {
- UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),
- "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_service_port_not_allocated__INFO",
- new Object[] { Thread.currentThread().getName(), String.valueOf(waitCount) });
- }
- Thread.sleep(WAIT_TIME);
- } catch (InterruptedException e) {
- }
- if (waitCount-- <= 0) {
- throw new TimeLimitExceededException(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_timeout_no_service_port__WARNING", new Object[] {
- Thread.currentThread().getName(),
- String.valueOf(waitCount * WAIT_TIME + " millis") }));
+ try {
+ if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_service_port_not_allocated__INFO",
+ new Object[] { Thread.currentThread().getName(), String.valueOf(waitCount) });
}
-
+ Thread.sleep(WAIT_TIME);
+ } catch (InterruptedException e) {
+ }
+ if (waitCount-- <= 0) {
+ throw new TimeLimitExceededException(CpmLocalizedMessage.getLocalizedMessage(
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_timeout_no_service_port__WARNING",
+ new Object[] { Thread.currentThread().getName(),
+ String.valueOf(waitCount * WAIT_TIME + " millis") }));
+
+ }
+
}
Object portObject = portQueue.dequeue();
if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {
@@ -1939,7 +1897,8 @@
/**
* Shutdown local VNS.
*
- * @throws CasProcessorDeploymentException the cas processor deployment exception
+ * @throws CasProcessorDeploymentException
+ * the cas processor deployment exception
*/
@Override
public void undeploy() throws CasProcessorDeploymentException {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/vns/LocalVNS.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/vns/LocalVNS.java
index c9fdab1..6a08d39 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/vns/LocalVNS.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/vns/LocalVNS.java
@@ -35,7 +35,6 @@
import org.apache.vinci.transport.VinciServableAdapter;
import org.apache.vinci.transport.VinciServer;
-
/**
*
* LOCAL Vinci Naming Service. Used by locally deployed TAEs. Locally, meaning TAEs running on the
@@ -45,7 +44,7 @@
*/
public class LocalVNS extends VinciServableAdapter implements Runnable {
-
+
/** The onport. */
private int onport;
@@ -73,13 +72,14 @@
/**
* Instantiates Local Vinci Naming Service.
*
- * @param aStartPort -
- * a starting port # for clients (services)
- * @param aEndPort -
- * an ending port # for clients( services)
- * @param aVNSPort -
- * port on which this VNS will listen on
- * @throws PortUnreachableException the port unreachable exception
+ * @param aStartPort
+ * - a starting port # for clients (services)
+ * @param aEndPort
+ * - an ending port # for clients( services)
+ * @param aVNSPort
+ * - port on which this VNS will listen on
+ * @throws PortUnreachableException
+ * the port unreachable exception
*/
public LocalVNS(String aStartPort, String aEndPort, String aVNSPort)
throws PortUnreachableException {
@@ -134,14 +134,15 @@
* port is tested first for availability. If it is not available the next port is tested, until
* one is found to be available.
*
- * @param aStartPort -
- * starting port number used
- * @param aEndPort -
- * end port number. Together with StartPort defines the range of ports (port pool)
- * @param aVNSPort -
- * port on which this VNS will listen for requests
+ * @param aStartPort
+ * - starting port number used
+ * @param aEndPort
+ * - end port number. Together with StartPort defines the range of ports (port pool)
+ * @param aVNSPort
+ * - port on which this VNS will listen for requests
*
- * @throws PortUnreachableException unreachable port after retries
+ * @throws PortUnreachableException
+ * unreachable port after retries
*/
public LocalVNS(int aStartPort, int aEndPort, int aVNSPort) throws PortUnreachableException {
startport = aStartPort;
@@ -182,8 +183,8 @@
/**
* Associates a port pool with instance of VNS.
*
- * @param pQueue -
- * queue where allocated ports will be added
+ * @param pQueue
+ * - queue where allocated ports will be added
*/
public synchronized void setConnectionPool(BoundedWorkQueue pQueue) {
portQueue = pQueue;
@@ -193,7 +194,8 @@
* Determines if a given port is free. It establishes a short lived connection to the port and if
* successful returns false.
*
- * @param port number to check
+ * @param port
+ * number to check
* @return true, if is available
*/
public boolean isAvailable(int port) {
@@ -236,7 +238,8 @@
*
* @return - free port
*
- * @throws PortUnreachableException can't get port in configured range
+ * @throws PortUnreachableException
+ * can't get port in configured range
*/
public synchronized int getPort() throws PortUnreachableException {
boolean portAvailable = false;
@@ -257,9 +260,8 @@
// In case ports are not available break out of the loop having tried 4 times
// to acquire any of the ports in configured range
if (retryCount > 3) {
- throw new PortUnreachableException(
- "Unable to aquire any of the ports in configured range:[" + startport + ".."
- + maxport + "]");
+ throw new PortUnreachableException("Unable to aquire any of the ports in configured range:["
+ + startport + ".." + maxport + "]");
}
}
return onport;
@@ -270,9 +272,11 @@
* "serveon" request to VNS and waits for assigned port. The VNS looks up its cahce of ports and
* returns to the service one that has not yest allocated.
*
- * @param in the in
+ * @param in
+ * the in
* @return the transportable
- * @throws ServiceException the service exception
+ * @throws ServiceException
+ * the service exception
*/
@Override
public synchronized Transportable eval(Transportable in) throws ServiceException {
@@ -334,15 +338,14 @@
if (publicVNSHost == null || publicVNSHost.trim().length() == 0 || publicVNSPort == null
|| publicVNSPort.trim().length() == 0) {
if (UIMAFramework.getLogger().isLoggable(Level.WARNING)) {
- UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING,
- this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_unknown_vns_command__WARNING",
new Object[] { Thread.currentThread().getName() });
}
VinciFrame rtn = new VinciFrame();
- rtn
- .fadd("vinci:EXCEPTION",
- "CPM Reply:Public VNS not known. Verify CPMs startup param include -DVNS_HOST and -DVNS_PORT");
+ rtn.fadd("vinci:EXCEPTION",
+ "CPM Reply:Public VNS not known. Verify CPMs startup param include -DVNS_HOST and -DVNS_PORT");
return rtn;
}
int pvnsPort = -1;
@@ -350,8 +353,8 @@
pvnsPort = Integer.parseInt(publicVNSPort);
} catch (NumberFormatException e) {
if (UIMAFramework.getLogger().isLoggable(Level.WARNING)) {
- UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING,
- this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_unknown_vns_command__WARNING",
new Object[] { Thread.currentThread().getName() });
}
@@ -398,8 +401,7 @@
server.shutdownServing();
if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),
- "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_vns_stopped_serving__INFO",
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_vns_stopped_serving__INFO",
new Object[] { Thread.currentThread().getName() });
}
}
@@ -409,7 +411,9 @@
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#finalize()
*/
@Override
@@ -437,8 +441,7 @@
try {
if (UIMAFramework.getLogger().isLoggable(Level.INFO)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),
- "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_launching_local_vns__INFO",
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_launching_local_vns__INFO",
new Object[] { Thread.currentThread().getName(), String.valueOf(vnsPort) });
}
server = new VinciServer(this);
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/vns/VNSQuery.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/vns/VNSQuery.java
index 17eeb0b..81139c8 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/vns/VNSQuery.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/deployer/vns/VNSQuery.java
@@ -40,13 +40,13 @@
/**
* Connects to a VNS server identified by host and port
*
- * @param aVnsHost -
- * VNS host name
- * @param aVnsPort -
- * VNS port number
+ * @param aVnsHost
+ * - VNS host name
+ * @param aVnsPort
+ * - VNS port number
*
- * @throws Exception -
- * when unable to connect to VNS
+ * @throws Exception
+ * - when unable to connect to VNS
*/
public VNSQuery(String aVnsHost, int aVnsPort) throws Exception {
vnsQuery = new VinciVNSQuery(aVnsHost, aVnsPort);
@@ -55,13 +55,13 @@
/**
* Returns a list of services registered in the VNS and bound to a given name.
*
- * @param aName -
- * name of the service
+ * @param aName
+ * - name of the service
*
* @return - ArrayList of {@link VinciServiceInfo} instances
*
- * @throws Exception -
- * unable to get a list
+ * @throws Exception
+ * - unable to get a list
*/
public ArrayList getServices(String aName) throws Exception {
return vnsQuery.getVinciServices(aName);
@@ -71,16 +71,17 @@
* Returns a list of services that have not yet been assigned to any CPM proxy. It diffs the
* current list and a new list as returned from the VNS.
*
- * @param aName -
- * name of the service
- * @param assignedServices -
- * a list of services currently in use
+ * @param aName
+ * - name of the service
+ * @param assignedServices
+ * - a list of services currently in use
* @return - ArrayList of {@link VinciServiceInfo} instances
*
- * @throws Exception -
- * unable to get a list
+ * @throws Exception
+ * - unable to get a list
*/
- public ArrayList getUnassignedServices(String aName, ArrayList assignedServices) throws Exception {
+ public ArrayList getUnassignedServices(String aName, ArrayList assignedServices)
+ throws Exception {
// Retrieve a new list from the VNS
ArrayList newList = getServices(aName);
// Do a diff between current and new service list
@@ -91,10 +92,10 @@
/**
* Diffs two lists of services and returns those that have not yet been assigned
*
- * @param oldList -
- * current (in-use) list of services
- * @param newList -
- * new list of services
+ * @param oldList
+ * - current (in-use) list of services
+ * @param newList
+ * - new list of services
*
* @return - number of un-assigned services
*/
@@ -117,10 +118,10 @@
* exists in the service list but is not assigned, that means that is available. If the service
* does not exist in the list it is also considered available.
*
- * @param aService -
- * {@link VinciServiceInfo} instance to locate in the list
- * @param oldList -
- * list of current (in-use) services
+ * @param aService
+ * - {@link VinciServiceInfo} instance to locate in the list
+ * @param oldList
+ * - list of current (in-use) services
*
* @return - true, if service is available. false, otherwise
*/
@@ -151,12 +152,12 @@
/**
* Establishes connection to a given VNS server
*
- * @param aVnsHost -
- * name of the host where the VNS is running
- * @param aVnsPort -
- * port on which the VNS is listening
- * @throws Exception -
- * unable to connect to VNS
+ * @param aVnsHost
+ * - name of the host where the VNS is running
+ * @param aVnsPort
+ * - port on which the VNS is listening
+ * @throws Exception
+ * - unable to connect to VNS
*/
public VinciVNSQuery(String aVnsHost, int aVnsPort) throws Exception {
vnsHost = aVnsHost;
@@ -168,12 +169,12 @@
* Returns a list of services bound to a given name. It ONLY returns those services that are
* actually running. The VNS may return services that are stale. Those will be filtered out.
*
- * @param aVinciServiceName -
- * name of the service
+ * @param aVinciServiceName
+ * - name of the service
* @return - list of services bound to a given name.
*
- * @throws Exception -
- * error while looking up the service
+ * @throws Exception
+ * - error while looking up the service
*/
public ArrayList getVinciServices(String aVinciServiceName) throws Exception {
ArrayList serviceList = new ArrayList();
@@ -204,11 +205,8 @@
client = new BaseClient(serviceInfo.getHost(), serviceInfo.getPort());
if (client.isOpen()) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_service_active_on_port__FINEST",
new Object[] { Thread.currentThread().getName(),
serviceInfo.getServiceName(), serviceInfo.getHost(),
@@ -219,11 +217,8 @@
}
} catch (ConnectException ce) {
if (UIMAFramework.getLogger().isLoggable(Level.WARNING)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.WARNING,
- this.getClass().getName(),
- "initialize",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING,
+ this.getClass().getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_service_not_active_on_port__WARNING",
new Object[] { Thread.currentThread().getName(),
serviceInfo.getServiceName(), serviceInfo.getHost(),
@@ -248,8 +243,8 @@
/**
* Copy service information from Vinci frame.
*
- * @param aServiceFrame -
- * Vinci frame containing service info
+ * @param aServiceFrame
+ * - Vinci frame containing service info
*
* @return- instance of {@link VinciServiceInfo} containing service info
*/
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ArtifactProducer.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ArtifactProducer.java
index 05a413d..b36fee3 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ArtifactProducer.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ArtifactProducer.java
@@ -49,7 +49,6 @@
import org.apache.uima.util.UimaTimer;
import org.apache.uima.util.impl.ProcessTrace_impl;
-
/**
* Component responsible for continuously filling a work queue with bundles containing Cas'es. The
* queue is shared with a Processing Pipeline that consumes bundles of Cas. As soon as the the
@@ -65,7 +64,7 @@
*
*/
public class ArtifactProducer extends Thread {
-
+
/** The thread state. */
public int threadState = 0;
@@ -123,7 +122,8 @@
/**
* Instantiates and initializes this instance.
*
- * @param acpm the acpm
+ * @param acpm
+ * the acpm
*/
public ArtifactProducer(CPMEngine acpm) {
cpm = acpm;
@@ -135,10 +135,10 @@
/**
* Construct instance of this class with a reference to the cpe engine and a pool of cas'es.
*
- * @param acpm -
- * reference to the cpe
- * @param aPool -
- * pool of cases
+ * @param acpm
+ * - reference to the cpe
+ * @param aPool
+ * - pool of cases
*/
public ArtifactProducer(CPMEngine acpm, CPECasPool aPool) {
cpm = acpm;
@@ -160,8 +160,8 @@
/**
* Plug in Custom Timer to time events.
*
- * @param aTimer -
- * custom timer
+ * @param aTimer
+ * - custom timer
*/
public void setUimaTimer(UimaTimer aTimer) {
timer = aTimer;
@@ -170,7 +170,8 @@
/**
* Sets the process trace.
*
- * @param aProcTrace the new process trace
+ * @param aProcTrace
+ * the new process trace
*/
public void setProcessTrace(ProcessTrace aProcTrace) {
globalSharedProcessTrace = aProcTrace;
@@ -208,8 +209,8 @@
/**
* Assign total number of entities to process.
*
- * @param aNumToProcess -
- * number of entities to read from the Collection Reader
+ * @param aNumToProcess
+ * - number of entities to read from the Collection Reader
*/
public void setNumEntitiesToProcess(long aNumToProcess) {
maxToProcess = aNumToProcess;
@@ -218,8 +219,8 @@
/**
* Assign CollectionReader to be used for reading.
*
- * @param aCollectionReader -
- * collection reader as source of data
+ * @param aCollectionReader
+ * - collection reader as source of data
*/
public void setCollectionReader(BaseCollectionReader aCollectionReader) {
collectionReader = aCollectionReader;
@@ -228,15 +229,15 @@
// Determines how many at a time this Collection Reader will return
// for each fetch
readerFetchSize = (Integer) collectionReader.getProcessingResourceMetaData()
- .getConfigurationParameterSettings().getParameterValue("fetchSize");
+ .getConfigurationParameterSettings().getParameterValue("fetchSize");
}
}
/**
* Assigns a queue where the artifacts produced by this component will be deposited.
*
- * @param aQueue -
- * queue for the artifacts this class is producing
+ * @param aQueue
+ * - queue for the artifacts this class is producing
*/
public void setWorkQueue(BoundedWorkQueue aQueue) {
workQueue = aQueue;
@@ -246,7 +247,8 @@
* Add table that will contain statistics gathered while reading entities from a Collection This
* table is used for non-uima reports.
*
- * @param aStatTable the new CPM stat table
+ * @param aStatTable
+ * the new CPM stat table
*/
public void setCPMStatTable(Map aStatTable) {
cpmStatTable = aStatTable;
@@ -276,7 +278,8 @@
* optimizing processing. When pipelines start up there are already entities in the work queue to
* process.
*
- * @throws Exception the exception
+ * @throws Exception
+ * the exception
*/
public void fillQueue() throws Exception {
// Create an array holding CAS'es. Configuration of the Reader may
@@ -309,14 +312,10 @@
// determines how many entities to return for each fetch.
casObjectList = readNext(readerFetchSize);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_enqueue_cas_bundle__FINEST",
- new Object[] { Thread.currentThread().getName(),
- String.valueOf(casObjectList.length) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_enqueue_cas_bundle__FINEST", new Object[] {
+ Thread.currentThread().getName(), String.valueOf(casObjectList.length) });
}
// Count number of entities fetched so far
entityCount += casObjectList.length;
@@ -337,11 +336,8 @@
Progress[] progress = collectionReader.getProgress();
if (progress != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_show_cr_progress__FINEST",
new Object[] { Thread.currentThread().getName(),
String.valueOf(progress[0].getCompleted()) });
@@ -359,9 +355,9 @@
notifyListeners((CAS) casObjectList[i], e);
casPool.releaseCas(casList[i]);
casList[i] = null;
-// synchronized (casPool) { // removed - redundant, because done as part of releaseCas
-// casPool.notifyAll();
-// }
+ // synchronized (casPool) { // removed - redundant, because done as part of releaseCas
+ // casPool.notifyAll();
+ // }
} else {
notifyListeners(null, e);
@@ -378,13 +374,15 @@
* Reads next set of entities from the CollectionReader. This method may return more than one Cas
* at a time.
*
- * @param fetchSize the fetch size
+ * @param fetchSize
+ * the fetch size
* @return - The Object returned from the method depends on the type of the CollectionReader.
* Either CASData[] or CASObject[] initialized with document metadata and content is
* returned. If the CollectionReader has no more entities (EOF), null is returned.
- * @throws IOException -
- * error while reading corpus
- * @throws CollectionException -
+ * @throws IOException
+ * - error while reading corpus
+ * @throws CollectionException
+ * -
* @parma fetchSize - number of entities the CollectionReader should return for each fetch. It is
* hint as the Collection Reader ultimately decides how many to return.
*/
@@ -423,14 +421,10 @@
; // intentionally empty while loop
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_cr_check_cas_for_null__FINEST",
- new Object[] { Thread.currentThread().getName(),
- String.valueOf((casList[i] == null)) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_cr_check_cas_for_null__FINEST", new Object[] {
+ Thread.currentThread().getName(), String.valueOf((casList[i] == null)) });
}
if (cpm.isRunning() == false) {
// CPM is in shutdown stage. No need to enqueue additional
@@ -444,9 +438,9 @@
for (int listCounter = 0; casList != null && casList[i] != null
&& listCounter < casList.length; listCounter++) {
casPool.releaseCas(casList[listCounter]);
-// synchronized (casPool) { // redundant - releaseCas call does this
-// casPool.notifyAll();
-// }
+ // synchronized (casPool) { // redundant - releaseCas call does this
+ // casPool.notifyAll();
+ // }
}
if (cpmStatTable != null) {
Progress[] progress = collectionReader.getProgress();
@@ -477,8 +471,8 @@
casList[i].reset();
// If Collection Reader and CAS Initilaizer do not declare any
- // output SofAs, must be passed the default view (meaning whatever's
- //mapped to _InitialView) for backward compatiblity
+ // output SofAs, must be passed the default view (meaning whatever's
+ // mapped to _InitialView) for backward compatiblity
Capability[] capabilities;
CasInitializer casIni = ((CollectionReader) collectionReader).getCasInitializer();
if (casIni != null)
@@ -509,9 +503,9 @@
String absSofaName = context.getComponentInfo().mapToSofaID(CAS.NAME_DEFAULT_SOFA);
if (!CAS.NAME_DEFAULT_SOFA.equals(absSofaName)) {
casList[i].createView(CAS.NAME_DEFAULT_SOFA);
- }
+ }
CAS view = casList[i].getView(CAS.NAME_DEFAULT_SOFA);
-
+
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
@@ -613,12 +607,12 @@
success = true;
} finally {
if (!success) {
- localTrace.endEvent(collectionReader.getProcessingResourceMetaData().getName(),
- "Process", "failure");
+ localTrace.endEvent(collectionReader.getProcessingResourceMetaData().getName(), "Process",
+ "failure");
} else {
- localTrace.endEvent(collectionReader.getProcessingResourceMetaData().getName(),
- "Process", "success");
+ localTrace.endEvent(collectionReader.getProcessingResourceMetaData().getName(), "Process",
+ "success");
}
synchronized (globalSharedProcessTrace) {
@@ -680,8 +674,7 @@
placeEOFToken();
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
- "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_eof_marker_enqueued__FINEST",
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_eof_marker_enqueued__FINEST",
new Object[] { Thread.currentThread().getName() });
}
return;
@@ -725,18 +718,17 @@
threadState = 1004; // Entering hasNext()
// start the CR event
- localTrace.startEvent(collectionReader.getProcessingResourceMetaData().getName(),
- "Process", "");
+ localTrace.startEvent(collectionReader.getProcessingResourceMetaData().getName(), "Process",
+ "");
crEventCompleted = false;
if (collectionReader.hasNext()) {
- localTrace.endEvent(collectionReader.getProcessingResourceMetaData().getName(),
- "Process", "success");
+ localTrace.endEvent(collectionReader.getProcessingResourceMetaData().getName(), "Process",
+ "success");
crEventCompleted = true;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
- "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_get_cas_from_cr__FINEST",
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_get_cas_from_cr__FINEST",
new Object[] { Thread.currentThread().getName() });
}
casObjectList = readNext(readerFetchSize);
@@ -747,14 +739,15 @@
ChunkMetadata meta = CPMUtils.getChunkMetadata((CAS) casObjectList[i]);
if (meta != null) {
if (timedoutDocs.containsKey(meta.getDocId())) {
- notifyListeners(casList[i], new ResourceProcessException(new SkipCasException(
- "Dropping CAS due chunk Timeout. Doc Id::" + meta.getDocId()
- + " Sequence:" + meta.getSequence())));
+ notifyListeners(casList[i],
+ new ResourceProcessException(new SkipCasException(
+ "Dropping CAS due chunk Timeout. Doc Id::" + meta.getDocId()
+ + " Sequence:" + meta.getSequence())));
casPool.releaseCas((CAS) casObjectList[i]);
-// synchronized (casPool) { // redundant, releaseCas call does this
-// casPool.notifyAll();
-// }
+ // synchronized (casPool) { // redundant, releaseCas call does this
+ // casPool.notifyAll();
+ // }
releasedCas = true;
}
}
@@ -764,14 +757,10 @@
}
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_place_cas_in_queue__FINEST",
- new Object[] { Thread.currentThread().getName(),
- String.valueOf(casObjectList.length) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_place_cas_in_queue__FINEST", new Object[] {
+ Thread.currentThread().getName(), String.valueOf(casObjectList.length) });
}
// Prevent processing of new CASes if the CPM has been
// killed hard. Allow processing of CASes
@@ -782,17 +771,14 @@
|| (cpm.isRunning() == false && cpm.isHardKilled() == false)) {
threadState = 1005; // Entering enqueue
workQueue.enqueue(casObjectList);
-// synchronized (workQueue) { // redundant, enqueue does this
-// workQueue.notifyAll();
-// }
+ // synchronized (workQueue) { // redundant, enqueue does this
+ // workQueue.notifyAll();
+ // }
threadState = 1006; // Done Entering enqueue
entityCount += casObjectList.length;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_placed_cas_in_queue__FINEST",
new Object[] { Thread.currentThread().getName(),
String.valueOf(casObjectList.length) });
@@ -838,8 +824,8 @@
} catch (Exception e) {
// The following conditional is true if hasNext() has failed
if (!crEventCompleted) {
- localTrace.endEvent(collectionReader.getProcessingResourceMetaData().getName(),
- "Process", "failure");
+ localTrace.endEvent(collectionReader.getProcessingResourceMetaData().getName(), "Process",
+ "failure");
}
// e.printStackTrace();
// changed from FINER to WARNING: https://issues.apache.org/jira/browse/UIMA-2440
@@ -859,9 +845,9 @@
notifyListeners(casList[i], e);
casPool.releaseCas(casList[i]);
casList[i] = null;
-// synchronized (casPool) { // redundant, releaseCas does this
-// casPool.notifyAll();
-// }
+ // synchronized (casPool) { // redundant, releaseCas does this
+ // casPool.notifyAll();
+ // }
} else {
notifyListeners(null, e);
@@ -906,20 +892,21 @@
/**
* Notify registered callback listeners of a given exception.
*
- * @param aCas the a cas
- * @param anException -
- * exception to propagate to callback listeners
+ * @param aCas
+ * the a cas
+ * @param anException
+ * - exception to propagate to callback listeners
*/
private void notifyListeners(CAS aCas, Exception anException) {
for (int i = 0; callbackListeners != null && i < callbackListeners.size(); i++) {
StatusCallbackListener statCL = (StatusCallbackListener) callbackListeners.get(i);
- if ( statCL != null ) {
+ if (statCL != null) {
ProcessTrace prTrace = new ProcessTrace_impl(cpm.getPerformanceTuningSettings());
EntityProcessStatusImpl aEntityProcStatus = new EntityProcessStatusImpl(prTrace);
aEntityProcStatus.addEventStatus("Collection Reader Failure", "failed", anException);
// Notify the listener that the Cas has been processed
CPMEngine.callEntityProcessCompleteWithCAS(statCL, aCas, aEntityProcStatus);
-// statCL.entityProcessComplete(aCas, aEntityProcStatus);
+ // statCL.entityProcessComplete(aCas, aEntityProcStatus);
}
}
}
@@ -953,9 +940,9 @@
new Object[] { Thread.currentThread().getName(), String.valueOf(cpm.isRunning()) });
}
-// synchronized (workQueue) { // redundant, the enqueue call above does this
-// workQueue.notifyAll();
-// }
+ // synchronized (workQueue) { // redundant, the enqueue call above does this
+ // workQueue.notifyAll();
+ // }
} catch (Exception e) {
e.printStackTrace();
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
@@ -983,7 +970,8 @@
/**
* Invalidate.
*
- * @param aCasList the a cas list
+ * @param aCasList
+ * the a cas list
*/
public void invalidate(CAS[] aCasList) {
for (int i = 0; aCasList != null && i < aCasList.length && aCasList[i] != null; i++) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/BoundedWorkQueue.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/BoundedWorkQueue.java
index fa97b6f..c8931fe 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/BoundedWorkQueue.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/BoundedWorkQueue.java
@@ -26,20 +26,20 @@
import org.apache.uima.collection.impl.cpm.utils.CPMUtils;
import org.apache.uima.util.Level;
-
/**
* Implementation of a Bounded Queue, a queue with a fixed number of slots. Used primarily to feed
* data to Processing Units, it is filled by a producer like ArtifactProducer and consumed by
* ProcessingUnit(s). When the queue is full it will block a request for enqueue until a slot frees
- * up.
+ * up.
*
- * <p>There are 2 dequeue calls. One returns null if the queue is empty, the other can be given a
+ * <p>
+ * There are 2 dequeue calls. One returns null if the queue is empty, the other can be given a
* timeout - and it will wait up to that time waiting for something to get enqueued.
*
*
*/
public class BoundedWorkQueue {
-
+
/** The queue max size. */
protected final int queueMaxSize;
@@ -61,12 +61,12 @@
/**
* Initialize the instance.
*
- * @param aQueueSize -
- * fixed size for this queue (capacity)
- * @param aQueueName -
- * name for this queue
- * @param aCpmEngine -
- * CPE Engine reference
+ * @param aQueueSize
+ * - fixed size for this queue (capacity)
+ * @param aQueueName
+ * - name for this queue
+ * @param aCpmEngine
+ * - CPE Engine reference
*/
public BoundedWorkQueue(int aQueueSize, String aQueueName, CPMEngine aCpmEngine) {
queueMaxSize = aQueueSize;
@@ -113,17 +113,13 @@
/**
* Enqueues a given object onto the queue. It blocks if the queue is full.
*
- * @param anObject -
- * an object to enqueue
+ * @param anObject
+ * - an object to enqueue
*/
public synchronized void enqueue(Object anObject) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_entering_queue__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_entering_queue__FINEST",
new Object[] { Thread.currentThread().getName(), queueName,
String.valueOf(numberElementsInQueue) });
}
@@ -136,12 +132,8 @@
// Block if the queue is full AND the CPE is running
while (numberElementsInQueue == queueMaxSize && (cpm == null || cpm.isRunning())) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_queue_full__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_queue_full__FINEST",
new Object[] { Thread.currentThread().getName(), queueName,
String.valueOf(numberElementsInQueue) });
}
@@ -152,12 +144,8 @@
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_adding_cas_to_queue__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_adding_cas_to_queue__FINEST",
new Object[] { Thread.currentThread().getName(), queueName,
String.valueOf(numberElementsInQueue) });
}
@@ -166,16 +154,12 @@
// increment number of items in the queue
numberElementsInQueue++;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_cas_in_queue__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_cas_in_queue__FINEST",
new Object[] { Thread.currentThread().getName(), queueName,
String.valueOf(numberElementsInQueue) });
}
- notifyAll();
+ notifyAll();
}
/**
@@ -185,12 +169,8 @@
*/
public synchronized Object dequeue() {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_enter_dequeue__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_enter_dequeue__FINEST",
new Object[] { Thread.currentThread().getName(), queueName,
String.valueOf(numberElementsInQueue) });
}
@@ -204,12 +184,8 @@
numberElementsInQueue--;
if (returnedObject instanceof Object[]) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_cas_dequeued__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_cas_dequeued__FINEST",
new Object[] { Thread.currentThread().getName(), queueName,
String.valueOf(((Object[]) returnedObject).length) });
}
@@ -221,16 +197,12 @@
}
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_return_from_dequeue__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_return_from_dequeue__FINEST",
new Object[] { Thread.currentThread().getName(), queueName,
String.valueOf(numberElementsInQueue) });
}
-
+
return returnedObject;
}
@@ -238,32 +210,29 @@
* Returns an object from the queue. It will wait for the object to show up in the queue until a
* given timer expires.
*
- * @param aTimeout -
- * max millis to wait for an object
+ * @param aTimeout
+ * - max millis to wait for an object
*
* @return - Object from the queue, or null if time out
*/
public synchronized Object dequeue(long aTimeout) {
Object resource = dequeue();
- // next 5 lines commented out - was old method of waiting. -- Jan 2008 MIS
+ // next 5 lines commented out - was old method of waiting. -- Jan 2008 MIS
// changes include waiting a little (WAIT_TIMEOUT) if !cpm.isRunning, to prevent
- // 100% CPU utilization while waiting for existing processes to finish
+ // 100% CPU utilization while waiting for existing processes to finish
// also, System.currentTimeMillis only called once in revised version.
-// if (resource == null && cpm.isRunning()) {
-// try {
-// // add 1 millisecond to expire time to account for "rounding" issues
-// long timeExpire = (0 == aTimeout)? Long.MAX_VALUE : (System.currentTimeMillis() + aTimeout + 1);
-// long timeLeft = timeExpire - System.currentTimeMillis();
+ // if (resource == null && cpm.isRunning()) {
+ // try {
+ // // add 1 millisecond to expire time to account for "rounding" issues
+ // long timeExpire = (0 == aTimeout)? Long.MAX_VALUE : (System.currentTimeMillis() + aTimeout +
+ // 1);
+ // long timeLeft = timeExpire - System.currentTimeMillis();
if (resource == null) {
try {
// add 1 millisecond to expire time to account for "rounding" issues
long timeNow = System.currentTimeMillis();
- long timeExpire =
- (! cpm.isRunning()) ?
- timeNow + WAIT_TIMEOUT : // a value to avoid 100% cpu
- ((0 == aTimeout) ?
- Long.MAX_VALUE :
- timeNow + aTimeout + 1);
+ long timeExpire = (!cpm.isRunning()) ? timeNow + WAIT_TIMEOUT : // a value to avoid 100% cpu
+ ((0 == aTimeout) ? Long.MAX_VALUE : timeNow + aTimeout + 1);
long timeLeft = timeExpire - timeNow;
while (timeLeft > 0) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
@@ -271,7 +240,7 @@
"process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_queue_empty__FINEST",
new Object[] { Thread.currentThread().getName(), queueName });
}
- this.wait(timeLeft); // timeLeft is always > 0
+ this.wait(timeLeft); // timeLeft is always > 0
resource = dequeue();
if (null != resource) {
return resource;
@@ -281,12 +250,8 @@
} catch (InterruptedException e) {
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_queue_notified__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_queue_notified__FINEST",
new Object[] { Thread.currentThread().getName(), queueName,
String.valueOf(numberElementsInQueue) });
}
@@ -298,7 +263,8 @@
/**
* Invalidate.
*
- * @param aCasObjectList the a cas object list
+ * @param aCasObjectList
+ * the a cas object list
*/
public void invalidate(CAS[] aCasObjectList) {
}
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/CPECasPool.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/CPECasPool.java
index f380417..76fe496 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/CPECasPool.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/CPECasPool.java
@@ -30,10 +30,9 @@
import org.apache.uima.resource.ResourceInitializationException;
import org.apache.uima.util.Level;
-
/**
* Implements object pooling mechanism to limit number of CAS instances. Cas'es are checked out,
- * used and checked back in when done.
+ * used and checked back in when done.
*/
public class CPECasPool {
@@ -52,11 +51,12 @@
/**
* Initialize the pool.
*
- * @param aNumInstances -
- * max size of the pool
- * @param aCasManager -
- * CAS Manager to use to create the CASes
- * @throws ResourceInitializationException -
+ * @param aNumInstances
+ * - max size of the pool
+ * @param aCasManager
+ * - CAS Manager to use to create the CASes
+ * @throws ResourceInitializationException
+ * -
*/
public CPECasPool(int aNumInstances, CasManager aCasManager)
throws ResourceInitializationException {
@@ -67,14 +67,17 @@
/**
* Initialize the pool.
*
- * @param aNumInstances -
- * max size of the pool
- * @param aCasManager -
- * CAS Manager to use to create the CASes
- * @param aPerformanceTuningSettings the a performance tuning settings
- * @throws ResourceInitializationException -
+ * @param aNumInstances
+ * - max size of the pool
+ * @param aCasManager
+ * - CAS Manager to use to create the CASes
+ * @param aPerformanceTuningSettings
+ * the a performance tuning settings
+ * @throws ResourceInitializationException
+ * -
*/
- public CPECasPool(int aNumInstances, CasManager aCasManager, Properties aPerformanceTuningSettings) throws ResourceInitializationException {
+ public CPECasPool(int aNumInstances, CasManager aCasManager,
+ Properties aPerformanceTuningSettings) throws ResourceInitializationException {
mNumInstances = aNumInstances;
fillPool(aCasManager, aPerformanceTuningSettings);
}
@@ -82,12 +85,15 @@
/**
* Fills the pool with initialized instances of CAS.
*
- * @param aCasManager -
- * definition (type system, indexes, etc.) of CASes to create
- * @param aPerformanceTuningSettings the a performance tuning settings
- * @throws ResourceInitializationException -
+ * @param aCasManager
+ * - definition (type system, indexes, etc.) of CASes to create
+ * @param aPerformanceTuningSettings
+ * the a performance tuning settings
+ * @throws ResourceInitializationException
+ * -
*/
- protected void fillPool(CasManager aCasManager, Properties aPerformanceTuningSettings) throws ResourceInitializationException {
+ protected void fillPool(CasManager aCasManager, Properties aPerformanceTuningSettings)
+ throws ResourceInitializationException {
for (int i = 0; i < mNumInstances; i++) {
CAS c = aCasManager.createNewCas(aPerformanceTuningSettings);
mAllInstances.add(c);
@@ -99,13 +105,13 @@
* Returns a Cas instance from the pool. This routine waits for a free instance of Cas a given
* amount of time. If free instance is not available this routine returns null.
*
- * @param aTimeout -
- * max amount of time in millis to wait for CAS instance
+ * @param aTimeout
+ * - max amount of time in millis to wait for CAS instance
* @return - CAS instance, or null on timeout
*/
public synchronized CAS getCas(long aTimeout) {
CAS cas = getCas();
-
+
if (cas != null) {
return cas;
}
@@ -131,11 +137,8 @@
// Add the cas to a list of checked-out cases
checkedOutInstances.add(cas);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_add_cas_to_checkedout_list__FINEST",
new Object[] { Thread.currentThread().getName(),
String.valueOf(checkedOutInstances.size()) });
@@ -176,11 +179,8 @@
if (index != -1) {
checkedOutInstances.remove(index);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_removed_from_checkedout_list__FINEST",
new Object[] { Thread.currentThread().getName(),
String.valueOf(checkedOutInstances.size()) });
@@ -188,16 +188,12 @@
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_return_cas_to_pool__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_return_cas_to_pool__FINEST",
new Object[] { Thread.currentThread().getName(),
String.valueOf(checkedOutInstances.size()) });
}
- this.notifyAll(); // when CAS becomes available
+ this.notifyAll(); // when CAS becomes available
}
}
@@ -214,8 +210,8 @@
/**
* Returns a CAS found in a given position in the list.
*
- * @param aIndex -
- * position of the CAS in the list
+ * @param aIndex
+ * - position of the CAS in the list
*
* @return CAS - reference to a CAS
*/
@@ -236,23 +232,23 @@
}
// never called and dangerous to expose
-// /**
-// * Returns pool capacity
-// *
-// * @return - size of the pool
-// */
-// protected Vector getAllInstances() {
-// return mAllInstances;
-// }
+ // /**
+ // * Returns pool capacity
+ // *
+ // * @return - size of the pool
+ // */
+ // protected Vector getAllInstances() {
+ // return mAllInstances;
+ // }
// Never called
-// /**
-// * Number of free Cas'es available in the pool
-// *
-// * @return
-// */
-// protected synchronized Vector getFreeInstances() {
-// return mFreeInstances;
-// }
+ // /**
+ // * Number of free Cas'es available in the pool
+ // *
+ // * @return
+ // */
+ // protected synchronized Vector getFreeInstances() {
+ // return mFreeInstances;
+ // }
}
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/CPMChunkTimeoutException.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/CPMChunkTimeoutException.java
index ac1622a..73cb9f8 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/CPMChunkTimeoutException.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/CPMChunkTimeoutException.java
@@ -21,13 +21,11 @@
import org.apache.uima.resource.ResourceProcessException;
-
-
/**
* The Class CPMChunkTimeoutException.
*/
public class CPMChunkTimeoutException extends ResourceProcessException {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 358067081843640078L;
@@ -43,9 +41,12 @@
/**
* Instantiates a new CPM chunk timeout exception.
*
- * @param aDocumentId the document ID
- * @param aThrottleID tbd
- * @param aDocumentURL document URL
+ * @param aDocumentId
+ * the document ID
+ * @param aThrottleID
+ * tbd
+ * @param aDocumentURL
+ * document URL
*/
public CPMChunkTimeoutException(long aDocumentId, String aThrottleID, String aDocumentURL) {
docID = aDocumentId;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/CPMThreadGroup.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/CPMThreadGroup.java
index c01f7df..d144972 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/CPMThreadGroup.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/CPMThreadGroup.java
@@ -29,7 +29,6 @@
import org.apache.uima.util.Level;
import org.apache.uima.util.ProcessTrace;
-
/**
* This component catches uncaught errors in the CPM. All critical threads in the CPM are part of
* this ThreadGroup. If OutOfMemory Error is thrown this component is notified by the JVM and its
@@ -37,7 +36,7 @@
*
*/
public class CPMThreadGroup extends ThreadGroup {
-
+
/** The callback listeners. */
private ArrayList callbackListeners = null;
@@ -47,7 +46,8 @@
/**
* Instantiates a new CPM thread group.
*
- * @param name the name
+ * @param name
+ * the name
*/
public CPMThreadGroup(String name) {
super(name);
@@ -56,10 +56,10 @@
/**
* Instantiates a new CPM thread group.
*
- * @param parent -
- * parent thread group
- * @param name -
- * name of this thread group
+ * @param parent
+ * - parent thread group
+ * @param name
+ * - name of this thread group
*/
public CPMThreadGroup(ThreadGroup parent, String name) {
super(parent, name);
@@ -68,8 +68,8 @@
/**
* Sets listeners to be used in notifications.
*
- * @param aListenerList -
- * list of registered listners
+ * @param aListenerList
+ * - list of registered listners
*/
public void setListeners(ArrayList aListenerList) {
callbackListeners = aListenerList;
@@ -78,13 +78,16 @@
/**
* Sets the process trace.
*
- * @param aProcessTrace the new process trace
+ * @param aProcessTrace
+ * the new process trace
*/
public void setProcessTrace(ProcessTrace aProcessTrace) {
procTr = aProcessTrace;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.ThreadGroup#uncaughtException(java.lang.Thread, java.lang.Throwable)
*/
@Override
@@ -116,8 +119,10 @@
/**
* Notify listener.
*
- * @param aStatCL the a stat CL
- * @param e the e
+ * @param aStatCL
+ * the a stat CL
+ * @param e
+ * the e
*/
private void notifyListener(BaseStatusCallbackListener aStatCL, Throwable e) {
EntityProcessStatusImpl enProcSt = new EntityProcessStatusImpl(procTr);
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ConsumerCasUtils.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ConsumerCasUtils.java
index 31789e0..6aad494 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ConsumerCasUtils.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ConsumerCasUtils.java
@@ -23,29 +23,30 @@
import org.apache.uima.cas.FSIterator;
import org.apache.uima.cas.FeatureStructure;
-
/**
* The Class ConsumerCasUtils.
*/
public class ConsumerCasUtils {
-
+
/**
* Returns an int value of a given Feature Structure.
*
- * @param aCasView -
- * CAS instance to retrieve data from
- * @param aTypeS -
- * Feature Type
- * @param aFeatS -
- * Feature Structure
+ * @param aCasView
+ * - CAS instance to retrieve data from
+ * @param aTypeS
+ * - Feature Type
+ * @param aFeatS
+ * - Feature Structure
* @return - feature value as int
*/
public static int getIntFeatValue(CAS aCasView, String aTypeS, String aFeatS) {
int result = 0;
- FSIterator idIter = aCasView.getAnnotationIndex(aCasView.getTypeSystem().getType(aTypeS)).iterator();
+ FSIterator idIter = aCasView.getAnnotationIndex(aCasView.getTypeSystem().getType(aTypeS))
+ .iterator();
while (idIter != null && idIter.isValid()) {
org.apache.uima.cas.FeatureStructure idFS = idIter.get();
- result = idFS.getIntValue(aCasView.getTypeSystem().getFeatureByFullName(aTypeS + ":" + aFeatS));
+ result = idFS
+ .getIntValue(aCasView.getTypeSystem().getFeatureByFullName(aTypeS + ":" + aFeatS));
idIter.moveToNext();
}
return result;
@@ -54,12 +55,12 @@
/**
* Returns a string value of a given Feature Structure.
*
- * @param aCasView -
- * CAS view to retrieve data from
- * @param aTypeS -
- * Feature Type
- * @param aFeatS -
- * Feature Structure
+ * @param aCasView
+ * - CAS view to retrieve data from
+ * @param aTypeS
+ * - Feature Type
+ * @param aFeatS
+ * - Feature Structure
* @return feature value as string
*/
public static String getStringFeatValue(CAS aCasView, String aTypeS, String aFeatS) {
@@ -68,8 +69,8 @@
.iterator();
while (idIter != null && idIter.isValid()) {
org.apache.uima.cas.FeatureStructure idFS = idIter.get();
- result = idFS.getStringValue(aCasView.getTypeSystem().getFeatureByFullName(
- aTypeS + ":" + aFeatS));
+ result = idFS
+ .getStringValue(aCasView.getTypeSystem().getFeatureByFullName(aTypeS + ":" + aFeatS));
idIter.moveToNext();
}
return result;
@@ -78,15 +79,16 @@
/**
* Returns a Feature Structure of a given type.
*
- * @param aCasView -
- * CAS instance to retrieve data from
- * @param aTypeS -
- * Feature Type
+ * @param aCasView
+ * - CAS instance to retrieve data from
+ * @param aTypeS
+ * - Feature Type
* @return the first Feature Structure of a given type
*/
public static FeatureStructure getTcasFS(CAS aCasView, String aTypeS) {
org.apache.uima.cas.FeatureStructure idFS = null;
- FSIterator idIter = aCasView.getAnnotationIndex(aCasView.getTypeSystem().getType(aTypeS)).iterator();
+ FSIterator idIter = aCasView.getAnnotationIndex(aCasView.getTypeSystem().getType(aTypeS))
+ .iterator();
while (idIter != null && idIter.isValid()) {
idFS = idIter.get();
idIter.moveToNext();
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/DebugControlThread.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/DebugControlThread.java
index 806fe99..3199b46 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/DebugControlThread.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/DebugControlThread.java
@@ -29,12 +29,11 @@
import org.apache.uima.util.FileUtils;
import org.apache.uima.util.Level;
-
/**
* The Class DebugControlThread.
*/
public class DebugControlThread implements Runnable {
-
+
/** The Constant NOTFOUND. */
private final static String NOTFOUND = "NOT-FOUND";
@@ -61,9 +60,12 @@
/**
* Instantiates a new debug control thread.
*
- * @param aCpm the a cpm
- * @param aFilename the a filename
- * @param aCheckpointFrequency the a checkpoint frequency
+ * @param aCpm
+ * the a cpm
+ * @param aFilename
+ * the a filename
+ * @param aCheckpointFrequency
+ * the a checkpoint frequency
*/
public DebugControlThread(CPMEngine aCpm, String aFilename, int aCheckpointFrequency) {
cpm = aCpm;
@@ -74,7 +76,8 @@
/**
* Start.
*
- * @throws RuntimeException the runtime exception
+ * @throws RuntimeException
+ * the runtime exception
*/
public void start() throws RuntimeException {
if (fileName == null) {
@@ -84,10 +87,10 @@
"UIMA_CPM_checkpoint_target_not_defined__FINEST",
new Object[] { Thread.currentThread().getName() });
}
- throw new RuntimeException(CpmLocalizedMessage.getLocalizedMessage(
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_target_checkpoint_not_defined__WARNING", new Object[] { Thread
- .currentThread().getName() }));
+ throw new RuntimeException(
+ CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_EXP_target_checkpoint_not_defined__WARNING",
+ new Object[] { Thread.currentThread().getName() }));
}
if (cpm == null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
@@ -113,7 +116,9 @@
doCheckpoint();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Runnable#run()
*/
@Override
@@ -147,7 +152,8 @@
/**
* Interpret and execute command.
*
- * @param aCommand the a command
+ * @param aCommand
+ * the a command
*/
private void interpretAndExecuteCommand(String aCommand) {
if (aCommand == null) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/NonThreadedProcessingUnit.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/NonThreadedProcessingUnit.java
index cdfc2fd..a4ed109 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/NonThreadedProcessingUnit.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/NonThreadedProcessingUnit.java
@@ -56,13 +56,11 @@
import org.apache.uima.util.UimaTimer;
import org.apache.uima.util.impl.ProcessTrace_impl;
-
-
/**
* The Class NonThreadedProcessingUnit.
*/
public class NonThreadedProcessingUnit {
-
+
/** The thread state. */
public int threadState = 0;
@@ -123,16 +121,15 @@
/** The cas cache. */
private CAS[] casCache = null;
-
/**
* Initialize the PU.
*
- * @param acpm -
- * component managing life cycle of the CPE
- * @param aInputQueue -
- * queue to read from
- * @param aOutputQueue -
- * queue to write to
+ * @param acpm
+ * - component managing life cycle of the CPE
+ * @param aInputQueue
+ * - queue to read from
+ * @param aOutputQueue
+ * - queue to write to
*/
public NonThreadedProcessingUnit(CPMEngine acpm, BoundedWorkQueue aInputQueue,
BoundedWorkQueue aOutputQueue) {
@@ -148,12 +145,8 @@
outputQueue = aOutputQueue;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_initialize_pipeline__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_initialize_pipeline__FINEST",
new Object[] { Thread.currentThread().getName(), workQueue.getName(),
String.valueOf(workQueue.getCurrentSize()) });
}
@@ -162,7 +155,8 @@
/**
* Instantiates a new non threaded processing unit.
*
- * @param acpm the acpm
+ * @param acpm
+ * the acpm
*/
public NonThreadedProcessingUnit(CPMEngine acpm) {
cpm = acpm;
@@ -178,8 +172,8 @@
/**
* Alternative method of providing a queue from which this PU will read bundle of Cas.
*
- * @param aInputQueue -
- * read queue
+ * @param aInputQueue
+ * - read queue
*/
public void setInputQueue(BoundedWorkQueue aInputQueue) {
workQueue = aInputQueue;
@@ -188,8 +182,8 @@
/**
* Alternative method of providing a queue where this PU will deposit results of analysis.
*
- * @param aOutputQueue -
- * queue to write to
+ * @param aOutputQueue
+ * - queue to write to
*/
public void setOutputQueue(BoundedWorkQueue aOutputQueue) {
outputQueue = aOutputQueue;
@@ -199,8 +193,8 @@
* Alternative method of providing the reference to the component managing the lifecycle of the
* CPE.
*
- * @param acpm -
- * reference to the contrlling engine
+ * @param acpm
+ * - reference to the contrlling engine
*/
public void setCPMEngine(CPMEngine acpm) {
cpm = acpm;
@@ -228,8 +222,8 @@
/**
* Set a flag indicating if notifications should be made via configured Listeners.
*
- * @param aDoNotify -
- * true if notification is required, false otherwise
+ * @param aDoNotify
+ * - true if notification is required, false otherwise
*/
public void setNotifyListeners(boolean aDoNotify) {
notifyListeners = aDoNotify;
@@ -238,8 +232,8 @@
/**
* Plugs in Listener object used for notifications.
*
- * @param aListener -
- * {@link org.apache.uima.collection.base_cpm.BaseStatusCallbackListener} instance
+ * @param aListener
+ * - {@link org.apache.uima.collection.base_cpm.BaseStatusCallbackListener} instance
*/
public void addStatusCallbackListener(BaseStatusCallbackListener aListener) {
statusCbL.add(aListener);
@@ -258,8 +252,8 @@
/**
* Removes given listener from the list of listeners.
*
- * @param aListener -
- * object to remove from the list
+ * @param aListener
+ * - object to remove from the list
*/
public void removeStatusCallbackListener(BaseStatusCallbackListener aListener) {
statusCbL.remove(aListener);
@@ -268,8 +262,8 @@
/**
* Plugs in ProcessTrace object used to collect statistics.
*
- * @param aProcessingUnitProcessTrace -
- * object to compile stats
+ * @param aProcessingUnitProcessTrace
+ * - object to compile stats
*/
public void setProcessingUnitProcessTrace(ProcessTrace aProcessingUnitProcessTrace) {
processingUnitProcessTrace = aProcessingUnitProcessTrace;
@@ -279,8 +273,8 @@
/**
* Plugs in custom timer used by the PU for getting time.
*
- * @param aTimer -
- * custom timer to use
+ * @param aTimer
+ * - custom timer to use
*/
public void setUimaTimer(UimaTimer aTimer) {
timer = aTimer;
@@ -308,8 +302,8 @@
* Disable a CASProcessor in the processing pipeline. Locate it by provided index. The disabled
* Cas Processor remains in the Processing Pipeline, however it is not used furing processing.
*
- * @param aCasProcessorIndex -
- * location in the pipeline of the Cas Processor to delete
+ * @param aCasProcessorIndex
+ * - location in the pipeline of the Cas Processor to delete
*/
public void disableCasProcessor(int aCasProcessorIndex) {
if (aCasProcessorIndex < 0 || aCasProcessorIndex > processContainers.size()) {
@@ -331,8 +325,8 @@
*
* Alternative method to disable Cas Processor. Uses a name to locate it.
*
- * @param aCasProcessorName -
- * a name of the Cas Processor to disable
+ * @param aCasProcessorName
+ * - a name of the Cas Processor to disable
*/
public void disableCasProcessor(String aCasProcessorName) {
for (int i = 0; i < processContainers.size(); i++) {
@@ -353,8 +347,8 @@
* Enables Cas Processor with a given name. Enabled Cas Processor will immediately begin to
* receive bundles of Cas.
*
- * @param aCasProcessorName -
- * name of the Cas Processor to enable
+ * @param aCasProcessorName
+ * - name of the Cas Processor to enable
*/
public void enableCasProcessor(String aCasProcessorName) {
for (int i = 0; i < processContainers.size(); i++) {
@@ -373,10 +367,13 @@
/**
* Analyze.
*
- * @param aCasObjectList the a cas object list
- * @param pTrTemp the tr temp
+ * @param aCasObjectList
+ * the a cas object list
+ * @param pTrTemp
+ * the tr temp
* @return true, if successful
- * @throws Exception the exception
+ * @throws Exception
+ * the exception
*/
protected boolean analyze(Object[] aCasObjectList, ProcessTrace pTrTemp) throws Exception // throws
// ResourceProcessException,
@@ -450,11 +447,8 @@
try {
if (System.getProperty("SHOW_MEMORY") != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_show_memory__FINEST",
new Object[] { Thread.currentThread().getName(),
String.valueOf(Runtime.getRuntime().totalMemory() / 1024),
@@ -480,8 +474,9 @@
}
throw new ResourceProcessException(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_invalid_component_reference__WARNING", new Object[] {
- Thread.currentThread().getName(), "CasProcessor", "NULL" }), null);
+ "UIMA_CPM_EXP_invalid_component_reference__WARNING",
+ new Object[] { Thread.currentThread().getName(), "CasProcessor", "NULL" }),
+ null);
}
// Check to see if the CasProcessor is available for processing
// The CasProcessor may have been disabled due to excessive errors and error policy
@@ -507,11 +502,8 @@
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_checkedout_cp_from_container__FINEST",
new Object[] { Thread.currentThread().getName(), containerName,
processor.getClass().getName() });
@@ -526,11 +518,8 @@
isCasObject = true;
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_analysis_successfull__FINEST",
new Object[] { Thread.currentThread().getName(), containerName,
processor.getClass().getName() });
@@ -552,11 +541,8 @@
} finally {
if (retry == false) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_end_of_batch__FINEST",
new Object[] { Thread.currentThread().getName(), containerName,
processor.getClass().getName() });
@@ -578,22 +564,16 @@
// pipeline
if (processor != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_release_cp__FINEST",
new Object[] { Thread.currentThread().getName(), containerName,
processor.getClass().getName(), String.valueOf(casCache == null) });
}
doReleaseCasProcessor(container, processor);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_ok_release_cp__FINEST",
new Object[] { Thread.currentThread().getName(), containerName,
processor.getClass().getName(), String.valueOf(casCache == null) });
@@ -614,7 +594,8 @@
/**
* Sets the release CAS flag.
*
- * @param aFlag the new release CAS flag
+ * @param aFlag
+ * the new release CAS flag
*/
public void setReleaseCASFlag(boolean aFlag) {
relaseCAS = aFlag;
@@ -623,7 +604,8 @@
/**
* Sets the cas pool.
*
- * @param aPool the new cas pool
+ * @param aPool
+ * the new cas pool
*/
public void setCasPool(CPECasPool aPool) {
casPool = aPool;
@@ -632,12 +614,18 @@
/**
* Post analysis.
*
- * @param aCasObjectList the a cas object list
- * @param isCasObject the is cas object
- * @param casObjects the cas objects
- * @param aProcessTr the a process tr
- * @param doneAlready the done already
- * @throws Exception -
+ * @param aCasObjectList
+ * the a cas object list
+ * @param isCasObject
+ * the is cas object
+ * @param casObjects
+ * the cas objects
+ * @param aProcessTr
+ * the a process tr
+ * @param doneAlready
+ * the done already
+ * @throws Exception
+ * -
*/
private void postAnalysis(Object[] aCasObjectList, boolean isCasObject, Object[] casObjects,
ProcessTrace aProcessTr, boolean doneAlready) throws Exception {
@@ -667,15 +655,11 @@
}
}
// enqueue CASes. If the CPM is in shutdown mode due to hard kill dont allow enqueue of CASes
- if (outputQueue != null
- && (cpm.isRunning() == true || (cpm.isRunning() == false && cpm.isHardKilled() == false))) {
+ if (outputQueue != null && (cpm.isRunning() == true
+ || (cpm.isRunning() == false && cpm.isHardKilled() == false))) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_add_cas_to_queue__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_add_cas_to_queue__FINEST",
new Object[] { Thread.currentThread().getName(), outputQueue.getName(),
String.valueOf(outputQueue.getCurrentSize()) });
}
@@ -689,9 +673,9 @@
casCache = null;
-// synchronized (outputQueue) { // redundant - the above enqueue call does this
-// outputQueue.notifyAll();
-// }
+ // synchronized (outputQueue) { // redundant - the above enqueue call does this
+ // outputQueue.notifyAll();
+ // }
}
return;
@@ -702,47 +686,32 @@
if (outputQueue == null && casObjects != null && casObjects instanceof CasData[]) {
if (System.getProperty("DEBUG_RELEASE") != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_done_with_cas__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_done_with_cas__FINEST",
new Object[] { Thread.currentThread().getName(),
String.valueOf(Runtime.getRuntime().freeMemory() / 1024) });
}
}
for (int i = 0; i < casObjects.length; i++) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_local_cache__FINEST",
- new Object[] { Thread.currentThread().getName(),
- String.valueOf(casCache == null) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_show_local_cache__FINEST", new Object[] {
+ Thread.currentThread().getName(), String.valueOf(casCache == null) });
}
casObjects[i] = null;
aCasObjectList[i] = null;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_local_cache__FINEST",
- new Object[] { Thread.currentThread().getName(),
- String.valueOf(casCache == null) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_show_local_cache__FINEST", new Object[] {
+ Thread.currentThread().getName(), String.valueOf(casCache == null) });
}
}
if (System.getProperty("DEBUG_RELEASE") != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_show_total_memory__FINEST",
new Object[] { Thread.currentThread().getName(),
String.valueOf(Runtime.getRuntime().freeMemory() / 1024) });
@@ -755,8 +724,10 @@
/**
* Do release cas processor.
*
- * @param aContainer the a container
- * @param aCasProcessor the a cas processor
+ * @param aContainer
+ * the a container
+ * @param aCasProcessor
+ * the a cas processor
*/
private void doReleaseCasProcessor(ProcessingContainer aContainer, CasProcessor aCasProcessor) {
if (aCasProcessor != null && aContainer != null) {
@@ -767,10 +738,14 @@
/**
* Do end of batch.
*
- * @param aContainer the a container
- * @param aProcessor the a processor
- * @param aProcessTr the a process tr
- * @param howManyCases the how many cases
+ * @param aContainer
+ * the a container
+ * @param aProcessor
+ * the a processor
+ * @param aProcessTr
+ * the a process tr
+ * @param howManyCases
+ * the how many cases
*/
private void doEndOfBatch(ProcessingContainer aContainer, CasProcessor aProcessor,
ProcessTrace aProcessTr, int howManyCases) {
@@ -798,24 +773,25 @@
/**
* Main routine that handles errors occuring in the processing loop.
*
- * @param e -
- * exception in the main processing loop
- * @param aContainer -
- * current container of the Cas Processor
- * @param aProcessor -
- * current Cas Processor
- * @param aProcessTrace -
- * an object containing stats for this procesing loop
- * @param aCasObjectList -
- * list of CASes being analyzed
- * @param isCasObject -
- * determines type of CAS in the aCasObjectList ( CasData or CasObject)
+ * @param e
+ * - exception in the main processing loop
+ * @param aContainer
+ * - current container of the Cas Processor
+ * @param aProcessor
+ * - current Cas Processor
+ * @param aProcessTrace
+ * - an object containing stats for this procesing loop
+ * @param aCasObjectList
+ * - list of CASes being analyzed
+ * @param isCasObject
+ * - determines type of CAS in the aCasObjectList ( CasData or CasObject)
* @return boolean
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- private boolean handleErrors(Throwable e, ProcessingContainer aContainer,
- CasProcessor aProcessor, ProcessTrace aProcessTrace, Object[] aCasObjectList,
- boolean isCasObject) throws Exception {
+ private boolean handleErrors(Throwable e, ProcessingContainer aContainer, CasProcessor aProcessor,
+ ProcessTrace aProcessTrace, Object[] aCasObjectList, boolean isCasObject)
+ throws Exception {
boolean retry = true;
String containerName = aContainer.getName();
@@ -823,12 +799,8 @@
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
UIMAFramework.getLogger(this.getClass()).log(Level.SEVERE, Thread.currentThread().getName(),
e);
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.SEVERE,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_handle_exception__SEVERE",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_handle_exception__SEVERE",
new Object[] { Thread.currentThread().getName(), containerName,
aProcessor.getClass().getName(), e.getMessage() });
}
@@ -849,12 +821,8 @@
if (casCache != null) {
clearCasCache();
}
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.WARNING,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_drop_cas__WARNING",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_drop_cas__WARNING",
new Object[] { Thread.currentThread().getName(), containerName,
aProcessor.getClass().getName() });
@@ -957,8 +925,8 @@
}
} catch (Exception ex) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
- UIMAFramework.getLogger(this.getClass()).log(Level.SEVERE,
- Thread.currentThread().getName(), e);
+ UIMAFramework.getLogger(this.getClass()).log(Level.SEVERE, Thread.currentThread().getName(),
+ e);
}
retry = false;
ex.printStackTrace();
@@ -969,32 +937,30 @@
/**
* Invoke cas object cas processor.
*
- * @param container the container
- * @param processor the processor
- * @param aCasObjectList the a cas object list
- * @param pTrTemp the tr temp
- * @param isCasObject the is cas object
- * @throws Exception -
+ * @param container
+ * the container
+ * @param processor
+ * the processor
+ * @param aCasObjectList
+ * the a cas object list
+ * @param pTrTemp
+ * the tr temp
+ * @param isCasObject
+ * the is cas object
+ * @throws Exception
+ * -
*/
private void invokeCasObjectCasProcessor(ProcessingContainer container, CasProcessor processor,
Object[] aCasObjectList, ProcessTrace pTrTemp, boolean isCasObject) throws Exception {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_memory__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_show_memory__FINEST",
new Object[] { Thread.currentThread().getName(),
String.valueOf(Runtime.getRuntime().totalMemory() / 1024),
String.valueOf(Runtime.getRuntime().freeMemory() / 1024) });
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_invoke_cp_process__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_invoke_cp_process__FINEST",
new Object[] { Thread.currentThread().getName(), container.getName(),
processor.getClass().getName() });
@@ -1008,11 +974,8 @@
}
if (aCasObjectList[casIndex] == null) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.SEVERE,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_casobjectlist_is_null__SEVERE",
new Object[] { Thread.currentThread().getName(), container.getName(),
String.valueOf(casIndex) });
@@ -1026,12 +989,8 @@
}
if (processor instanceof AnalysisEngine) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_call_process__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_call_process__FINEST",
new Object[] { Thread.currentThread().getName(), container.getName(),
processor.getClass().getName() });
}
@@ -1039,11 +998,8 @@
pTrTemp.aggregate(((AnalysisEngine) processor).process(casList[casIndex]));
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_call_process_completed__FINEST",
new Object[] { Thread.currentThread().getName(), container.getName(),
processor.getClass().getName() });
@@ -1053,22 +1009,15 @@
threadState = 2006;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_call_process__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_call_process__FINEST",
new Object[] { Thread.currentThread().getName(), container.getName(),
processor.getClass().getName() });
}
((CasObjectProcessor) processor).processCas(casList[casIndex]);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_call_process_completed__FINEST",
new Object[] { Thread.currentThread().getName(), container.getName(),
processor.getClass().getName() });
@@ -1083,10 +1032,14 @@
/**
* Convert cas data to cas object.
*
- * @param casIndex the cas index
- * @param aContainerName the a container name
- * @param aCasObjectList the a cas object list
- * @throws Exception -
+ * @param casIndex
+ * the cas index
+ * @param aContainerName
+ * the a container name
+ * @param aCasObjectList
+ * the a cas object list
+ * @throws Exception
+ * -
*/
private void convertCasDataToCasObject(int casIndex, String aContainerName,
Object[] aCasObjectList) throws Exception {
@@ -1099,8 +1052,7 @@
while (casList[casIndex] == null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
- "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_get_cas_from_pool__FINEST",
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_get_cas_from_pool__FINEST",
new Object[] { Thread.currentThread().getName(), aContainerName });
}
@@ -1108,8 +1060,7 @@
casList[casIndex] = casPool.getCas(0);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
- "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_got_cas_from_pool__FINEST",
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_got_cas_from_pool__FINEST",
new Object[] { Thread.currentThread().getName(), aContainerName });
}
}
@@ -1134,24 +1085,27 @@
/**
* Invoke cas data cas processor.
*
- * @param container the container
- * @param processor the processor
- * @param aCasObjectList the a cas object list
- * @param pTrTemp the tr temp
- * @param isCasObject the is cas object
- * @param retry the retry
- * @throws Exception -
+ * @param container
+ * the container
+ * @param processor
+ * the processor
+ * @param aCasObjectList
+ * the a cas object list
+ * @param pTrTemp
+ * the tr temp
+ * @param isCasObject
+ * the is cas object
+ * @param retry
+ * the retry
+ * @throws Exception
+ * -
*/
private void invokeCasDataCasProcessor(ProcessingContainer container, CasProcessor processor,
Object[] aCasObjectList, ProcessTrace pTrTemp, boolean isCasObject, boolean retry)
throws Exception {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_invoke_cp_process__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_invoke_cp_process__FINEST",
new Object[] { Thread.currentThread().getName(), container.getName(),
processor.getClass().getName() });
}
@@ -1181,22 +1135,15 @@
Object[] casObjects = aCasObjectList;
long pStart = System.currentTimeMillis();
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_casobject_class__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_casobject_class__FINEST",
new Object[] { Thread.currentThread().getName(), container.getName(),
casObjects.getClass().getName() });
}
if (!(casObjects instanceof CasData[])) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_expected_casdata_class__FINEST",
new Object[] { Thread.currentThread().getName(), container.getName(),
casObjects.getClass().getName() });
@@ -1204,22 +1151,15 @@
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_call_process__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_call_process__FINEST",
new Object[] { Thread.currentThread().getName(), container.getName(),
processor.getClass().getName() });
}
casObjects = ((CasDataProcessor) processor).process((CasData[]) casObjects);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_call_process_completed__FINEST",
new Object[] { Thread.currentThread().getName(), container.getName(),
processor.getClass().getName() });
@@ -1246,7 +1186,8 @@
/**
* Container disabled.
*
- * @param aContainer the a container
+ * @param aContainer
+ * the a container
* @return true, if successful
*/
private boolean containerDisabled(ProcessingContainer aContainer) {
@@ -1270,7 +1211,8 @@
/**
* Check if the CASProcessor status is available for processing.
*
- * @param aStatus the a status
+ * @param aStatus
+ * the a status
* @return true, if is processor ready
*/
protected boolean isProcessorReady(int aStatus) {
@@ -1284,9 +1226,12 @@
/**
* Filter out the CAS.
*
- * @param aContainer the a container
- * @param isCasObject the is cas object
- * @param aCasObjectList the a cas object list
+ * @param aContainer
+ * the a container
+ * @param isCasObject
+ * the is cas object
+ * @param aCasObjectList
+ * the a cas object list
* @return true, if successful
*/
private boolean filterOutTheCAS(ProcessingContainer aContainer, boolean isCasObject,
@@ -1309,14 +1254,15 @@
}
/**
- * Notifies Listeners of the fact that the pipeline has finished processing the current set Cas'es.
+ * Notifies Listeners of the fact that the pipeline has finished processing the current set
+ * Cas'es.
*
- * @param aCas -
- * object containing an array of OR a single instance of Cas
- * @param isCasObject -
- * true if instance of Cas is of type Cas, false otherwise
- * @param aEntityProcStatus -
- * status object that may contain exceptions and trace
+ * @param aCas
+ * - object containing an array of OR a single instance of Cas
+ * @param isCasObject
+ * - true if instance of Cas is of type Cas, false otherwise
+ * @param aEntityProcStatus
+ * - status object that may contain exceptions and trace
*/
protected void notifyListeners(Object aCas, boolean isCasObject,
EntityProcessStatus aEntityProcStatus) {
@@ -1333,12 +1279,12 @@
* Notifies all configured listeners. Makes sure that appropriate type of Cas is sent to the
* listener. Convertions take place to ensure compatibility.
*
- * @param aCas -
- * Cas to pass to listener
- * @param isCasObject -
- * true is Cas is of type CAS
- * @param aEntityProcStatus -
- * status object containing exceptions and trace info
+ * @param aCas
+ * - Cas to pass to listener
+ * @param isCasObject
+ * - true is Cas is of type CAS
+ * @param aEntityProcStatus
+ * - status object containing exceptions and trace info
*/
protected void doNotifyListeners(Object aCas, boolean isCasObject,
EntityProcessStatus aEntityProcStatus) {
@@ -1373,18 +1319,18 @@
try {
mConverter.casDataToCasContainer((CasData) casObjectCopy, conversionCas, true);
} catch (CollectionException e) {
- UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING,
- this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_exception_converting_CAS__WARNING",
new Object[] { Thread.currentThread().getName() });
}
casObjectCopy = conversionCas;
}
// Notify the listener that the Cas has been processed
-// ((StatusCallbackListener) statCL).entityProcessComplete((CAS) casObjectCopy,
-// aEntityProcStatus);
- CPMEngine.callEntityProcessCompleteWithCAS(
- (StatusCallbackListener) statCL, (CAS) casObjectCopy, aEntityProcStatus);
+ // ((StatusCallbackListener) statCL).entityProcessComplete((CAS) casObjectCopy,
+ // aEntityProcStatus);
+ CPMEngine.callEntityProcessCompleteWithCAS((StatusCallbackListener) statCL,
+ (CAS) casObjectCopy, aEntityProcStatus);
if (conversionCas != null) {
if (casFromPool) {
conversionCasArray[0] = conversionCas;
@@ -1415,9 +1361,9 @@
new Object[] { Thread.currentThread().getName() });
}
casPool.releaseCas(casCache[index]);
-// synchronized (casPool) { // redundant - the above releaseCas call does this
-// casPool.notifyAll();
-// }
+ // synchronized (casPool) { // redundant - the above releaseCas call does this
+ // casPool.notifyAll();
+ // }
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
@@ -1439,11 +1385,12 @@
* initiate service restart. While the service is being restarted no invocations on the service
* should be done. Containers will be resumed on successfull service restart.
*
- * @param aContainer -
- * a container that manages the current Cas Processor.
- * @param aException the a exception
- * @param aThreadId -
- * id of the current thread
+ * @param aContainer
+ * - a container that manages the current Cas Processor.
+ * @param aException
+ * the a exception
+ * @param aThreadId
+ * - id of the current thread
* @return true, if successful
*/
private boolean pauseContainer(ProcessingContainer aContainer, Exception aException,
@@ -1459,11 +1406,16 @@
/**
* Handle service exception.
*
- * @param aContainer the a container
- * @param aProcessor the a processor
- * @param aProcessTr the a process tr
- * @param ex the ex
- * @throws Exception -
+ * @param aContainer
+ * the a container
+ * @param aProcessor
+ * the a processor
+ * @param aProcessTr
+ * the a process tr
+ * @param ex
+ * the ex
+ * @throws Exception
+ * -
*/
private void handleServiceException(ProcessingContainer aContainer, CasProcessor aProcessor,
ProcessTrace aProcessTr, Exception ex) throws Exception {
@@ -1484,11 +1436,8 @@
if (aContainer.isRemote() && aContainer.isSingleFencedService()) {
if (Thread.currentThread().getName().equals(threadId)) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_service_connection_exception__FINEST",
new Object[] { Thread.currentThread().getName(), aContainer.getName(),
aProcessor.getClass().getName() });
@@ -1496,12 +1445,8 @@
aProcessTr.startEvent(aContainer.getName(), "Process", "");
// Redeploy the CasProcessor
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_redeploy_cp__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_redeploy_cp__FINEST",
new Object[] { Thread.currentThread().getName(), aContainer.getName(),
aProcessor.getClass().getName() });
}
@@ -1513,12 +1458,8 @@
aContainer.resume();
threadId = null;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_redeploy_cp_done__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_redeploy_cp_done__FINEST",
new Object[] { Thread.currentThread().getName(), aContainer.getName(),
aProcessor.getClass().getName() });
}
@@ -1526,35 +1467,24 @@
} else {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_service_connection_exception__FINEST",
new Object[] { Thread.currentThread().getName(), aContainer.getName(),
aProcessor.getClass().getName() });
}
aProcessTr.startEvent(aContainer.getName(), "Process", "");
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_redeploy_cp__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_redeploy_cp__FINEST",
new Object[] { Thread.currentThread().getName(), aContainer.getName(),
aProcessor.getClass().getName() });
}
// Reconnect the CPM to CasProcessor running in fenced mode
cpm.redeployAnalysisEngine(aContainer);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_redeploy_cp_done__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_redeploy_cp_done__FINEST",
new Object[] { Thread.currentThread().getName(), aContainer.getName(),
aProcessor.getClass().getName() });
}
@@ -1564,10 +1494,14 @@
/**
* Handle skip cas processor.
*
- * @param aContainer the a container
- * @param aCasObjectList the a cas object list
- * @param isLastCP the is last CP
- * @throws Exception -
+ * @param aContainer
+ * the a container
+ * @param aCasObjectList
+ * the a cas object list
+ * @param isLastCP
+ * the is last CP
+ * @throws Exception
+ * -
*/
private void handleSkipCasProcessor(ProcessingContainer aContainer, Object[] aCasObjectList,
boolean isLastCP) throws Exception {
@@ -1615,8 +1549,8 @@
/**
* Returns the size of the CAS object. Currently only CASData is supported.
*
- * @param aCas -
- * Cas to get the size for
+ * @param aCas
+ * - Cas to get the size for
*
* @return the size of the CAS object. Currently only CASData is supported.
*/
@@ -1635,22 +1569,19 @@
* Conditionally, releases CASes back to the CAS pool. The release only occurs if the Cas
* Processor is the last in the processing chain.
*
- * @param aCasList -
- * list of CASes to release
- * @param lastProcessor -
- * determines if the release takes place
- * @param aName the a name
+ * @param aCasList
+ * - list of CASes to release
+ * @param lastProcessor
+ * - determines if the release takes place
+ * @param aName
+ * the a name
*/
private void releaseCases(Object aCasList, boolean lastProcessor, String aName) // ProcessingContainer
// aContainer)
{
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_releasing_cases__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_releasing_cases__FINEST",
new Object[] { Thread.currentThread().getName(), aName, String.valueOf(relaseCAS),
String.valueOf(lastProcessor) });
}
@@ -1676,12 +1607,8 @@
}
} else {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_casobject_class__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_casobject_class__FINEST",
new Object[] { Thread.currentThread().getName(), aName,
aCasList.getClass().getName() });
}
@@ -1693,8 +1620,8 @@
/**
* Stops all Cas Processors that are part of this PU.
*
- * @param kill -
- * true if CPE has been stopped before finishing processing during external stop
+ * @param kill
+ * - true if CPE has been stopped before finishing processing during external stop
*
*/
public void stopCasProcessors(boolean kill) {
@@ -1704,7 +1631,7 @@
new Object[] { Thread.currentThread().getName() });
}
// while (consumeQueue());
- //
+ //
// Object[] eofToken = new Object[1];
// // only need to one member in the array
// eofToken[0] = new EOFToken();
@@ -1716,12 +1643,8 @@
ProcessingContainer container = (ProcessingContainer) processContainers.get(i);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_container_time__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_show_container_time__FINEST",
new Object[] { Thread.currentThread().getName(), container.getName(),
String.valueOf(container.getTotalTime()) });
}
@@ -1744,12 +1667,8 @@
}
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_container_status__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_container_status__FINEST",
new Object[] { Thread.currentThread().getName(), container.getName(),
String.valueOf(container.getStatus()) });
}
@@ -1760,11 +1679,8 @@
if (deployer != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_undeploy_cp_instances__FINEST",
new Object[] { Thread.currentThread().getName(), container.getName(),
deployer.getClass().getName() });
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ProcessingUnit.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ProcessingUnit.java
index 54d7bb1..06656e1 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ProcessingUnit.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/ProcessingUnit.java
@@ -61,7 +61,6 @@
import org.apache.uima.util.UimaTimer;
import org.apache.uima.util.impl.ProcessTrace_impl;
-
/**
* This component executes the processing pipeline. Running in a seperate thread it continuously
* reads bundles of Cas from the Work Queue filled by {@link ArtifactProducer} and sends it through
@@ -72,7 +71,7 @@
*
*/
public class ProcessingUnit extends Thread {
-
+
/** The thread state. */
public int threadState = 0;
@@ -169,14 +168,15 @@
/**
* Initialize the PU.
*
- * @param acpm -
- * component managing life cycle of the CPE
- * @param aInputQueue -
- * queue to read from
- * @param aOutputQueue -
- * queue to write to
+ * @param acpm
+ * - component managing life cycle of the CPE
+ * @param aInputQueue
+ * - queue to read from
+ * @param aOutputQueue
+ * - queue to write to
*/
- public ProcessingUnit(CPMEngine acpm, BoundedWorkQueue aInputQueue, BoundedWorkQueue aOutputQueue) {
+ public ProcessingUnit(CPMEngine acpm, BoundedWorkQueue aInputQueue,
+ BoundedWorkQueue aOutputQueue) {
cpm = acpm;
try {
cpeConfiguration = cpm.getCpeConfig();
@@ -194,7 +194,8 @@
/**
* Instantiates a new processing unit.
*
- * @param acpm the acpm
+ * @param acpm
+ * the acpm
*/
public ProcessingUnit(CPMEngine acpm) {
cpm = acpm;
@@ -235,8 +236,8 @@
/**
* Alternative method of providing a queue from which this PU will read bundle of Cas.
*
- * @param aInputQueue -
- * read queue
+ * @param aInputQueue
+ * - read queue
*/
public void setInputQueue(BoundedWorkQueue aInputQueue) {
workQueue = aInputQueue;
@@ -245,8 +246,8 @@
/**
* Alternative method of providing a queue where this PU will deposit results of analysis.
*
- * @param aOutputQueue -
- * queue to write to
+ * @param aOutputQueue
+ * - queue to write to
*/
public void setOutputQueue(BoundedWorkQueue aOutputQueue) {
outputQueue = aOutputQueue;
@@ -256,8 +257,8 @@
* Alternative method of providing the reference to the component managing the lifecycle of the
* CPE.
*
- * @param acpm -
- * reference to the contrlling engine
+ * @param acpm
+ * - reference to the contrlling engine
*/
public void setCPMEngine(CPMEngine acpm) {
cpm = acpm;
@@ -285,8 +286,8 @@
/**
* Set a flag indicating if notifications should be made via configured Listeners.
*
- * @param aDoNotify -
- * true if notification is required, false otherwise
+ * @param aDoNotify
+ * - true if notification is required, false otherwise
*/
public void setNotifyListeners(boolean aDoNotify) {
notifyListeners = aDoNotify;
@@ -295,8 +296,8 @@
/**
* Plugs in Listener object used for notifications.
*
- * @param aListener -
- * {@link org.apache.uima.collection.base_cpm.BaseStatusCallbackListener} instance
+ * @param aListener
+ * - {@link org.apache.uima.collection.base_cpm.BaseStatusCallbackListener} instance
*/
public void addStatusCallbackListener(BaseStatusCallbackListener aListener) {
statusCbL.add(aListener);
@@ -315,8 +316,8 @@
/**
* Removes given listener from the list of listeners.
*
- * @param aListener -
- * object to remove from the list
+ * @param aListener
+ * - object to remove from the list
*/
public void removeStatusCallbackListener(BaseStatusCallbackListener aListener) {
statusCbL.remove(aListener);
@@ -325,8 +326,8 @@
/**
* Plugs in ProcessTrace object used to collect statistics.
*
- * @param aProcessingUnitProcessTrace -
- * object to compile stats
+ * @param aProcessingUnitProcessTrace
+ * - object to compile stats
*/
public void setProcessingUnitProcessTrace(ProcessTrace aProcessingUnitProcessTrace) {
processingUnitProcessTrace = aProcessingUnitProcessTrace;
@@ -336,8 +337,8 @@
/**
* Plugs in custom timer used by the PU for getting time.
*
- * @param aTimer -
- * custom timer to use
+ * @param aTimer
+ * - custom timer to use
*/
public void setUimaTimer(UimaTimer aTimer) {
timer = aTimer;
@@ -361,8 +362,8 @@
* Disable a CASProcessor in the processing pipeline. Locate it by provided index. The disabled
* Cas Processor remains in the Processing Pipeline, however it is not used furing processing.
*
- * @param aCasProcessorIndex -
- * location in the pipeline of the Cas Processor to delete
+ * @param aCasProcessorIndex
+ * - location in the pipeline of the Cas Processor to delete
*/
public void disableCasProcessor(int aCasProcessorIndex) {
if (aCasProcessorIndex < 0 || aCasProcessorIndex > processContainers.size()) {
@@ -380,8 +381,8 @@
*
* Alternative method to disable Cas Processor. Uses a name to locate it.
*
- * @param aCasProcessorName -
- * a name of the Cas Processor to disable
+ * @param aCasProcessorName
+ * - a name of the Cas Processor to disable
*/
public void disableCasProcessor(String aCasProcessorName) {
for (int i = 0; i < processContainers.size(); i++) {
@@ -398,8 +399,8 @@
* Enables Cas Processor with a given name. Enabled Cas Processor will immediately begin to
* receive bundles of Cas.
*
- * @param aCasProcessorName -
- * name of the Cas Processor to enable
+ * @param aCasProcessorName
+ * - name of the Cas Processor to enable
*/
public void enableCasProcessor(String aCasProcessorName) {
for (int i = 0; i < processContainers.size(); i++) {
@@ -437,7 +438,8 @@
* be generated by ArtifactProducer if end of collection is reached, or the CPM itself can place
* it in the Work Queue to force all processing threads to stop.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
private void handleEOFToken() throws Exception {
maybeLogFinest("UIMA_CPM_got_eof_token__FINEST");
@@ -449,9 +451,9 @@
if (cpm.getThreadCount() > 1) {
// Put EOF Token back to queue to ensure that all PUs get it
workQueue.enqueue(artifact);
-// synchronized (workQueue) { redundant - the above enqueue call does this
-// workQueue.notifyAll();
-// }
+ // synchronized (workQueue) { redundant - the above enqueue call does this
+ // workQueue.notifyAll();
+ // }
}
if (outputQueue != null) {
maybeLogFinest("UIMA_CPM_placed_eof_in_queue__FINEST", outputQueue.getName());
@@ -478,17 +480,17 @@
* are invalidated. Invalidated in the sense that they are marked as timed out. Each CAS will be
* released back to the CAS Pool.
*
- * @param artifact -
- * an array of CAS instances
+ * @param artifact
+ * - an array of CAS instances
*/
private void releaseTimedOutCases(Object[] artifact) {
for (int j = 0; j < artifact.length; j++) {
if (artifact[j] != null) {
// Release CASes that timed out back to the pool
casPool.releaseCas((CAS) artifact[j]);
-// synchronized (casPool) { // redundant - the above releaseCas call does this
-// casPool.notifyAll();
-// }
+ // synchronized (casPool) { // redundant - the above releaseCas call does this
+ // casPool.notifyAll();
+ // }
artifact[j] = null;
}
}
@@ -577,9 +579,9 @@
if (meta != null) {
EntityProcessStatusImpl enProcSt = new EntityProcessStatusImpl(
processingUnitProcessTrace);
- enProcSt.addEventStatus("Process", "Failed", new SkipCasException(
- "Dropping CAS due chunk Timeout. Doc Id::" + meta.getDocId() + " Sequence:"
- + meta.getSequence()));
+ enProcSt.addEventStatus("Process", "Failed",
+ new SkipCasException("Dropping CAS due chunk Timeout. Doc Id::"
+ + meta.getDocId() + " Sequence:" + meta.getSequence()));
doNotifyListeners(artifact[i], true, enProcSt);
} else {
EntityProcessStatusImpl enProcSt = new EntityProcessStatusImpl(
@@ -612,7 +614,7 @@
handleEOFToken();
break; // Terminate Loop
}
-
+
maybeLogFinest("UIMA_CPM_call_processNext__FINEST");
/* *********** EXECUTE PIPELINE ************ */
processNext(artifact, pT);
@@ -669,9 +671,9 @@
// casCache[index].reset();
maybeLogFinest("UIMA_CPM_release_cas_from_cache__FINEST");
casPool.releaseCas(casCache[index]);
-// synchronized (casPool) { // redundant - the above releaseCas call does this
-// casPool.notifyAll();
-// }
+ // synchronized (casPool) { // redundant - the above releaseCas call does this
+ // casPool.notifyAll();
+ // }
maybeLogFinest("UIMA_CPM_release_cas_from_cache_done__FINEST");
}
@@ -723,21 +725,28 @@
* fly. Two types of Cas Processors are currently supported:
*
* <ul>
- * <li> CasDataProcessor</li>
- * <li> CasObjectProcessor</li>
+ * <li>CasDataProcessor</li>
+ * <li>CasObjectProcessor</li>
* </ul>
*
* The first operates on instances of CasData the latter operates on instances of CAS. The results
* produced by Cas Processors are added to the output queue.
*
- * @param aCasObjectList - bundle of Cas to analyze
- * @param pTrTemp - object used to aggregate stats
+ * @param aCasObjectList
+ * - bundle of Cas to analyze
+ * @param pTrTemp
+ * - object used to aggregate stats
* @return true, if successful
- * @throws ResourceProcessException the resource process exception
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws CollectionException the collection exception
- * @throws AbortCPMException the abort CPM exception
- * @throws KillPipelineException the kill pipeline exception
+ * @throws ResourceProcessException
+ * the resource process exception
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ * @throws CollectionException
+ * the collection exception
+ * @throws AbortCPMException
+ * the abort CPM exception
+ * @throws KillPipelineException
+ * the kill pipeline exception
*/
protected boolean processNext(Object[] aCasObjectList, ProcessTrace pTrTemp)
throws ResourceProcessException, IOException, CollectionException, AbortCPMException,
@@ -768,7 +777,7 @@
// *******************************************
// Send Cas Object through the processing pipeline.
for (int i = 0; processContainers != null && i < processContainers.size(); i++) {
-
+
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
logFinest("UIMA_CPM_retrieve_container__FINEST", String.valueOf(i));
}
@@ -814,8 +823,8 @@
maybeLogSevere("UIMA_CPM_checkout_null_cp_from_container__SEVERE", container.getName());
throw new ResourceProcessException(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_invalid_component_reference__WARNING", new Object[] {
- Thread.currentThread().getName(), "CasProcessor", "NULL" }), null);
+ "UIMA_CPM_EXP_invalid_component_reference__WARNING",
+ new Object[] { Thread.currentThread().getName(), "CasProcessor", "NULL" }), null);
}
// Check to see if the CasProcessor is available for processing
// Container may have been disabled by another thread, so first check
@@ -899,8 +908,8 @@
maybeLogFinest("UIMA_CPM_initialize_cas__FINEST", container);
if (aCasObjectList[casIndex] == null) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
- logSevere("UIMA_CPM_casobjectlist_is_null__SEVERE",
- container.getName(), String.valueOf(casIndex));
+ logSevere("UIMA_CPM_casobjectlist_is_null__SEVERE", container.getName(),
+ String.valueOf(casIndex));
}
break;
}
@@ -912,7 +921,7 @@
while (casList[casIndex] == null) {
maybeLogFinest("UIMA_CPM_get_cas_from_pool__FINEST", container);
- // Retrieve a Cas from Cas Pool. Wait max 10 millis for an instance
+ // Retrieve a Cas from Cas Pool. Wait max 10 millis for an instance
casList[casIndex] = casPool.getCas(0);
maybeLogFinest("UIMA_CPM_got_cas_from_pool__FINEST", container);
}
@@ -934,8 +943,8 @@
} else {
casList[casIndex] = (CAS) aCasObjectList[casIndex];
}
- // Set the type from CasData to CasObject. When an error occurs in the proces()
- // we need to know what type of object we deal with.
+ // Set the type from CasData to CasObject. When an error occurs in the proces()
+ // we need to know what type of object we deal with.
isCasObject = true;
aCasObjectList = casList;
@@ -968,8 +977,8 @@
notifyListeners(aCasObjectList, isCasObject, aEntityProcStatus);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
logFinest("UIMA_CPM_done_notify_listeners__FINEST");
- logFinest("UIMA_CPM_releasing_cases__FINEST",
- container.getName(), String.valueOf(releaseCAS), "true");
+ logFinest("UIMA_CPM_releasing_cases__FINEST", container.getName(),
+ String.valueOf(releaseCAS), "true");
}
if (casCache != null) {
clearCasCache();
@@ -999,8 +1008,8 @@
maybeLogSevereException(e);
- logFinest("UIMA_CPM_pipeline_exception__FINEST",
- container.getName(), String.valueOf(container.isPaused()));
+ logFinest("UIMA_CPM_pipeline_exception__FINEST", container.getName(),
+ String.valueOf(container.isPaused()));
}
EntityProcessStatusImpl enProcSt = new EntityProcessStatusImpl(pTrTemp);
@@ -1024,8 +1033,8 @@
cpm.invalidateCASes((CAS[]) aCasObjectList);
}
retry = false; // Dont retry. The CAS has been released
- maybeLogWarning("UIMA_CPM_drop_cas__WARNING",
- container.getName(), processor.getClass().getName());
+ maybeLogWarning("UIMA_CPM_drop_cas__WARNING", container.getName(),
+ processor.getClass().getName());
} else {
retry = true; // default on Exception
}
@@ -1073,8 +1082,8 @@
threadId = Thread.currentThread().getName();
}
- if (processor instanceof CasDataProcessor
- || (processor instanceof CasObjectProcessor && !(processor instanceof AnalysisEngine))) {
+ if (processor instanceof CasDataProcessor || (processor instanceof CasObjectProcessor
+ && !(processor instanceof AnalysisEngine))) {
try {
pTrTemp.endEvent(container.getName(), "Process", "failed");
} catch (Exception exc) {
@@ -1106,8 +1115,8 @@
handleKillPipeline(container);
processor = null;
} catch (Exception innerE) {
- maybeLogWarning("UIMA_CPM_exception_on_pipeline_kill__WARNING",
- container.getName(), innerE.getMessage());
+ maybeLogWarning("UIMA_CPM_exception_on_pipeline_kill__WARNING", container.getName(),
+ innerE.getMessage());
}
// finally
// {
@@ -1119,8 +1128,8 @@
try {
handleAbortCPM(container, processor);
} catch (Exception innerE) {
- maybeLogWarning("UIMA_CPM_exception_on_cpm_kill__WARNING",
- container.getName(), innerE.getMessage());
+ maybeLogWarning("UIMA_CPM_exception_on_cpm_kill__WARNING", container.getName(),
+ innerE.getMessage());
}
// finally
// {
@@ -1178,8 +1187,8 @@
processor = null;
} catch (Exception excep) {
// Just log the exception. We are killing the pipeline
- maybeLogWarning("UIMA_CPM_exception_on_pipeline_kill__WARNING",
- container.getName(), excep.getMessage());
+ maybeLogWarning("UIMA_CPM_exception_on_pipeline_kill__WARNING",
+ container.getName(), excep.getMessage());
}
}
pTrTemp.endEvent(container.getName(), "Process", "failure");
@@ -1209,7 +1218,7 @@
}
} catch (Exception ex) {
if (UIMAFramework.getLogger().isLoggable(Level.FINER)) {
- logCPM(Level.FINER, "UIMA_CPM_exception__FINER", new Object[] {ex.getMessage()});
+ logCPM(Level.FINER, "UIMA_CPM_exception__FINER", new Object[] { ex.getMessage() });
ex.printStackTrace();
}
@@ -1254,7 +1263,7 @@
throw new ResourceProcessException(rpe);
}
maybeLogFinest("UIMA_CPM_pipeline_completed__FINEST");
-
+
return true;
}
@@ -1262,16 +1271,18 @@
* Notifies application listeners of completed analysis and stores results of analysis (CAS) in
* the Output Queue that this thread shares with a Cas Consumer thread.
*
- * @param aCasObjectList -
- * List of Artifacts just analyzed
- * @param isCasObject -
- * determines the types of CAS just analyzed ( CasData vs CasObject)
- * @param casObjects the cas objects
- * @param aProcessTr -
- * ProcessTrace object holding events and stats
- * @param doneAlready -
- * flag to indicate if the last Cas Processor was released back to its container
- * @throws Exception -
+ * @param aCasObjectList
+ * - List of Artifacts just analyzed
+ * @param isCasObject
+ * - determines the types of CAS just analyzed ( CasData vs CasObject)
+ * @param casObjects
+ * the cas objects
+ * @param aProcessTr
+ * - ProcessTrace object holding events and stats
+ * @param doneAlready
+ * - flag to indicate if the last Cas Processor was released back to its container
+ * @throws Exception
+ * -
*/
private void postAnalysis(Object[] aCasObjectList, boolean isCasObject, Object[] casObjects,
ProcessTrace aProcessTr, boolean doneAlready) throws Exception {
@@ -1288,8 +1299,8 @@
maybeLogFinest("UIMA_CPM_done_notify_listeners__FINEST");
}
// enqueue CASes. If the CPM is in shutdown mode due to hard kill dont allow enqueue of CASes
- if (outputQueue != null
- && (cpm.isRunning() == true || (cpm.isRunning() == false && cpm.isHardKilled() == false))) {
+ if (outputQueue != null && (cpm.isRunning() == true
+ || (cpm.isRunning() == false && cpm.isHardKilled() == false))) {
maybeLogFinestWorkQueue("UIMA_CPM_add_cas_to_queue__FINEST", outputQueue);
WorkUnit workUnit = new WorkUnit(aCasObjectList);
if (casCache != null && casCache[0] != null) {
@@ -1301,9 +1312,9 @@
casCache = null;
-// synchronized (outputQueue) { // redundant - the above enqueue call does this
-// outputQueue.notifyAll();
-// }
+ // synchronized (outputQueue) { // redundant - the above enqueue call does this
+ // outputQueue.notifyAll();
+ // }
}
return;
@@ -1313,7 +1324,8 @@
if (outputQueue == null && casObjects != null && casObjects instanceof CasData[]) {
if (System.getProperty("DEBUG_RELEASE") != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- logFinest("UIMA_CPM_done_with_cas__FINEST", String.valueOf(Runtime.getRuntime().freeMemory() / 1024));
+ logFinest("UIMA_CPM_done_with_cas__FINEST",
+ String.valueOf(Runtime.getRuntime().freeMemory() / 1024));
}
}
for (int i = 0; i < casObjects.length; i++) {
@@ -1322,9 +1334,10 @@
aCasObjectList[i] = null;
maybeLogFinest("UIMA_CPM_show_local_cache__FINEST", casCache);
}
- if (System.getProperty("DEBUG_RELEASE") != null) {
+ if (System.getProperty("DEBUG_RELEASE") != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- logFinest("UIMA_CPM_show_total_memory__FINEST", String.valueOf(Runtime.getRuntime().freeMemory() / 1024));
+ logFinest("UIMA_CPM_show_total_memory__FINEST",
+ String.valueOf(Runtime.getRuntime().freeMemory() / 1024));
}
}
}
@@ -1336,14 +1349,14 @@
* container using configuration determines if its time to call Cas Processor's
* batchProcessComplete() method.
*
- * @param aContainer -
- * container performing end of batch processing
- * @param aProcessor -
- * Cas Processor to call on end of batch
- * @param aProcessTr -
- * Process Trace to use for aggregating events
- * @param aCasObjectList -
- * CASes just analyzed
+ * @param aContainer
+ * - container performing end of batch processing
+ * @param aProcessor
+ * - Cas Processor to call on end of batch
+ * @param aProcessTr
+ * - Process Trace to use for aggregating events
+ * @param aCasObjectList
+ * - CASes just analyzed
*/
private void doEndOfBatchProcessing(ProcessingContainer aContainer, CasProcessor aProcessor,
ProcessTrace aProcessTr, Object[] aCasObjectList) {
@@ -1355,8 +1368,8 @@
maybeLogFinest("UIMA_CPM_end_of_batch_completed__FINEST", aContainer);
} catch (Exception ex) {
- maybeLogSevere("UIMA_CPM_end_of_batch_exception__SEVERE",
- aContainer.getName(), ex.getMessage());
+ maybeLogSevere("UIMA_CPM_end_of_batch_exception__SEVERE", aContainer.getName(),
+ ex.getMessage());
aProcessTr.endEvent(cName, "End of Batch", "failed");
} finally {
@@ -1373,10 +1386,14 @@
* In case a CAS is skipped ( due to excessive exceptions that it causes ), increments stats and
* totals.
*
- * @param aContainer the a container
- * @param aCasObjectList the a cas object list
- * @param isLastCP the is last CP
- * @throws Exception -
+ * @param aContainer
+ * the a container
+ * @param aCasObjectList
+ * the a cas object list
+ * @param isLastCP
+ * the is last CP
+ * @throws Exception
+ * -
*/
private void handleSkipCasProcessor(ProcessingContainer aContainer, Object[] aCasObjectList,
boolean isLastCP) throws Exception {
@@ -1404,7 +1421,7 @@
try {
releaseCases(casList, isLastCP, aContainer.getName());
} catch (Exception ex2) {
-
+
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
logSevere("UIMA_CPM_exception_releasing_cas__SEVERE", aContainer.getName());
maybeLogSevereException(ex2);
@@ -1419,16 +1436,17 @@
/**
* Handle exceptions related to remote invocations.
*
- * @param aContainer -
- * container managing CasProcessor that failed
- * @param aProcessor -
- * failed CasProcessor
- * @param aProcessTr -
- * ProcessTrace object holding events
- * @param ex -
- * Source exception
+ * @param aContainer
+ * - container managing CasProcessor that failed
+ * @param aProcessor
+ * - failed CasProcessor
+ * @param aProcessTr
+ * - ProcessTrace object holding events
+ * @param ex
+ * - Source exception
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
private void handleServiceException(ProcessingContainer aContainer, CasProcessor aProcessor,
ProcessTrace aProcessTr, Exception ex) throws Exception {
@@ -1450,7 +1468,7 @@
aProcessTr.startEvent(aContainer.getName(), "Process", "");
// Redeploy the CasProcessor
maybeLogFinest("UIMA_CPM_redeploy_cp__FINEST", aContainer, aProcessor);
- // Reconnect the CPM to CasProcessor running in fenced mode
+ // Reconnect the CPM to CasProcessor running in fenced mode
cpm.redeployAnalysisEngine(aContainer);
// Resume the container
@@ -1472,16 +1490,16 @@
/**
* Diables currect CasProcessor.
*
- * @param aContainer -
- * a container that manages the current Cas Processor.
- * @param aProcessor -
- * a Cas Processor to be disabled
- * @throws Exception -
- * exception
+ * @param aContainer
+ * - a container that manages the current Cas Processor.
+ * @param aProcessor
+ * - a Cas Processor to be disabled
+ * @throws Exception
+ * - exception
*/
private void handleAbortCasProcessor(ProcessingContainer aContainer, CasProcessor aProcessor)
throws Exception {
- maybeLogFinest("UIMA_CPM_disable_due_to_action__FINEST", aContainer);
+ maybeLogFinest("UIMA_CPM_disable_due_to_action__FINEST", aContainer);
if (aContainer.isPaused()) {
aContainer.resume();
}
@@ -1499,12 +1517,12 @@
/**
* Terminates the CPM.
*
- * @param aContainer -
- * a container that manages the current Cas Processor.
- * @param aProcessor -
- * a Cas Processor to be disabled
- * @throws Exception -
- * exception
+ * @param aContainer
+ * - a container that manages the current Cas Processor.
+ * @param aProcessor
+ * - a Cas Processor to be disabled
+ * @throws Exception
+ * - exception
*/
private void handleAbortCPM(ProcessingContainer aContainer, CasProcessor aProcessor)
throws Exception {
@@ -1523,7 +1541,8 @@
releaseCAS = true;
releaseCases(casList, true, aContainer.getName());
} catch (Exception exc) {
- maybeLogSevere("UIMA_CPM_exception_on_cpm_kill__WARNING", aContainer.getName(), exc.getMessage());
+ maybeLogSevere("UIMA_CPM_exception_on_cpm_kill__WARNING", aContainer.getName(),
+ exc.getMessage());
maybeLogSevereException(exc);
}
}
@@ -1536,10 +1555,10 @@
/**
* Terminates the CPM.
*
- * @param aContainer -
- * a container that manages the current Cas Processor.
- * @throws Exception -
- * exception
+ * @param aContainer
+ * - a container that manages the current Cas Processor.
+ * @throws Exception
+ * - exception
*/
private void handleKillPipeline(ProcessingContainer aContainer) throws Exception {
if (aContainer.isPaused()) {
@@ -1565,11 +1584,12 @@
* initiate service restart. While the service is being restarted no invocations on the service
* should be done. Containers will be resumed on successfull service restart.
*
- * @param aContainer -
- * a container that manages the current Cas Processor.
- * @param aException the a exception
- * @param aThreadId -
- * id of the current thread
+ * @param aContainer
+ * - a container that manages the current Cas Processor.
+ * @param aException
+ * the a exception
+ * @param aThreadId
+ * - id of the current thread
* @return true, if successful
*/
private boolean pauseContainer(ProcessingContainer aContainer, Exception aException,
@@ -1586,18 +1606,19 @@
* Conditionally, releases CASes back to the CAS pool. The release only occurs if the Cas
* Processor is the last in the processing chain.
*
- * @param aCasList -
- * list of CASes to release
- * @param lastProcessor -
- * determines if the release takes place
- * @param aName the a name
+ * @param aCasList
+ * - list of CASes to release
+ * @param lastProcessor
+ * - determines if the release takes place
+ * @param aName
+ * the a name
*/
private void releaseCases(Object aCasList, boolean lastProcessor, String aName) // ProcessingContainer
// aContainer)
{
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- logFinest("UIMA_CPM_releasing_cases__FINEST",
- aName, String.valueOf(releaseCAS), String.valueOf(lastProcessor));
+ logFinest("UIMA_CPM_releasing_cases__FINEST", aName, String.valueOf(releaseCAS),
+ String.valueOf(lastProcessor));
}
if (aCasList == null) {
return;
@@ -1620,14 +1641,15 @@
}
/**
- * Notifies Listeners of the fact that the pipeline has finished processing the current set Cas'es.
+ * Notifies Listeners of the fact that the pipeline has finished processing the current set
+ * Cas'es.
*
- * @param aCas -
- * object containing an array of OR a single instance of Cas
- * @param isCasObject -
- * true if instance of Cas is of type Cas, false otherwise
- * @param aEntityProcStatus -
- * status object that may contain exceptions and trace
+ * @param aCas
+ * - object containing an array of OR a single instance of Cas
+ * @param isCasObject
+ * - true if instance of Cas is of type Cas, false otherwise
+ * @param aEntityProcStatus
+ * - status object that may contain exceptions and trace
*/
protected void notifyListeners(Object aCas, boolean isCasObject,
EntityProcessStatus aEntityProcStatus) {
@@ -1644,12 +1666,12 @@
* Notifies all configured listeners. Makes sure that appropriate type of Cas is sent to the
* listener. Convertions take place to ensure compatibility.
*
- * @param aCas -
- * Cas to pass to listener
- * @param isCasObject -
- * true is Cas is of type CAS
- * @param aEntityProcStatus -
- * status object containing exceptions and trace info
+ * @param aCas
+ * - Cas to pass to listener
+ * @param isCasObject
+ * - true is Cas is of type CAS
+ * @param aEntityProcStatus
+ * - status object containing exceptions and trace info
*/
protected void doNotifyListeners(Object aCas, boolean isCasObject,
EntityProcessStatus aEntityProcStatus) {
@@ -1689,9 +1711,10 @@
casObjectCopy = conversionCas;
}
// Notify the listener that the Cas has been processed
-// ((StatusCallbackListener) statCL).entityProcessComplete((CAS) casObjectCopy,
-// aEntityProcStatus);
- CPMEngine.callEntityProcessCompleteWithCAS((StatusCallbackListener) statCL, (CAS) casObjectCopy, aEntityProcStatus);
+ // ((StatusCallbackListener) statCL).entityProcessComplete((CAS) casObjectCopy,
+ // aEntityProcStatus);
+ CPMEngine.callEntityProcessCompleteWithCAS((StatusCallbackListener) statCL,
+ (CAS) casObjectCopy, aEntityProcStatus);
if (conversionCas != null) {
if (casFromPool) {
conversionCasArray[0] = conversionCas;
@@ -1713,8 +1736,8 @@
* at the end of processing. This is typically done for Cas Consumer thread, but in configurations
* not using Cas Consumers The processing pipeline may also release the CAS.
*
- * @param aFlag -
- * true if this thread should release a CAS when analysis is complete
+ * @param aFlag
+ * - true if this thread should release a CAS when analysis is complete
*/
public void setReleaseCASFlag(boolean aFlag) {
releaseCAS = aFlag;
@@ -1723,25 +1746,25 @@
/**
* Stops all Cas Processors that are part of this PU.
*
- * @param kill -
- * true if CPE has been stopped before finishing processing during external stop
+ * @param kill
+ * - true if CPE has been stopped before finishing processing during external stop
*
*/
public void stopCasProcessors(boolean kill) {
maybeLogFinest("UIMA_CPM_stop_containers__FINEST");
- // Stop all running CASProcessors
+ // Stop all running CASProcessors
for (int i = 0; processContainers != null && i < processContainers.size(); i++) {
ProcessingContainer container = (ProcessingContainer) processContainers.get(i);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- logFinest("UIMA_CPM_show_container_time__FINEST",
- container.getName(), String.valueOf(container.getTotalTime()));
+ logFinest("UIMA_CPM_show_container_time__FINEST", container.getName(),
+ String.valueOf(container.getTotalTime()));
}
synchronized (container) {
// Change the status of this container to KILLED if the CPM has been stopped
// before completing the collection and current status of CasProcessor is
// either READY or RUNNING
if (kill || (!cpm.isRunning() && isProcessorReady(container.getStatus()))) {
- maybeLogFinest("UIMA_CPM_kill_cp__FINEST", container);
+ maybeLogFinest("UIMA_CPM_kill_cp__FINEST", container);
container.setStatus(Constants.CAS_PROCESSOR_KILLED);
} else {
// If the CasProcessor has not been disabled during processing change its
@@ -1750,10 +1773,10 @@
container.setStatus(Constants.CAS_PROCESSOR_COMPLETED);
}
}
-
+
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- logFinest("UIMA_CPM_container_status__FINEST",
- container.getName(), String.valueOf(container.getStatus()));
+ logFinest("UIMA_CPM_container_status__FINEST", container.getName(),
+ String.valueOf(container.getStatus()));
}
ProcessTrace pTrTemp = new ProcessTrace_impl(cpm.getPerformanceTuningSettings());
pTrTemp.startEvent(container.getName(), "End of Batch", "");
@@ -1762,14 +1785,16 @@
if (deployer != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- logFinest("UIMA_CPM_undeploy_cp_instances__FINEST", container.getName(), deployer.getClass().getName());
+ logFinest("UIMA_CPM_undeploy_cp_instances__FINEST", container.getName(),
+ deployer.getClass().getName());
}
deployer.undeploy();
}
container.destroy();
} catch (Exception e) {
- logWarning("UIMA_CPM_exception_during_cp_stop__WARNING", container.getName(), e.getMessage());
+ logWarning("UIMA_CPM_exception_during_cp_stop__WARNING", container.getName(),
+ e.getMessage());
} finally {
pTrTemp.endEvent(container.getName(), "End of Batch", "");
if (processingUnitProcessTrace != null) {
@@ -1783,8 +1808,8 @@
/**
* Returns true if the CPM has finished analyzing the collection.
*
- * @param aCount -
- * running total of documents processed so far
+ * @param aCount
+ * - running total of documents processed so far
*
* @return - true if CPM has processed all docs, false otherwise
*/
@@ -1801,7 +1826,8 @@
/**
* Process.
*
- * @param anArtifact the an artifact
+ * @param anArtifact
+ * the an artifact
*/
protected void process(Object anArtifact) {
if (anArtifact instanceof Object[]) {
@@ -1815,7 +1841,8 @@
/**
* Show metadata.
*
- * @param aCasList the a cas list
+ * @param aCasList
+ * the a cas list
*/
protected void showMetadata(Object[] aCasList) {
}
@@ -1823,7 +1850,8 @@
/**
* Check if the CASProcessor status is available for processing.
*
- * @param aStatus the a status
+ * @param aStatus
+ * the a status
* @return true, if is processor ready
*/
protected boolean isProcessorReady(int aStatus) {
@@ -1837,7 +1865,8 @@
/**
* Returns the size of the CAS object. Currently only CASData is supported.
*
- * @param aCas CAS to get the size for
+ * @param aCas
+ * CAS to get the size for
*
* @return the size of the CAS object. Currently only CASData is supported.
*/
@@ -1855,7 +1884,8 @@
/**
* Sets the cas pool.
*
- * @param aPool the new cas pool
+ * @param aPool
+ * the new cas pool
*/
public void setCasPool(CPECasPool aPool) {
casPool = aPool;
@@ -1864,9 +1894,12 @@
/**
* Filter out the CAS.
*
- * @param aContainer the a container
- * @param isCasObject the is cas object
- * @param aCasObjectList the a cas object list
+ * @param aContainer
+ * the a container
+ * @param isCasObject
+ * the is cas object
+ * @param aCasObjectList
+ * the a cas object list
* @return true, if successful
*/
private boolean filterOutTheCAS(ProcessingContainer aContainer, boolean isCasObject,
@@ -1887,7 +1920,8 @@
/**
* Container disabled.
*
- * @param aContainer the a container
+ * @param aContainer
+ * the a container
* @return true, if successful
*/
private boolean containerDisabled(ProcessingContainer aContainer) {
@@ -1907,12 +1941,13 @@
/**
* An alternate processing loop designed for the single-threaded CPM.
*
- * @param aCasObjectList -
- * a list of CASes to analyze
- * @param pTrTemp -
- * process trace where statistics are added during analysis
+ * @param aCasObjectList
+ * - a list of CASes to analyze
+ * @param pTrTemp
+ * - process trace where statistics are added during analysis
* @return true, if successful
- * @throws Exception the exception
+ * @throws Exception
+ * the exception
*/
protected boolean analyze(Object[] aCasObjectList, ProcessTrace pTrTemp) throws Exception // throws
// ResourceProcessException,
@@ -1985,8 +2020,9 @@
maybeLogSevere("UIMA_CPM_checkout_null_cp_from_container__SEVERE", containerName);
throw new ResourceProcessException(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_invalid_component_reference__WARNING", new Object[] {
- Thread.currentThread().getName(), "CasProcessor", "NULL" }), null);
+ "UIMA_CPM_EXP_invalid_component_reference__WARNING",
+ new Object[] { Thread.currentThread().getName(), "CasProcessor", "NULL" }),
+ null);
}
// Check to see if the CasProcessor is available for processing
// The CasProcessor may have been disabled due to excessive errors and error policy
@@ -2077,8 +2113,10 @@
/**
* Do release cas processor.
*
- * @param aContainer the a container
- * @param aCasProcessor the a cas processor
+ * @param aContainer
+ * the a container
+ * @param aCasProcessor
+ * the a cas processor
*/
private void doReleaseCasProcessor(ProcessingContainer aContainer, CasProcessor aCasProcessor) {
if (aCasProcessor != null && aContainer != null) {
@@ -2089,10 +2127,14 @@
/**
* Do end of batch.
*
- * @param aContainer the a container
- * @param aProcessor the a processor
- * @param aProcessTr the a process tr
- * @param howManyCases the how many cases
+ * @param aContainer
+ * the a container
+ * @param aProcessor
+ * the a processor
+ * @param aProcessTr
+ * the a process tr
+ * @param howManyCases
+ * the how many cases
*/
private void doEndOfBatch(ProcessingContainer aContainer, CasProcessor aProcessor,
ProcessTrace aProcessTr, int howManyCases) {
@@ -2101,38 +2143,39 @@
aContainer.isEndOfBatch(aProcessor, howManyCases);
maybeLogFinest("UIMA_CPM_end_of_batch_completed__FINEST", aContainer);
} catch (Exception ex) {
- maybeLogSevere("UIMA_CPM_end_of_batch_exception__SEVERE", containerName, ex.getMessage());
+ maybeLogSevere("UIMA_CPM_end_of_batch_exception__SEVERE", containerName, ex.getMessage());
}
}
/**
* Main routine that handles errors occuring in the processing loop.
*
- * @param e -
- * exception in the main processing loop
- * @param aContainer -
- * current container of the Cas Processor
- * @param aProcessor -
- * current Cas Processor
- * @param aProcessTrace -
- * an object containing stats for this procesing loop
- * @param aCasObjectList -
- * list of CASes being analyzed
- * @param isCasObject -
- * determines type of CAS in the aCasObjectList ( CasData or CasObject)
+ * @param e
+ * - exception in the main processing loop
+ * @param aContainer
+ * - current container of the Cas Processor
+ * @param aProcessor
+ * - current Cas Processor
+ * @param aProcessTrace
+ * - an object containing stats for this procesing loop
+ * @param aCasObjectList
+ * - list of CASes being analyzed
+ * @param isCasObject
+ * - determines type of CAS in the aCasObjectList ( CasData or CasObject)
* @return boolean
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- private boolean handleErrors(Throwable e, ProcessingContainer aContainer,
- CasProcessor aProcessor, ProcessTrace aProcessTrace, Object[] aCasObjectList,
- boolean isCasObject) throws Exception {
+ private boolean handleErrors(Throwable e, ProcessingContainer aContainer, CasProcessor aProcessor,
+ ProcessTrace aProcessTrace, Object[] aCasObjectList, boolean isCasObject)
+ throws Exception {
boolean retry = true;
String containerName = aContainer.getName();
e.printStackTrace();
maybeLogSevereException(e);
- maybeLogSevere("UIMA_CPM_handle_exception__SEVERE",
- containerName, aProcessor.getClass().getName(), e.getMessage());
+ maybeLogSevere("UIMA_CPM_handle_exception__SEVERE", containerName,
+ aProcessor.getClass().getName(), e.getMessage());
EntityProcessStatusImpl enProcSt = new EntityProcessStatusImpl(aProcessTrace);
enProcSt.addEventStatus("Process", "Failed", e);
@@ -2232,15 +2275,12 @@
} catch (Exception ex) {
maybeLogSevereException(ex);
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
- // done as 2 messages because there is no method supporting
+ // done as 2 messages because there is no method supporting
// both a Throwable, and a message with substitutable args, in the logger
logSevere("UIMA_CPM_unhandled_error__SEVERE", e.getLocalizedMessage());
- UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE,
- this.getClass().getName(),
- "handleErrors",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_unexpected_exception__SEVERE",
- ex);
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
+ "handleErrors", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_unexpected_exception__SEVERE", ex);
}
retry = false;
ex.printStackTrace();
@@ -2251,12 +2291,18 @@
/**
* Invoke cas object cas processor.
*
- * @param container the container
- * @param processor the processor
- * @param aCasObjectList the a cas object list
- * @param pTrTemp the tr temp
- * @param isCasObject the is cas object
- * @throws Exception -
+ * @param container
+ * the container
+ * @param processor
+ * the processor
+ * @param aCasObjectList
+ * the a cas object list
+ * @param pTrTemp
+ * the tr temp
+ * @param isCasObject
+ * the is cas object
+ * @throws Exception
+ * -
*/
private void invokeCasObjectCasProcessor(ProcessingContainer container, CasProcessor processor,
Object[] aCasObjectList, ProcessTrace pTrTemp, boolean isCasObject) throws Exception {
@@ -2267,11 +2313,8 @@
maybeLogFinest("UIMA_CPM_initialize_cas__FINEST", container);
if (aCasObjectList[casIndex] == null) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.SEVERE,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.SEVERE, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_casobjectlist_is_null__SEVERE",
new Object[] { Thread.currentThread().getName(), container.getName(),
String.valueOf(casIndex) });
@@ -2305,10 +2348,14 @@
/**
* Convert cas data to cas object.
*
- * @param casIndex the cas index
- * @param aContainerName the a container name
- * @param aCasObjectList the a cas object list
- * @throws Exception -
+ * @param casIndex
+ * the cas index
+ * @param aContainerName
+ * the a container name
+ * @param aCasObjectList
+ * the a cas object list
+ * @throws Exception
+ * -
*/
private void convertCasDataToCasObject(int casIndex, String aContainerName,
Object[] aCasObjectList) throws Exception {
@@ -2342,13 +2389,20 @@
/**
* Invoke cas data cas processor.
*
- * @param container the container
- * @param processor the processor
- * @param aCasObjectList the a cas object list
- * @param pTrTemp the tr temp
- * @param isCasObject the is cas object
- * @param retry the retry
- * @throws Exception -
+ * @param container
+ * the container
+ * @param processor
+ * the processor
+ * @param aCasObjectList
+ * the a cas object list
+ * @param pTrTemp
+ * the tr temp
+ * @param isCasObject
+ * the is cas object
+ * @param retry
+ * the retry
+ * @throws Exception
+ * -
*/
private void invokeCasDataCasProcessor(ProcessingContainer container, CasProcessor processor,
Object[] aCasObjectList, ProcessTrace pTrTemp, boolean isCasObject, boolean retry)
@@ -2404,21 +2458,26 @@
}
pTrTemp.endEvent(container.getName(), "Process", "success");
}
-
-
- /** loggers Special forms for frequent args sets "maybe" versions test isLoggable Additional args passed as object array to logger. */
-
- private static final Object [] zeroLengthObjectArray = new Object[0];
-
+
+ /**
+ * loggers Special forms for frequent args sets "maybe" versions test isLoggable Additional args
+ * passed as object array to logger.
+ */
+
+ private static final Object[] zeroLengthObjectArray = new Object[0];
+
/** The Constant thisClassName. */
private static final String thisClassName = ProcessingUnit.class.getName();
-
+
/**
* Log CPM.
*
- * @param level the level
- * @param msgBundleId the msg bundle id
- * @param args the args
+ * @param level
+ * the level
+ * @param msgBundleId
+ * the msg bundle id
+ * @param args
+ * the args
*/
private void logCPM(Level level, String msgBundleId, Object[] args) {
if (null == args) {
@@ -2427,21 +2486,17 @@
Object[] aa = new Object[args.length + 1];
aa[0] = Thread.currentThread().getName();
System.arraycopy(args, 0, aa, 1, args.length);
-
- UIMAFramework.getLogger(this.getClass()).logrb(
- level,
- thisClassName,
- "process", // used as the method name
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- msgBundleId,
- aa
- );
+
+ UIMAFramework.getLogger(this.getClass()).logrb(level, thisClassName, "process", // used as the
+ // method name
+ CPMUtils.CPM_LOG_RESOURCE_BUNDLE, msgBundleId, aa);
}
/**
* Maybe log finest.
*
- * @param msgBundleId the msg bundle id
+ * @param msgBundleId
+ * the msg bundle id
*/
// 0 arg
private void maybeLogFinest(String msgBundleId) {
@@ -2449,21 +2504,24 @@
logFinest(msgBundleId);
}
}
-
+
/**
* Log finest.
*
- * @param msgBundleId the msg bundle id
+ * @param msgBundleId
+ * the msg bundle id
*/
private void logFinest(String msgBundleId) {
logCPM(Level.FINEST, msgBundleId, null);
}
-
+
/**
* Maybe log finest.
*
- * @param msgBundleId the msg bundle id
- * @param arg1 the arg 1
+ * @param msgBundleId
+ * the msg bundle id
+ * @param arg1
+ * the arg 1
*/
// 1 arg
private void maybeLogFinest(String msgBundleId, String arg1) {
@@ -2471,23 +2529,28 @@
logFinest(msgBundleId, arg1);
}
}
-
+
/**
* Log finest.
*
- * @param msgBundleId the msg bundle id
- * @param arg1 the arg 1
+ * @param msgBundleId
+ * the msg bundle id
+ * @param arg1
+ * the arg 1
*/
private void logFinest(String msgBundleId, String arg1) {
- logCPM(Level.FINEST, msgBundleId, new Object [] {arg1});
+ logCPM(Level.FINEST, msgBundleId, new Object[] { arg1 });
}
/**
* Maybe log finest.
*
- * @param msgBundleId the msg bundle id
- * @param arg1 the arg 1
- * @param arg2 the arg 2
+ * @param msgBundleId
+ * the msg bundle id
+ * @param arg1
+ * the arg 1
+ * @param arg2
+ * the arg 2
*/
// 2 args
private void maybeLogFinest(String msgBundleId, String arg1, String arg2) {
@@ -2495,110 +2558,134 @@
logFinest(msgBundleId, arg1, arg2);
}
}
-
+
/**
* Log finest.
*
- * @param msgBundleId the msg bundle id
- * @param arg1 the arg 1
- * @param arg2 the arg 2
+ * @param msgBundleId
+ * the msg bundle id
+ * @param arg1
+ * the arg 1
+ * @param arg2
+ * the arg 2
*/
private void logFinest(String msgBundleId, String arg1, String arg2) {
- logCPM(Level.FINEST, msgBundleId, new Object [] {arg1, arg2});
+ logCPM(Level.FINEST, msgBundleId, new Object[] { arg1, arg2 });
}
-
+
// 3 args
-
+
/**
* Log finest.
*
- * @param msgBundleId the msg bundle id
- * @param arg1 the arg 1
- * @param arg2 the arg 2
- * @param arg3 the arg 3
+ * @param msgBundleId
+ * the msg bundle id
+ * @param arg1
+ * the arg 1
+ * @param arg2
+ * the arg 2
+ * @param arg3
+ * the arg 3
*/
private void logFinest(String msgBundleId, String arg1, String arg2, String arg3) {
- logCPM(Level.FINEST, msgBundleId, new Object [] {arg1, arg2, arg3});
+ logCPM(Level.FINEST, msgBundleId, new Object[] { arg1, arg2, arg3 });
}
-
/**
* Maybe log finest.
*
- * @param msgBundleId the msg bundle id
- * @param container the container
- * @param processor the processor
+ * @param msgBundleId
+ * the msg bundle id
+ * @param container
+ * the container
+ * @param processor
+ * the processor
*/
// special common 2 arg version with container, processor
- private void maybeLogFinest(String msgBundleId, ProcessingContainer container, CasProcessor processor) {
+ private void maybeLogFinest(String msgBundleId, ProcessingContainer container,
+ CasProcessor processor) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
logFinest(msgBundleId, container.getName(), processor.getClass().getName());
}
}
-
+
/**
* Log finest.
*
- * @param msgBundleId the msg bundle id
- * @param container the container
- * @param processor the processor
+ * @param msgBundleId
+ * the msg bundle id
+ * @param container
+ * the container
+ * @param processor
+ * the processor
*/
- private void logFinest(String msgBundleId, ProcessingContainer container, CasProcessor processor) {
+ private void logFinest(String msgBundleId, ProcessingContainer container,
+ CasProcessor processor) {
logFinest(msgBundleId, container.getName(), processor.getClass().getName());
}
-
+
/**
* Maybe log finest.
*
- * @param msgBundleId the msg bundle id
- * @param container the container
+ * @param msgBundleId
+ * the msg bundle id
+ * @param container
+ * the container
*/
private void maybeLogFinest(String msgBundleId, ProcessingContainer container) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
logFinest(msgBundleId, container.getName());
}
}
-
+
/**
* Maybe log finest.
*
- * @param msgBundleId the msg bundle id
- * @param processor the processor
+ * @param msgBundleId
+ * the msg bundle id
+ * @param processor
+ * the processor
*/
private void maybeLogFinest(String msgBundleId, CasProcessor processor) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
logFinest(msgBundleId, processor.getClass().getName());
}
}
-
+
/**
* Maybe log finest.
*
- * @param msgBundleId the msg bundle id
- * @param container the container
- * @param processor the processor
- * @param casCache the cas cache
+ * @param msgBundleId
+ * the msg bundle id
+ * @param container
+ * the container
+ * @param processor
+ * the processor
+ * @param casCache
+ * the cas cache
*/
- private void maybeLogFinest(String msgBundleId, ProcessingContainer container, CasProcessor processor, CAS [] casCache) {
+ private void maybeLogFinest(String msgBundleId, ProcessingContainer container,
+ CasProcessor processor, CAS[] casCache) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
logFinest(msgBundleId, container.getName(), processor.getClass().getName(),
- String.valueOf(casCache == null));
+ String.valueOf(casCache == null));
}
}
-
+
/**
* Maybe log finest.
*
- * @param msgBundleId the msg bundle id
- * @param casCache the cas cache
+ * @param msgBundleId
+ * the msg bundle id
+ * @param casCache
+ * the cas cache
*/
- private void maybeLogFinest(String msgBundleId, CAS [] casCache) {
+ private void maybeLogFinest(String msgBundleId, CAS[] casCache) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
logFinest(msgBundleId, String.valueOf(casCache == null));
}
}
-
/**
* Maybe log memory finest.
*/
@@ -2607,20 +2694,21 @@
logMemoryFinest();
}
}
-
+
/**
* Log memory finest.
*/
private void logMemoryFinest() {
- logFinest("UIMA_CPM_show_memory__FINEST",
- String.valueOf(Runtime.getRuntime().totalMemory() / 1024),
- String.valueOf(Runtime.getRuntime().freeMemory() / 1024));
+ logFinest("UIMA_CPM_show_memory__FINEST",
+ String.valueOf(Runtime.getRuntime().totalMemory() / 1024),
+ String.valueOf(Runtime.getRuntime().freeMemory() / 1024));
}
/**
* Log warning.
*
- * @param msgBundleId the msg bundle id
+ * @param msgBundleId
+ * the msg bundle id
*/
private void logWarning(String msgBundleId) {
logCPM(Level.WARNING, msgBundleId, null);
@@ -2629,31 +2717,38 @@
/**
* Maybe log warning.
*
- * @param msgBundleId the msg bundle id
- * @param arg1 the arg 1
- * @param arg2 the arg 2
+ * @param msgBundleId
+ * the msg bundle id
+ * @param arg1
+ * the arg 1
+ * @param arg2
+ * the arg 2
*/
private void maybeLogWarning(String msgBundleId, String arg1, String arg2) {
if (UIMAFramework.getLogger().isLoggable(Level.WARNING)) {
logWarning(msgBundleId, arg1, arg2);
}
}
-
+
/**
* Log warning.
*
- * @param msgBundleId the msg bundle id
- * @param arg1 the arg 1
- * @param arg2 the arg 2
+ * @param msgBundleId
+ * the msg bundle id
+ * @param arg1
+ * the arg 1
+ * @param arg2
+ * the arg 2
*/
private void logWarning(String msgBundleId, String arg1, String arg2) {
- logCPM(Level.WARNING, msgBundleId, new Object [] {arg1, arg2});
+ logCPM(Level.WARNING, msgBundleId, new Object[] { arg1, arg2 });
}
-
+
/**
* Maybe log severe.
*
- * @param msgBundleId the msg bundle id
+ * @param msgBundleId
+ * the msg bundle id
*/
private void maybeLogSevere(String msgBundleId) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
@@ -2661,97 +2756,117 @@
}
}
-
/**
* Maybe log severe.
*
- * @param msgBundleId the msg bundle id
- * @param arg1 the arg 1
+ * @param msgBundleId
+ * the msg bundle id
+ * @param arg1
+ * the arg 1
*/
private void maybeLogSevere(String msgBundleId, String arg1) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
logSevere(msgBundleId, arg1);
}
}
-
+
/**
* Log severe.
*
- * @param msgBundleId the msg bundle id
- * @param arg1 the arg 1
+ * @param msgBundleId
+ * the msg bundle id
+ * @param arg1
+ * the arg 1
*/
private void logSevere(String msgBundleId, String arg1) {
- logCPM(Level.SEVERE, msgBundleId, new Object[] {arg1});
+ logCPM(Level.SEVERE, msgBundleId, new Object[] { arg1 });
}
-
/**
* Maybe log severe.
*
- * @param msgBundleId the msg bundle id
- * @param arg1 the arg 1
- * @param arg2 the arg 2
+ * @param msgBundleId
+ * the msg bundle id
+ * @param arg1
+ * the arg 1
+ * @param arg2
+ * the arg 2
*/
private void maybeLogSevere(String msgBundleId, String arg1, String arg2) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
logSevere(msgBundleId, arg1, arg2);
}
}
-
+
/**
* Log severe.
*
- * @param msgBundleId the msg bundle id
- * @param arg1 the arg 1
- * @param arg2 the arg 2
+ * @param msgBundleId
+ * the msg bundle id
+ * @param arg1
+ * the arg 1
+ * @param arg2
+ * the arg 2
*/
private void logSevere(String msgBundleId, String arg1, String arg2) {
- logCPM(Level.SEVERE, msgBundleId, new Object[] {arg1, arg2});
+ logCPM(Level.SEVERE, msgBundleId, new Object[] { arg1, arg2 });
}
/**
* Maybe log severe.
*
- * @param msgBundleId the msg bundle id
- * @param arg1 the arg 1
- * @param arg2 the arg 2
- * @param arg3 the arg 3
+ * @param msgBundleId
+ * the msg bundle id
+ * @param arg1
+ * the arg 1
+ * @param arg2
+ * the arg 2
+ * @param arg3
+ * the arg 3
*/
private void maybeLogSevere(String msgBundleId, String arg1, String arg2, String arg3) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
logSevere(msgBundleId, arg1, arg2, arg3);
}
}
-
+
/**
* Log severe.
*
- * @param msgBundleId the msg bundle id
- * @param arg1 the arg 1
- * @param arg2 the arg 2
- * @param arg3 the arg 3
+ * @param msgBundleId
+ * the msg bundle id
+ * @param arg1
+ * the arg 1
+ * @param arg2
+ * the arg 2
+ * @param arg3
+ * the arg 3
*/
private void logSevere(String msgBundleId, String arg1, String arg2, String arg3) {
- logCPM(Level.SEVERE, msgBundleId, new Object[] {arg1, arg2, arg3});
+ logCPM(Level.SEVERE, msgBundleId, new Object[] { arg1, arg2, arg3 });
}
-
+
/**
* Maybe log severe exception.
*
- * @param e the e
+ * @param e
+ * the e
*/
private void maybeLogSevereException(Throwable e) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
- String m = "Thread: " + Thread.currentThread().getName() + ", message: " + e.getLocalizedMessage();
+ String m = "Thread: " + Thread.currentThread().getName() + ", message: "
+ + e.getLocalizedMessage();
UIMAFramework.getLogger().log(Level.SEVERE, m, e);
}
}
-
+
/**
* Maybe log finest work queue.
*
- * @param msgBundleId the msg bundle id
- * @param workQueue the work queue
+ * @param msgBundleId
+ * the msg bundle id
+ * @param workQueue
+ * the work queue
*/
private void maybeLogFinestWorkQueue(String msgBundleId, BoundedWorkQueue workQueue) {
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/SequencedQueue.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/SequencedQueue.java
index 0b6fdfb..e0a5c30 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/SequencedQueue.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/SequencedQueue.java
@@ -32,7 +32,6 @@
import org.apache.uima.collection.impl.cpm.utils.ExpirationTimer;
import org.apache.uima.util.Level;
-
/**
* This component extends the Bound Queue by guaranteeing delivery of CASes in sequential order.
* Large documents may be split into smaller chunks and and each is processed asynchronously. Since
@@ -44,7 +43,7 @@
* chunk. If the timer goes off, the entire document ( and all its CASes) are invalidated.
*/
public class SequencedQueue extends BoundedWorkQueue {
-
+
/** The chunk state. */
private boolean chunkState = false; // if a CAS is part of a larger sequence
@@ -60,12 +59,12 @@
/**
* Initialize this queue.
*
- * @param aQueueSize -
- * the size of the queue
- * @param aQueueName -
- * the name of the queue
- * @param aCpmEngine -
- * reference to the CPE
+ * @param aQueueSize
+ * - the size of the queue
+ * @param aQueueName
+ * - the name of the queue
+ * @param aCpmEngine
+ * - reference to the CPE
*/
public SequencedQueue(int aQueueSize, String aQueueName, CPMEngine aCpmEngine) {
super(aQueueSize, aQueueName, aCpmEngine);
@@ -75,12 +74,14 @@
/**
* Sequence timed out.
*
- * @param achunkMetadata the achunk metadata
+ * @param achunkMetadata
+ * the achunk metadata
* @return true if it timed out
*/
private boolean sequenceTimedOut(ChunkMetadata achunkMetadata) {
- boolean returnVal = (achunkMetadata != null && timedOutDocs.get(achunkMetadata.getDocId()) != null);
+ boolean returnVal = (achunkMetadata != null
+ && timedOutDocs.get(achunkMetadata.getDocId()) != null);
return returnVal;
}
@@ -88,11 +89,11 @@
* Returns a CAS that belong to a timedout chunk sequence. It wraps the CAS in QueueEntity and
* indicates that the CAS arrived late.
*
- * This must be called while holding the class lock (e.g. via synch on the calling methods
- * within this class).
+ * This must be called while holding the class lock (e.g. via synch on the calling methods within
+ * this class).
*
- * @param aQueueIndex -
- * position in queue from the CAS should be extracted
+ * @param aQueueIndex
+ * - position in queue from the CAS should be extracted
*
* @return QueueEntity containing CAS that arrived late
*/
@@ -144,14 +145,10 @@
int chunkSequence = nextChunkMetadata.getSequence() + 1;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_expected_chunk_sequenece__FINEST",
- new Object[] { Thread.currentThread().getName(), getName(),
- String.valueOf(chunkSequence) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_expected_chunk_sequenece__FINEST", new Object[] {
+ Thread.currentThread().getName(), getName(), String.valueOf(chunkSequence) });
}
try {
// This does not remove the object from the queue
@@ -174,8 +171,8 @@
if (anObject instanceof WorkUnit && ((WorkUnit) anObject).get() instanceof CAS[]) {
// Create metadata from the CAS. This convenience object is used internally and keeps
// track of the last chunks sequence processed here
- ChunkMetadata chunkMetadata = CPMUtils.getChunkMetadata(((CAS[]) ((WorkUnit) anObject)
- .get())[0]);
+ ChunkMetadata chunkMetadata = CPMUtils
+ .getChunkMetadata(((CAS[]) ((WorkUnit) anObject).get())[0]);
// Chunking is not strictly required. In such cases the sequence metadata will not be in
// the CAS and thus there is no ChunkMetaData
if (chunkMetadata == null) {
@@ -200,11 +197,8 @@
// if the current CAS is part of a larger chunk sequence.
if (chunkMetadata.isOneOfMany() && sequenceTimedOut(chunkMetadata)) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_sequence_timed_out__FINEST",
new Object[] { Thread.currentThread().getName(), getName(),
String.valueOf(chunkMetadata.getSequence()) });
@@ -220,11 +214,8 @@
// been "chopped" up into smaller chunks.
if (chunkState) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_in_chunk_state__FINEST",
new Object[] { Thread.currentThread().getName(), getName(),
nextChunkMetadata.getDocId(), chunkMetadata.getDocId(),
@@ -282,11 +273,8 @@
chunkState = true;
if (chunkMetadata.getSequence() == chunkSequence) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_in_chunk_state__FINEST",
new Object[] { Thread.currentThread().getName(), getName(),
nextChunkMetadata.getDocId(), chunkMetadata.getDocId(),
@@ -296,11 +284,8 @@
if (sequenceTimedOut(chunkMetadata)) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
"UIMA_CPM_sequence_timed_out__FINEST",
new Object[] { Thread.currentThread().getName(), getName(),
String.valueOf(chunkMetadata.getSequence()) });
@@ -330,14 +315,10 @@
}
} else {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_not_cas__FINEST",
- new Object[] { Thread.currentThread().getName(), getName(),
- anObject.getClass().getName() });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST,
+ this.getClass().getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_not_cas__FINEST", new Object[] { Thread.currentThread().getName(),
+ getName(), anObject.getClass().getName() });
}
break;
}
@@ -365,14 +346,10 @@
if (queueIndex == queueSize) {
if (chunkSequence > 0) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_expecte_seq_not_found__FINEST",
- new Object[] { Thread.currentThread().getName(), getName(),
- String.valueOf(queue.size()) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_expecte_seq_not_found__FINEST", new Object[] {
+ Thread.currentThread().getName(), getName(), String.valueOf(queue.size()) });
}
// Reset expected sequence to the same number. The caller most likely will sleep for awhile
// and retry. During the retry we need to
@@ -381,14 +358,10 @@
false);
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_expecte_seq_not_found__FINEST",
- new Object[] { Thread.currentThread().getName(), getName(),
- String.valueOf(queue.size()) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_expecte_seq_not_found__FINEST", new Object[] {
+ Thread.currentThread().getName(), getName(), String.valueOf(queue.size()) });
}
// Return null to indicate the expected CAS was not found. It is the responsibility of the
// caller to wait and invoke this method again.
@@ -402,14 +375,10 @@
numberElementsInQueue--;
notifyAll();
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_queue_capacity__FINEST",
- new Object[] { Thread.currentThread().getName(), getName(),
- String.valueOf(queueSize), String.valueOf(numberElementsInQueue) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_show_queue_capacity__FINEST",
+ new Object[] { Thread.currentThread().getName(), getName(), String.valueOf(queueSize),
+ String.valueOf(numberElementsInQueue) });
}
return anObject;
}
@@ -418,8 +387,8 @@
* Returns an object from the queue. It will wait for the object to show up in the queue until a
* given timer expires.
*
- * @param aTimeout -
- * max millis to wait for an object
+ * @param aTimeout
+ * - max millis to wait for an object
*
* @return - Object from the queue, or null if time out
*/
@@ -427,9 +396,9 @@
public synchronized Object dequeue(long aTimeout) {
Object resource = null;
long startTime = System.currentTimeMillis();
- // add 1 for rounding issues. Should really add the smallest incr unit, which might be
- // > 1... Java docs say it could be 10...
- long expireTime = (aTimeout == 0)? Long.MAX_VALUE : startTime + aTimeout + 1;
+ // add 1 for rounding issues. Should really add the smallest incr unit, which might be
+ // > 1... Java docs say it could be 10...
+ long expireTime = (aTimeout == 0) ? Long.MAX_VALUE : startTime + aTimeout + 1;
while ((resource = dequeue()) == null) {
try {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
@@ -464,30 +433,22 @@
doNotifyListeners(null, enProcSt);
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_chunk_didnt_arrive__FINEST",
- new Object[] { Thread.currentThread().getName(), getName(),
- String.valueOf(aTimeout) });
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_chunk_didnt_arrive__FINEST", new Object[] {
+ Thread.currentThread().getName(), getName(), String.valueOf(aTimeout) });
}
chunkState = false;
nextChunkMetadata = new ChunkMetadata("", 0, false);
// Timeout
return null;
- }
- else break;
+ } else
+ break;
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(this.getClass()).logrb(
- Level.FINEST,
- this.getClass().getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_return_chunk__FINEST",
+ UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
+ "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_return_chunk__FINEST",
new Object[] { Thread.currentThread().getName(), getName(),
String.valueOf(queueMaxSize), String.valueOf(numberElementsInQueue) });
}
@@ -495,8 +456,12 @@
return resource;
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.impl.cpm.engine.BoundedWorkQueue#invalidate(org.apache.uima.cas.CAS[])
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.impl.cpm.engine.BoundedWorkQueue#invalidate(org.apache.uima.cas.CAS[
+ * ])
*/
@Override
public synchronized void invalidate(CAS[] aCasObjectList) {
@@ -519,8 +484,10 @@
/**
* Adds the doc to timed out docs.
*
- * @param aLifespan the a lifespan
- * @param aDocId the a doc id
+ * @param aLifespan
+ * the a lifespan
+ * @param aDocId
+ * the a doc id
*/
private void addDocToTimedOutDocs(int aLifespan, String aDocId) {
// The expected chunk sequence did not arrive within given window. Create a timer
@@ -539,20 +506,20 @@
* Notifies all configured listeners. Makes sure that appropriate type of Cas is sent to the
* listener. Conversions take place to ensure compatibility.
*
- * @param aCas -
- * Cas to pass to listener
- * @param aEntityProcStatus -
- * status object containing exceptions and trace info
+ * @param aCas
+ * - Cas to pass to listener
+ * @param aEntityProcStatus
+ * - status object containing exceptions and trace info
*/
protected void doNotifyListeners(Object aCas, EntityProcessStatus aEntityProcStatus) {
// Notify Listener that the entity has been processed
- CAS casObjectCopy = (CAS)aCas;
+ CAS casObjectCopy = (CAS) aCas;
// Notify ALL listeners
for (int j = 0; j < statusCbL.size(); j++) {
StatusCallbackListener statCL = (StatusCallbackListener) statusCbL.get(j);
CPMEngine.callEntityProcessCompleteWithCAS(statCL, casObjectCopy, aEntityProcStatus);
-// ((StatusCallbackListener) statCL).entityProcessComplete((CAS) casObjectCopy,
-// aEntityProcStatus);
+ // ((StatusCallbackListener) statCL).entityProcessComplete((CAS) casObjectCopy,
+ // aEntityProcStatus);
}
}
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/WorkUnit.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/WorkUnit.java
index 411e352..21e0f16 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/WorkUnit.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/engine/WorkUnit.java
@@ -21,13 +21,11 @@
import org.apache.uima.cas.CAS;
-
-
/**
* The Class WorkUnit.
*/
public class WorkUnit {
-
+
/** The payload. */
private Object payload = null;
@@ -37,11 +35,11 @@
/** The timedout. */
private boolean timedout = false;
-
/**
* Instantiates a new work unit.
*
- * @param aPayload the a payload
+ * @param aPayload
+ * the a payload
*/
public WorkUnit(Object aPayload) {
payload = aPayload;
@@ -59,7 +57,8 @@
/**
* Sets the cas.
*
- * @param aCas the new cas
+ * @param aCas
+ * the new cas
*/
public void setCas(CAS[] aCas) {
cas = aCas;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/CPMUtils.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/CPMUtils.java
index f4cc78a..3722d90 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/CPMUtils.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/CPMUtils.java
@@ -42,12 +42,11 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-
/**
* The Class CPMUtils.
*/
public class CPMUtils {
-
+
/** The Constant CPM_LOG_RESOURCE_BUNDLE. */
public static final String CPM_LOG_RESOURCE_BUNDLE = "org.apache.uima.collection.impl.cpm.cpm_messages";
@@ -57,14 +56,16 @@
/**
* Currently, this returns initialized array of Strings.
*
- * @param aKeyDropMapFile -
- * a file containing a list of features that should be removed from CAS being sent to Cas
- * Processor. Currently not used.
+ * @param aKeyDropMapFile
+ * - a file containing a list of features that should be removed from CAS being sent to
+ * Cas Processor. Currently not used.
*
* @return - Array of empty Strings
- * @throws ResourceConfigurationException -
+ * @throws ResourceConfigurationException
+ * -
*/
- public static String[] getKeys2Drop(String aKeyDropMapFile) throws ResourceConfigurationException {
+ public static String[] getKeys2Drop(String aKeyDropMapFile)
+ throws ResourceConfigurationException {
return new String[] { "", "" };
}
@@ -72,7 +73,8 @@
/**
* Sets the timer.
*
- * @param aTimer the new timer
+ * @param aTimer
+ * the new timer
*/
public static void setTimer(UimaTimer aTimer) {
timer = aTimer;
@@ -90,12 +92,16 @@
/**
* Convert to absolute path.
*
- * @param aSystemVar the a system var
- * @param aExpr the a expr
- * @param aPathToConvert the a path to convert
+ * @param aSystemVar
+ * the a system var
+ * @param aExpr
+ * the a expr
+ * @param aPathToConvert
+ * the a path to convert
* @return absolute path
*/
- public static String convertToAbsolutePath(String aSystemVar, String aExpr, String aPathToConvert) {
+ public static String convertToAbsolutePath(String aSystemVar, String aExpr,
+ String aPathToConvert) {
if (aPathToConvert == null || aSystemVar == null || !aPathToConvert.startsWith(aExpr)) {
return aPathToConvert;
}
@@ -106,9 +112,11 @@
* Return timer to measure performace of the cpm. The timer can optionally be configured in the
* CPE descriptor. If none defined, the method returns default timer.
*
- * @param aTimerClass the a timer class
+ * @param aTimerClass
+ * the a timer class
* @return - customer timer or JavaTimer (default)
- * @throws Exception -
+ * @throws Exception
+ * -
*/
public static UimaTimer getTimer(String aTimerClass) throws Exception {
if (aTimerClass != null) {
@@ -122,10 +130,10 @@
/**
* Returns the total duration of a given event.
*
- * @param aPT -
- * Event container
- * @param eventName -
- * name of the event for which the time is needed
+ * @param aPT
+ * - Event container
+ * @param eventName
+ * - name of the event for which the time is needed
* @return - total duration of an event
*/
public synchronized static long extractTime(ProcessTrace aPT, String eventName) {
@@ -153,8 +161,8 @@
/**
* Dumps all events in the process trace object.
*
- * @param aPTr -
- * event container
+ * @param aPTr
+ * - event container
*/
public static void dumpEvents(ProcessTrace aPTr) {
List aList = aPTr.getEvents();
@@ -163,8 +171,7 @@
String aEvType = prEvent.getType();
if (System.getProperty("DEBUG_EVENTS") != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(CPMUtils.class).log(
- Level.FINEST,
+ UIMAFramework.getLogger(CPMUtils.class).log(Level.FINEST,
"Returning Report With Event::" + aEvType + " For Component:::"
+ prEvent.getComponentName() + " Duration:::"
+ prEvent.getDurationExcludingSubEvents());
@@ -178,7 +185,8 @@
* Finds an occurance of the ##CPM_HOME in a value parameter and returns it with an expanded form
* (ie.c:/cpm/...) based on the env variable CPM_HOME.
*
- * @param value the value
+ * @param value
+ * the value
* @return the string
*/
public static String scrubThePath(String value) {
@@ -195,9 +203,11 @@
/**
* Finds a node with a given path and returns its textual value.
*
- * @param aNode the a node
+ * @param aNode
+ * the a node
* @return textual value of a node indicated in the XPath path
- * @exception Exception the exception
+ * @exception Exception
+ * the exception
*/
private static String extractText(Node aNode) throws Exception {
String text = null;
@@ -217,9 +227,11 @@
/**
* Gets the configurable feature.
*
- * @param entityNode the entity node
+ * @param entityNode
+ * the entity node
* @return a configurable feature
- * @throws ConfigurationException -
+ * @throws ConfigurationException
+ * -
*/
private static ConfigurableFeature getConfigurableFeature(Node entityNode)
throws ConfigurationException // SITHException
@@ -255,8 +267,8 @@
/**
* Returns text associated with TEXT_NODE element.
*
- * @param aList -
- * list of elements
+ * @param aList
+ * - list of elements
* @return - Text
*/
private static String getTextValue(NodeList aList) {
@@ -272,9 +284,11 @@
/**
* Gets the features.
*
- * @param attributesNode the attributes node
+ * @param attributesNode
+ * the attributes node
* @return a list of features
- * @throws ConfigurationException -
+ * @throws ConfigurationException
+ * -
*/
private static ArrayList getFeatures(Node attributesNode) throws ConfigurationException {
ArrayList attributeList = new ArrayList();
@@ -316,15 +330,17 @@
/**
* Find deploy directory.
*
- * @param aServiceName the a service name
+ * @param aServiceName
+ * the a service name
* @return the deploy directory
- * @throws Exception -
+ * @throws Exception
+ * -
*/
public static File findDeployDirectory(String aServiceName) throws Exception {
if (aServiceName == null) {
throw new Exception(CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_service_not_defined__WARNING", new Object[] {
- Thread.currentThread().getName(), "NULL" }));
+ "UIMA_CPM_EXP_service_not_defined__WARNING",
+ new Object[] { Thread.currentThread().getName(), "NULL" }));
}
File[] dirList = getDirectories();
@@ -352,7 +368,8 @@
* Gets the directories.
*
* @return an array of directories
- * @throws Exception -
+ * @throws Exception
+ * -
*/
private static File[] getDirectories() throws Exception {
String rootPath = System.getProperty("CPM_HOME");
@@ -362,8 +379,8 @@
File rootDir = new File(rootPath, appRoot);
if (rootDir.isDirectory() == false) {
throw new Exception(CpmLocalizedMessage.getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_not_directory__WARNING", new Object[] {
- Thread.currentThread().getName(), appRoot }));
+ "UIMA_CPM_EXP_not_directory__WARNING",
+ new Object[] { Thread.currentThread().getName(), appRoot }));
}
String[] list = rootDir.list();
String currentFile;
@@ -371,8 +388,8 @@
File aFile = null;
for (int i = 0; i < list.length; i++) {
currentFile = list[i];
- aFile = new File(rootDir.getAbsolutePath() + System.getProperty("file.separator")
- + currentFile);
+ aFile = new File(
+ rootDir.getAbsolutePath() + System.getProperty("file.separator") + currentFile);
if (aFile.isDirectory()) {
dirList.add(aFile);
}
@@ -386,11 +403,15 @@
/**
* Gets the feature as int.
*
- * @param aCas the a cas
- * @param aFeature the a feature
- * @param aName the a name
+ * @param aCas
+ * the a cas
+ * @param aFeature
+ * the a feature
+ * @param aName
+ * the a name
* @return the feature as int
- * @throws Exception the exception
+ * @throws Exception
+ * the exception
*/
public static int getFeatureAsInt(CAS aCas, Feature aFeature, String aName) throws Exception {
Feature seqNo2 = aFeature.getRange().getFeatureByBaseName(aName);
@@ -402,14 +423,15 @@
/**
* Returns a value associated with a given feature.
*
- * @param aCas -
- * Cas containing data to extract
- * @param aFeature -
- * feature to locate in the CAS
- * @param aName -
- * name of the feature
+ * @param aCas
+ * - Cas containing data to extract
+ * @param aFeature
+ * - feature to locate in the CAS
+ * @param aName
+ * - name of the feature
* @return - value as String
- * @throws Exception the exception
+ * @throws Exception
+ * the exception
*/
public static String getFeatureAsString(CAS aCas, Feature aFeature, String aName)
throws Exception {
@@ -423,13 +445,13 @@
/**
* Extract metadata associated with chunk from a given CAS.
*
- * @param aCas -
- * Cas to extract chunk metadata from
+ * @param aCas
+ * - Cas to extract chunk metadata from
* @return - chunk metadata
*/
public static synchronized ChunkMetadata getChunkMetadata(CAS aCas) {
- Feature feat = aCas.getTypeSystem().getFeatureByFullName(
- "uima.tcas.DocumentAnnotation:esDocumentMetaData");
+ Feature feat = aCas.getTypeSystem()
+ .getFeatureByFullName("uima.tcas.DocumentAnnotation:esDocumentMetaData");
if (feat != null) {
try {
int sequenceNo = getFeatureAsInt(aCas, feat, ChunkMetadata.SEQUENCE); // "sequenceNumber");
@@ -438,8 +460,7 @@
String throttleID = getFeatureAsString(aCas, feat, ChunkMetadata.THROTTLEID); // "isCompleted");
String url = getFeatureAsString(aCas, feat, ChunkMetadata.DOCUMENTURL); // "isCompleted");
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(CPMUtils.class).log(
- Level.FINEST,
+ UIMAFramework.getLogger(CPMUtils.class).log(Level.FINEST,
Thread.currentThread().getName() + "===========================>SeqNo::"
+ sequenceNo + " docId::" + docId + " isComplete::" + isCompleted
+ " ThrottleID:" + throttleID + " Document URL:" + url);
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/CasMetaData.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/CasMetaData.java
index 25d607c..46614d6 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/CasMetaData.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/CasMetaData.java
@@ -28,7 +28,6 @@
import org.apache.uima.resource.metadata.NameValuePair;
import org.apache.uima.util.Level;
-
/**
* The Class CasMetaData.
*/
@@ -46,7 +45,8 @@
/**
* Sets the cas meta data.
*
- * @param aCas the new cas meta data
+ * @param aCas
+ * the new cas meta data
*/
public void setCasMetaData(Object aCas) {
if (aCas != null && aCas instanceof CasData) {
@@ -76,7 +76,8 @@
/**
* Gets the value.
*
- * @param aName the a name
+ * @param aName
+ * the a name
* @return the value
*/
public Object getValue(String aName) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ChunkMetadata.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ChunkMetadata.java
index 69a90dc..73fb653 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ChunkMetadata.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ChunkMetadata.java
@@ -19,13 +19,12 @@
package org.apache.uima.collection.impl.cpm.utils;
-
/**
* Convenience class that is used to hold metadata associated with chunking and sequencing of
* documents. It allows the OutputQueue to manage sequencing of chunks destined for the CasConsumer.
*/
public class ChunkMetadata {
-
+
/** The Constant SEQUENCE. */
public static final String SEQUENCE = "sequenceNumber";
@@ -59,13 +58,15 @@
/** The throttle ID. */
private String throttleID;
-
/**
* Instantiates a new chunk metadata.
*
- * @param aDocId the a doc id
- * @param aSequence the a sequence
- * @param aLast the a last
+ * @param aDocId
+ * the a doc id
+ * @param aSequence
+ * the a sequence
+ * @param aLast
+ * the a last
*/
public ChunkMetadata(String aDocId, int aSequence, boolean aLast) {
docId = aDocId;
@@ -139,7 +140,8 @@
/**
* Sets the timed out.
*
- * @param b true means timed out
+ * @param b
+ * true means timed out
*/
public void setTimedOut(boolean b) {
timedOut = b;
@@ -148,7 +150,8 @@
/**
* Sets the throttle ID.
*
- * @param aThrottleID the new throttle ID
+ * @param aThrottleID
+ * the new throttle ID
*/
public void setThrottleID(String aThrottleID) {
throttleID = aThrottleID;
@@ -157,7 +160,8 @@
/**
* Sets the url.
*
- * @param aURL the new url
+ * @param aURL
+ * the new url
*/
public void setURL(String aURL) {
url = aURL;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ConfigurableFeature.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ConfigurableFeature.java
index bc6fdf9..c8d79b2 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ConfigurableFeature.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ConfigurableFeature.java
@@ -21,12 +21,11 @@
import java.util.ArrayList;
-
/**
* The Class ConfigurableFeature.
*/
public class ConfigurableFeature {
-
+
/** The value. */
private ValuePair value;
@@ -36,8 +35,10 @@
/**
* Instantiates a new configurable feature.
*
- * @param oldV the old V
- * @param newV the new V
+ * @param oldV
+ * the old V
+ * @param newV
+ * the new V
*/
public ConfigurableFeature(String oldV, String newV) {
value = new ValuePair(oldV, newV);
@@ -64,7 +65,8 @@
/**
* Adds the attribute.
*
- * @param value the value
+ * @param value
+ * the value
*/
public void addAttribute(ValuePair value) {
attributeList.add(value);
@@ -73,7 +75,8 @@
/**
* Adds the attributes.
*
- * @param attList the att list
+ * @param attList
+ * the att list
*/
public void addAttributes(ArrayList attList) {
attributeList = attList;
@@ -82,7 +85,8 @@
/**
* Gets the old attribute value.
*
- * @param index the index
+ * @param index
+ * the index
* @return the old attribute value
*/
public String getOldAttributeValue(int index) {
@@ -95,7 +99,8 @@
/**
* Gets the old attribute value.
*
- * @param key the key
+ * @param key
+ * the key
* @return the old attribute value
*/
public String getOldAttributeValue(String key) {
@@ -110,7 +115,8 @@
/**
* Gets the new attribute value.
*
- * @param index the index
+ * @param index
+ * the index
* @return the new attribute value
*/
public String getNewAttributeValue(int index) {
@@ -123,7 +129,8 @@
/**
* Gets the new attribute value.
*
- * @param key the key
+ * @param key
+ * the key
* @return the new attribute value
*/
public String getNewAttributeValue(String key) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/CpmLocalizedMessage.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/CpmLocalizedMessage.java
index a014a94..c6ab362 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/CpmLocalizedMessage.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/CpmLocalizedMessage.java
@@ -23,7 +23,6 @@
import java.util.Locale;
import java.util.ResourceBundle;
-
/**
* The Class CpmLocalizedMessage.
*/
@@ -32,9 +31,12 @@
/**
* Gets the localized message.
*
- * @param aResourceBundleName the a resource bundle name
- * @param aMessageKey the a message key
- * @param aArguments the a arguments
+ * @param aResourceBundleName
+ * the a resource bundle name
+ * @param aMessageKey
+ * the a message key
+ * @param aArguments
+ * the a arguments
* @return the localized message
*/
public static String getLocalizedMessage(String aResourceBundleName, String aMessageKey,
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/Execute.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/Execute.java
index a6232ee..575f9e8 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/Execute.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/Execute.java
@@ -19,21 +19,19 @@
package org.apache.uima.collection.impl.cpm.utils;
-
/**
* Contains command line and environment for launching a separate process.
*
*
*/
public class Execute {
-
+
/** The environment. */
private String[] environment;
/** The cmd line. */
private String[] cmdLine;
-
/**
* Instantiates a new execute.
*/
@@ -61,8 +59,8 @@
/**
* Copies Cas Processor command line.
*
- * @param strings -
- * command line
+ * @param strings
+ * - command line
*/
public void setCmdLine(String[] strings) {
cmdLine = strings;
@@ -71,7 +69,8 @@
/**
* Copies Cas Processor environment.
*
- * @param strings the new environment
+ * @param strings
+ * the new environment
*/
public void setEnvironment(String[] strings) {
environment = strings;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ExpirationTimer.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ExpirationTimer.java
index 3f5f1f6..dfb212b 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ExpirationTimer.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ExpirationTimer.java
@@ -25,13 +25,12 @@
import org.apache.uima.collection.impl.cpm.engine.CPMEngine;
import org.apache.uima.util.Level;
-
/**
* Facilitates cleaning up resources associated with chunking/sequencing logic.
*
*/
public class ExpirationTimer extends Thread {
-
+
/** The time out. */
private final long timeOut;
@@ -48,10 +47,14 @@
* Constructs a Timer that expires after a given interval. It keeps the map from growing
* indefinitely. Its main purpose is to remove entries from a given map using a provided key.
*
- * @param aTimeout the a timeout
- * @param aMap the a map
- * @param aKey the a key
- * @param aCpm the a cpm
+ * @param aTimeout
+ * the a timeout
+ * @param aMap
+ * the a map
+ * @param aKey
+ * the a key
+ * @param aCpm
+ * the a cpm
*/
public ExpirationTimer(long aTimeout, HashMap aMap, String aKey, CPMEngine aCpm) {
timeOut = aTimeout;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/FeatureMap.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/FeatureMap.java
index 3fabfea..590d42d 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/FeatureMap.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/FeatureMap.java
@@ -21,12 +21,11 @@
import java.util.ArrayList;
-
/**
* The Class FeatureMap.
*/
public class FeatureMap {
-
+
/** The entities. */
ArrayList entities = null;
@@ -40,7 +39,8 @@
/**
* Adds the.
*
- * @param entity the entity
+ * @param entity
+ * the entity
*/
public void add(ConfigurableFeature entity) {
entities.add(entity);
@@ -49,7 +49,8 @@
/**
* Gets the.
*
- * @param index the index
+ * @param index
+ * the index
* @return the configurable feature
*/
public ConfigurableFeature get(int index) {
@@ -63,7 +64,8 @@
/**
* Gets the.
*
- * @param key the key
+ * @param key
+ * the key
* @return the configurable feature
*/
public ConfigurableFeature get(String key) {
@@ -77,7 +79,8 @@
/**
* Contains.
*
- * @param key the key
+ * @param key
+ * the key
* @return true, if successful
*/
public boolean contains(String key) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/Filter.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/Filter.java
index a121d3a..cb19b6c 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/Filter.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/Filter.java
@@ -27,12 +27,11 @@
import org.apache.uima.UIMAFramework;
import org.apache.uima.util.Level;
-
/**
* Parses the filter expression associated with a Cas Processor in the cpe descriptor.
*/
public class Filter {
-
+
/** The stack. */
Stack stack = new Stack();
@@ -51,10 +50,11 @@
/**
* Parses filter expression.
*
- * @param expression -
- * filter expression to parse
+ * @param expression
+ * - filter expression to parse
* @return - list of filters
- * @throws ParseException -
+ * @throws ParseException
+ * -
*/
public LinkedList parse(String expression) throws ParseException {
StringTokenizer tokenizer = new StringTokenizer(expression, " !=", true);
@@ -85,9 +85,10 @@
/**
* Parses tokens.
*
- * @param aTokenizer -
- * tokenized filter expression
- * @throws ParseException -
+ * @param aTokenizer
+ * - tokenized filter expression
+ * @throws ParseException
+ * -
*/
private void parseTokens(StringTokenizer aTokenizer) throws ParseException {
boolean leftPartInStack = false;
@@ -129,8 +130,10 @@
/**
* Builds filter expression from values from the stack.
*
- * @param anOp the an op
- * @throws ParseException -
+ * @param anOp
+ * the an op
+ * @throws ParseException
+ * -
*/
private void evaluate(String anOp) throws ParseException {
Expression ex = new Expression(this);
@@ -166,14 +169,15 @@
* Operand.
*/
public class Operand {
-
+
/** The operand. */
private String operand;
/**
* Instantiates a new operand.
*
- * @param aOp the a op
+ * @param aOp
+ * the a op
*/
public Operand(String aOp) {
operand = aOp;
@@ -193,14 +197,15 @@
* Left part of filter expression.
*/
public class LeftPart {
-
+
/** The left part. */
private String leftPart;
/**
* Instantiates a new left part.
*
- * @param aLPart the a L part
+ * @param aLPart
+ * the a L part
*/
public LeftPart(String aLPart) {
leftPart = aLPart;
@@ -220,14 +225,15 @@
* Right part of the filter expression.
*/
public class RightPart {
-
+
/** The right part. */
private String rightPart;
/**
* Instantiates a new right part.
*
- * @param aRPart the a R part
+ * @param aRPart
+ * the a R part
*/
public RightPart(String aRPart) {
rightPart = aRPart;
@@ -247,7 +253,7 @@
* Object containing single filter.
*/
public class Expression {
-
+
/** The l P. */
private LeftPart lP;
@@ -263,7 +269,8 @@
/**
* Instantiates a new expression.
*
- * @param aFilter the a filter
+ * @param aFilter
+ * the a filter
*/
public Expression(Filter aFilter) {
filter = aFilter;
@@ -272,7 +279,8 @@
/**
* Sets the is or filter.
*
- * @throws ParseException the parse exception
+ * @throws ParseException
+ * the parse exception
*/
protected void setIsOrFilter() throws ParseException {
// Already defined as AND filter. Currently filtering is either AND or OR. No mixing is
@@ -289,7 +297,8 @@
/**
* Sets the is and filter.
*
- * @throws ParseException the parse exception
+ * @throws ParseException
+ * the parse exception
*/
protected void setIsAndFilter() throws ParseException {
// Already defined as OR filter. Currently filtering is either AND or OR. No mixing is
@@ -324,7 +333,8 @@
/**
* Sets the left part.
*
- * @param aLP the new left part
+ * @param aLP
+ * the new left part
*/
public void setLeftPart(LeftPart aLP) {
lP = aLP;
@@ -333,7 +343,8 @@
/**
* Sets the right part.
*
- * @param aRP the new right part
+ * @param aRP
+ * the new right part
*/
public void setRightPart(RightPart aRP) {
rP = aRP;
@@ -342,7 +353,8 @@
/**
* Sets the operand.
*
- * @param aOP the new operand
+ * @param aOP
+ * the new operand
*/
public void setOperand(Operand aOP) {
op = aOP;
@@ -415,7 +427,8 @@
/**
* The main method.
*
- * @param args the arguments
+ * @param args
+ * the arguments
*/
public static void main(String[] args) {
Filter filter = new Filter();
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/JavaTimer.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/JavaTimer.java
index 6ae4a05..f8b3502 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/JavaTimer.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/JavaTimer.java
@@ -23,7 +23,6 @@
import org.apache.uima.util.UimaTimer;
-
/**
* The Class JavaTimer.
*
@@ -32,7 +31,7 @@
@Deprecated
public class JavaTimer implements Timer, Serializable {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 5399135137398839124L;
@@ -42,7 +41,9 @@
/** The end. */
private long end = 0;
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.cpm.utils.Timer#start()
*/
// starts the time
@@ -51,7 +52,9 @@
start = System.currentTimeMillis();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.cpm.utils.Timer#end()
*/
// ends the timer
@@ -60,7 +63,9 @@
end = System.currentTimeMillis();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.cpm.utils.Timer#getResolution()
*/
@Override
@@ -68,7 +73,9 @@
return 10;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.cpm.utils.Timer#getDuration()
*/
// returns duration (in ms) between start() and end() calls
@@ -86,7 +93,9 @@
return System.currentTimeMillis();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.cpm.utils.Timer#getTimeInSecs()
*/
@Override
@@ -94,7 +103,9 @@
return (getTime() / 1000);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.cpm.utils.Timer#getTimeInMillis()
*/
@Override
@@ -102,7 +113,9 @@
return getTime();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.cpm.utils.Timer#getTimeInMicros()
*/
@Override
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/QueueEntity.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/QueueEntity.java
index 5b767b8..c9654af 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/QueueEntity.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/QueueEntity.java
@@ -19,7 +19,6 @@
package org.apache.uima.collection.impl.cpm.utils;
-
/**
* Convenience wrapper that is internally used by the CPM. Created in the OutputQueue this wrapper
* contains the CAS and additional information needed to determine if the CAS contained has arrived
@@ -29,7 +28,7 @@
*
*/
public class QueueEntity {
-
+
/** The timed out. */
private boolean timedOut = false;
@@ -39,8 +38,10 @@
/**
* Initialize the instance with the Entity (CAS) and the timeout.
*
- * @param anEntity the an entity
- * @param hasTimedOut the has timed out
+ * @param anEntity
+ * the an entity
+ * @param hasTimedOut
+ * the has timed out
*/
public QueueEntity(Object anEntity, boolean hasTimedOut) {
timedOut = hasTimedOut;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/Timer.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/Timer.java
index c20fd25..b89c7ff 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/Timer.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/Timer.java
@@ -21,7 +21,6 @@
import org.apache.uima.util.UimaTimer;
-
/**
* The Interface Timer.
*
@@ -30,7 +29,7 @@
@Deprecated
public interface Timer {
-
+
/**
* Start.
*/
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/TimerFactory.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/TimerFactory.java
index 0556e76..65d1867 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/TimerFactory.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/TimerFactory.java
@@ -25,20 +25,19 @@
import org.apache.uima.util.Level;
import org.apache.uima.util.UimaTimer;
-
/**
* Creates an instance of UimaTimer.
*/
public class TimerFactory {
-
+
/** The timer. */
private static UimaTimer timer = null;
/**
* Instantiate UimaTimer object from a given class.
*
- * @param aClassName -
- * UimaTimer implemetation class
+ * @param aClassName
+ * - UimaTimer implemetation class
*/
public TimerFactory(String aClassName) {
try {
@@ -75,9 +74,10 @@
/**
* Instantiates dynamically a UimaTimer object.
*
- * @param aClassName -
- * class implementing UimaTimer
- * @throws ResourceInitializationException -
+ * @param aClassName
+ * - class implementing UimaTimer
+ * @throws ResourceInitializationException
+ * -
*/
private void initialize(String aClassName) throws ResourceInitializationException {
@@ -101,12 +101,12 @@
new Object[] { aClassName, "CPE" }, e);
} catch (IllegalAccessException e) {
throw new ResourceInitializationException(
- ResourceInitializationException.COULD_NOT_INSTANTIATE, new Object[] { aClassName,
- "CPE" }, e);
+ ResourceInitializationException.COULD_NOT_INSTANTIATE,
+ new Object[] { aClassName, "CPE" }, e);
} catch (InstantiationException e) {
throw new ResourceInitializationException(
- ResourceInitializationException.COULD_NOT_INSTANTIATE, new Object[] { aClassName,
- "CPE" }, e);
+ ResourceInitializationException.COULD_NOT_INSTANTIATE,
+ new Object[] { aClassName, "CPE" }, e);
}
if (UIMAFramework.getLogger().isLoggable(Level.CONFIG)) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/TypeComplianceConverterImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/TypeComplianceConverterImpl.java
index be13c87..297235c 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/TypeComplianceConverterImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/TypeComplianceConverterImpl.java
@@ -19,7 +19,6 @@
package org.apache.uima.collection.impl.cpm.utils;
-
/**
* Component providing conversion service. It replaces all occurances of provided String patterns
* with provided replacement String.
@@ -31,12 +30,12 @@
/**
* Converts occurance of patterns in a sourceString with provided replacement String.
*
- * @param aSourceString -
- * String to convert
- * @param aPattern -
- * pattern for matching
- * @param aReplaceString -
- * replacement String for aPattern
+ * @param aSourceString
+ * - String to convert
+ * @param aPattern
+ * - pattern for matching
+ * @param aReplaceString
+ * - replacement String for aPattern
* @return - converted String
*/
public static String replace(String aSourceString, String aPattern, String aReplaceString) {
@@ -61,14 +60,15 @@
/**
* The main method.
*
- * @param args the arguments
+ * @param args
+ * the arguments
*/
public static void main(String[] args) {
- System.out.println(TypeComplianceConverterImpl.replace("Detag_colon_DetagContent", "_colon_",
- ":"));
+ System.out.println(
+ TypeComplianceConverterImpl.replace("Detag_colon_DetagContent", "_colon_", ":"));
System.out.println(TypeComplianceConverterImpl.replace("Detag:DetagContent", ":", "_colon_"));
- System.out.println(TypeComplianceConverterImpl
- .replace("Detag_dash_DetagContent", "_dash_", "-"));
+ System.out
+ .println(TypeComplianceConverterImpl.replace("Detag_dash_DetagContent", "_dash_", "-"));
System.out.println(TypeComplianceConverterImpl.replace("Detag-DetagContent", "-", "_dash_"));
}
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ValuePair.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ValuePair.java
index ff7e11f..c6eb110 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ValuePair.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/utils/ValuePair.java
@@ -19,12 +19,11 @@
package org.apache.uima.collection.impl.cpm.utils;
-
/**
* The Class ValuePair.
*/
public class ValuePair {
-
+
/** The old V. */
private String oldV;
@@ -34,8 +33,10 @@
/**
* Instantiates a new value pair.
*
- * @param oldValue the old value
- * @param newValue the new value
+ * @param oldValue
+ * the old value
+ * @param newValue
+ * the new value
*/
public ValuePair(String oldValue, String newValue) {
oldV = oldValue;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/vinci/DATACasUtils.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/vinci/DATACasUtils.java
index 711c923..0ed44ec 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/vinci/DATACasUtils.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/vinci/DATACasUtils.java
@@ -43,19 +43,21 @@
import org.apache.uima.util.Level;
import org.apache.uima.util.XMLSerializer;
-
/**
* The Class DATACasUtils.
*/
public class DATACasUtils {
-
+
/**
* Gets the XCA sas string.
*
- * @param aCasData the a cas data
- * @param keysToFilter the keys to filter
+ * @param aCasData
+ * the a cas data
+ * @param keysToFilter
+ * the keys to filter
* @return the XCA sas string
- * @throws Exception the exception
+ * @throws Exception
+ * the exception
*/
public static String getXCASasString(CasData aCasData, String[] keysToFilter) throws Exception {
CasDataToXCas generator = new CasDataToXCas();
@@ -73,10 +75,14 @@
/**
* Adds the feature structure.
*
- * @param dataCas the data cas
- * @param featureType the feature type
- * @param featureName the feature name
- * @param featureValue the feature value
+ * @param dataCas
+ * the data cas
+ * @param featureType
+ * the feature type
+ * @param featureName
+ * the feature name
+ * @param featureValue
+ * the feature value
*/
public static void addFeatureStructure(CasData dataCas, String featureType, String featureName,
String featureValue) {
@@ -90,7 +96,8 @@
/**
* Checks if is cas empty.
*
- * @param aDataCas the a data cas
+ * @param aDataCas
+ * the a data cas
* @return true if the data cas is empty
*/
public static boolean isCasEmpty(CasData aDataCas) {
@@ -104,10 +111,14 @@
/**
* Adds the feature.
*
- * @param dataCas the data cas
- * @param featureType the feature type
- * @param featureName the feature name
- * @param featureValue the feature value
+ * @param dataCas
+ * the data cas
+ * @param featureType
+ * the feature type
+ * @param featureName
+ * the feature name
+ * @param featureValue
+ * the feature value
*/
public static void addFeature(CasData dataCas, String featureType, String featureName,
String featureValue) {
@@ -124,9 +135,11 @@
/**
* Gets the byte count.
*
- * @param aDataCas the a data cas
+ * @param aDataCas
+ * the a data cas
* @return the byte count
- * @throws Exception -
+ * @throws Exception
+ * -
*/
public static long getByteCount(CasData aDataCas) throws Exception {
long byteCount = 0;
@@ -150,8 +163,10 @@
/**
* Should analyze CAS.
*
- * @param aCAS the a CAS
- * @param aFilterList the a filter list
+ * @param aCAS
+ * the a CAS
+ * @param aFilterList
+ * the a filter list
* @return true if this cas should be analyzed
*/
public static boolean shouldAnalyzeCAS(CasData aCAS, LinkedList aFilterList) {
@@ -166,9 +181,9 @@
// The second check is to see if the the feature does NOT exist in the CAS. In
// this case, the feature MUST be null.
- if ((filterExpression.getOperand() == null && featureValue == null || featureValue.trim()
- .length() == 0)
- || // this means that the feature must exist in CAS
+ if ((filterExpression.getOperand() == null && featureValue == null
+ || featureValue.trim().length() == 0) || // this means that the feature must exist
+ // in CAS
("!".equals(filterExpression.getOperand().getOperand()) && featureValue != null) // this
// means
// that
@@ -204,8 +219,10 @@
/**
* Drop it.
*
- * @param aKey the a key
- * @param dropKeyList the drop key list
+ * @param aKey
+ * the a key
+ * @param dropKeyList
+ * the drop key list
* @return true if this key is in the dropKeyList
*/
public static boolean dropIt(String aKey, String[] dropKeyList) {
@@ -221,8 +238,10 @@
/**
* Checks if is valid type.
*
- * @param aKey the a key
- * @param typeList the type list
+ * @param aKey
+ * the a key
+ * @param typeList
+ * the type list
* @return true if tbd
*/
public static boolean isValidType(String aKey, String[] typeList) {
@@ -238,7 +257,8 @@
org.apache.uima.collection.impl.cpm.Constants.LONG_COLON_TERM);
}
- for (int i = 0; aKey != null && typeList != null && i < typeList.length && typeList[i] != null; i++) {
+ for (int i = 0; aKey != null && typeList != null && i < typeList.length
+ && typeList[i] != null; i++) {
if (typeList[i].equals(aKey)) {
return true;
}
@@ -249,8 +269,10 @@
/**
* Checks for feature.
*
- * @param aCAS the a CAS
- * @param featureName the feature name
+ * @param aCAS
+ * the a CAS
+ * @param featureName
+ * the feature name
* @return true if
*/
public static boolean hasFeature(CasData aCAS, String featureName) {
@@ -271,8 +293,10 @@
/**
* Checks for feature structure.
*
- * @param aCAS the a CAS
- * @param aName the a name
+ * @param aCAS
+ * the a CAS
+ * @param aName
+ * the a name
* @return true if tbd
*/
public static boolean hasFeatureStructure(CasData aCAS, String aName) {
@@ -294,7 +318,8 @@
/**
* Dump features.
*
- * @param aCAS the a CAS
+ * @param aCAS
+ * the a CAS
*/
public static void dumpFeatures(CasData aCAS) {
Iterator it = aCAS.getFeatureStructures();
@@ -314,15 +339,10 @@
FeatureValue fValue = fs.getFeatureValue(names[i]);
if (fValue != null) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
- UIMAFramework.getLogger(DATACasUtils.class)
- .logrb(
- Level.FINEST,
- DATACasUtils.class.getName(),
- "process",
- CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_show_cas_fs_value__FINEST",
- new Object[] { Thread.currentThread().getName(), names[i],
- fValue.toString() });
+ UIMAFramework.getLogger(DATACasUtils.class).logrb(Level.FINEST,
+ DATACasUtils.class.getName(), "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
+ "UIMA_CPM_show_cas_fs_value__FINEST", new Object[] {
+ Thread.currentThread().getName(), names[i], fValue.toString() });
}
}
}
@@ -334,8 +354,10 @@
/**
* Gets the feature value by type.
*
- * @param aCAS the a CAS
- * @param featureName the feature name
+ * @param aCAS
+ * the a CAS
+ * @param featureName
+ * the feature name
* @return true if tbd
*/
public static String getFeatureValueByType(CasData aCAS, String featureName) {
@@ -363,7 +385,8 @@
}
- if ("uima.cpm.DocumentText".equals(featureName) || "UTF8:UTF8Content".equals(featureName)) {
+ if ("uima.cpm.DocumentText".equals(featureName)
+ || "UTF8:UTF8Content".equals(featureName)) {
FeatureValue fValue = fs.getFeatureValue("value");
if (fValue == null) {
return null;
@@ -391,9 +414,12 @@
/**
* Gets the feature structure values.
*
- * @param aCAS the a CAS
- * @param featureStructureName the feature structure name
- * @param featureName the feature name
+ * @param aCAS
+ * the a CAS
+ * @param featureStructureName
+ * the feature structure name
+ * @param featureName
+ * the feature name
* @return tbd
*/
public static String[] getFeatureStructureValues(CasData aCAS, String featureStructureName,
@@ -428,9 +454,12 @@
/**
* Gets the feature value by type.
*
- * @param aCAS the a CAS
- * @param aFeatureStructure the a feature structure
- * @param featureName the feature name
+ * @param aCAS
+ * the a CAS
+ * @param aFeatureStructure
+ * the a feature structure
+ * @param featureName
+ * the feature name
* @return tbd
*/
public static String getFeatureValueByType(CasData aCAS, String aFeatureStructure,
@@ -458,8 +487,10 @@
/**
* Remap feature types.
*
- * @param aDataCas the a data cas
- * @param aFeatureMap the a feature map
+ * @param aDataCas
+ * the a data cas
+ * @param aFeatureMap
+ * the a feature map
*/
public static void remapFeatureTypes(CasData aDataCas, FeatureMap aFeatureMap) {
ConfigurableFeature cf = null;
@@ -489,8 +520,10 @@
/**
* Gets the cas data features.
*
- * @param aCasData the a cas data
- * @param aFeatureStructureName the a feature structure name
+ * @param aCasData
+ * the a cas data
+ * @param aFeatureStructureName
+ * the a feature structure name
* @return tbd
*/
public static NameValuePair[] getCasDataFeatures(CasData aCasData, String aFeatureStructureName) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/vinci/Vinci.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/vinci/Vinci.java
index 39bb15c..94299e4 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/vinci/Vinci.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/vinci/Vinci.java
@@ -33,12 +33,11 @@
import org.apache.vinci.transport.VinciFrame;
import org.apache.vinci.transport.document.AFrame;
-
/**
* The Class Vinci.
*/
public class Vinci {
-
+
/** The Constant VNS_HOST. */
public static final String VNS_HOST = "VNS_HOST";
@@ -50,7 +49,9 @@
*/
public static class AFFactory implements TransportableFactory {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.vinci.transport.TransportableFactory#makeTransportable()
*/
@Override
@@ -71,8 +72,8 @@
/**
* Creates and populates an error frame.
*
- * @param errorMsg -
- * error message to place in the error frame
+ * @param errorMsg
+ * - error message to place in the error frame
*
* @return {@link org.apache.vinci.transport.VinciFrame} instance containing error
*/
@@ -86,13 +87,17 @@
* Package the {@link org.apache.vinci.transport.VinciFrame} containing result of the requested
* operation into a Vinci Data frame.
*
- * @param conn the connection
- * @param requestFrame {@link org.apache.vinci.transport.VinciFrame}
- * containing result of thsi service operation
+ * @param conn
+ * the connection
+ * @param requestFrame
+ * {@link org.apache.vinci.transport.VinciFrame} containing result of thsi service
+ * operation
* @return {@link org.apache.vinci.transport.VinciFrame} VinciData frame.
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- public static AFrame replyWithAnalysis(BaseClient conn, VinciFrame requestFrame) throws Exception {
+ public static AFrame replyWithAnalysis(BaseClient conn, VinciFrame requestFrame)
+ throws Exception {
AFFactory af = new AFFactory();
return (AFrame) conn.sendAndReceive(requestFrame, af);
}
@@ -101,11 +106,14 @@
* Package the {@link org.apache.vinci.transport.VinciFrame} containing result of the requested
* operation into a Vinci Data frame.
*
- * @param conn the connection
- * @param requestFrame {@link org.apache.vinci.transport.VinciFrame}
- * containing result of thsi service operation
+ * @param conn
+ * the connection
+ * @param requestFrame
+ * {@link org.apache.vinci.transport.VinciFrame} containing result of thsi service
+ * operation
* @return {@link org.apache.vinci.transport.VinciFrame} VinciData frame.
- * @throws Exception the exception
+ * @throws Exception
+ * the exception
*/
public static AFrame replyWithAnalysis(VinciClient conn, VinciFrame requestFrame)
throws Exception {
@@ -116,8 +124,10 @@
/**
* Produce A frame.
*
- * @param cmd the cmd
- * @param content the content
+ * @param cmd
+ * the cmd
+ * @param content
+ * the content
* @return the a frame
*/
public static AFrame produceAFrame(String cmd, String content) {
@@ -137,19 +147,20 @@
/**
* Extract KEYS as string.
*
- * @param frame the frame
+ * @param frame
+ * the frame
* @return the string
*/
public static String extractKEYSAsString(AFrame frame) {
String keys = "";
if (frame == null) {
- return keys;
+ return keys;
}
String frameAsString = frame.toXML();
if (frameAsString.indexOf("KEYS") > -1 && frameAsString.indexOf("</KEYS>") > -1) {
- keys = frameAsString.substring(frameAsString.indexOf("KEYS") + 5, frameAsString
- .indexOf("</KEYS>"));
+ keys = frameAsString.substring(frameAsString.indexOf("KEYS") + 5,
+ frameAsString.indexOf("</KEYS>"));
}
return keys;
}
@@ -157,8 +168,10 @@
/**
* Gets the feature value by type.
*
- * @param aCAS the a CAS
- * @param featureName the feature name
+ * @param aCAS
+ * the a CAS
+ * @param featureName
+ * the feature name
* @return the feature value by type
*/
public static String getFeatureValueByType(CasData aCAS, String featureName) {
@@ -181,7 +194,8 @@
/**
* Gets the content from DATA cas.
*
- * @param aCas the a cas
+ * @param aCas
+ * the a cas
* @return the content from DATA cas
*/
public static String getContentFromDATACas(CasData aCas) {
@@ -191,7 +205,7 @@
if (org.apache.uima.collection.impl.cpm.Constants.CONTENT_TAG.equals(fs.getType())) {
return ((PrimitiveValue) fs
.getFeatureValue(org.apache.uima.collection.impl.cpm.Constants.CONTENT_TAG_VALUE))
- .toString();
+ .toString();
}
}
return "";
@@ -200,7 +214,8 @@
/**
* Returns a content from a given VinciFrame.
*
- * @param aFrame the a frame
+ * @param aFrame
+ * the a frame
* @return the string
*/
public static String stripVinciFrame(VinciFrame aFrame) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorConfigurationParameterSettingsImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorConfigurationParameterSettingsImpl.java
index 2dacab3..565eac2 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorConfigurationParameterSettingsImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorConfigurationParameterSettingsImpl.java
@@ -25,13 +25,12 @@
import org.apache.uima.collection.metadata.NameValuePair;
import org.apache.uima.resource.metadata.ConfigurationParameterSettings;
-
/**
* The Class CasProcessorConfigurationParameterSettingsImpl.
*/
-public class CasProcessorConfigurationParameterSettingsImpl implements
- CasProcessorConfigurationParameterSettings {
-
+public class CasProcessorConfigurationParameterSettingsImpl
+ implements CasProcessorConfigurationParameterSettings {
+
/** The params. */
private NameValuePair[] params = new NameValuePair[0];
@@ -48,7 +47,8 @@
/**
* Instantiates a new cas processor configuration parameter settings impl.
*
- * @param aCps the a cps
+ * @param aCps
+ * the a cps
*/
protected CasProcessorConfigurationParameterSettingsImpl(ConfigurationParameterSettings aCps) {
int size = 0;
@@ -57,8 +57,8 @@
params = new NameValuePair[size];
}
for (int i = 0; i < size; i++) {
- paramList.add(new NameValuePairImpl(aCps.getParameterSettings()[i].getName(), aCps
- .getParameterSettings()[i].getValue()));
+ paramList.add(new NameValuePairImpl(aCps.getParameterSettings()[i].getName(),
+ aCps.getParameterSettings()[i].getValue()));
}
}
@@ -78,7 +78,8 @@
/**
* Gets the param value object.
*
- * @param aParamName the a param name
+ * @param aParamName
+ * the a param name
* @return the param value object
*/
private NameValuePair getParamValueObject(String aParamName) {
@@ -94,7 +95,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CasProcessorConfigurationParameterSettings#getParameterValue(java.lang.String)
+ * @see org.apache.uima.collection.metadata.CasProcessorConfigurationParameterSettings#
+ * getParameterValue(java.lang.String)
*/
@Override
public Object getParameterValue(String aParamName) {
@@ -108,8 +110,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CasProcessorConfigurationParameterSettings#setParameterValue(java.lang.String,
- * java.lang.Object)
+ * @see org.apache.uima.collection.metadata.CasProcessorConfigurationParameterSettings#
+ * setParameterValue(java.lang.String, java.lang.Object)
*/
@Override
public void setParameterValue(String aParamName, Object aValue) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorCpeObject.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorCpeObject.java
index 2e278df..df1ff57 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorCpeObject.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorCpeObject.java
@@ -51,7 +51,6 @@
import org.w3c.dom.Element;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* Base class for all CpeCasProcessor objects in the reference implementation. Provides support for
* getting and setting common configuration settings shared by all CpeCasProcessor objects
@@ -59,12 +58,13 @@
*
*/
public class CasProcessorCpeObject extends MetaDataObject_impl implements CpeCasProcessor {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -2424851648116984900L;
/** The Constant actionArray. */
- private static final String[] actionArray = { "continue", "terminate", "disable", "kill-pipeline" };
+ private static final String[] actionArray = { "continue", "terminate", "disable",
+ "kill-pipeline" };
/** The Constant deployArray. */
private static final String[] deployArray = { "integrated", "remote", "local" };
@@ -111,15 +111,15 @@
/**
* Associates deployment type with for this CasProcessor. Three types are currently supported:
* <ul>
- * <li> integrated - CasProcessor is collocated with the CPM
- * <li> local - CasProcessor runs on the same machine as the CPM however in a different process
- * <li> remote - CasProcessor runs on remote machine
+ * <li>integrated - CasProcessor is collocated with the CPM
+ * <li>local - CasProcessor runs on the same machine as the CPM however in a different process
+ * <li>remote - CasProcessor runs on remote machine
* </ul>
*
- * @param aDeployMode -
- * String identifying deployment type
- * @throws CpeDescriptorException -
- * if invalid deployment type is provided
+ * @param aDeployMode
+ * - String identifying deployment type
+ * @throws CpeDescriptorException
+ * - if invalid deployment type is provided
*/
public void setDeployment(String aDeployMode) throws CpeDescriptorException {
deployment = aDeployMode;
@@ -147,9 +147,10 @@
/**
* Associates a given descriptor path with this CasProcessor.
*
- * @param aDescriptorPath -
- * path to the descriptor
- * @throws CpeDescriptorException tbd
+ * @param aDescriptorPath
+ * - path to the descriptor
+ * @throws CpeDescriptorException
+ * tbd
*/
@Override
public void setDescriptor(String aDescriptorPath) throws CpeDescriptorException {
@@ -166,12 +167,13 @@
* Returns a descriptor path associated with this CasProcessor.
*
* @return String - descriptor path
- * @deprecated Doesn't support the new import syntax. Use getCpeComponentDescriptor().findAbsoluteUrl() instead.
+ * @deprecated Doesn't support the new import syntax. Use
+ * getCpeComponentDescriptor().findAbsoluteUrl() instead.
*/
@Override
@Deprecated
-public String getDescriptor() {
+ public String getDescriptor() {
if (descriptor != null && descriptor.getInclude() != null) {
return descriptor.getInclude().get();
}
@@ -193,8 +195,8 @@
* Associates a filter string with this CasProcessor. A filter provides a mechanism that
* facilitates efficient routing of Cas's to the CasProcessor.
*
- * @param aFilterExpression -
- * String containing a filter
+ * @param aFilterExpression
+ * - String containing a filter
*/
@Override
public void setCasProcessorFilter(String aFilterExpression) {
@@ -217,7 +219,8 @@
}
String filterString = getFilter().getFilterString();
if (filter != null) {
- if (filterString.indexOf(org.apache.uima.collection.impl.cpm.Constants.SHORT_COLON_TERM) > -1) {
+ if (filterString
+ .indexOf(org.apache.uima.collection.impl.cpm.Constants.SHORT_COLON_TERM) > -1) {
filterString = StringUtils.replaceAll(filterString,
org.apache.uima.collection.impl.cpm.Constants.SHORT_COLON_TERM,
org.apache.uima.collection.impl.cpm.Constants.LONG_COLON_TERM);
@@ -234,7 +237,8 @@
/**
* Adds default configuration shared by CasProcessors.
*
- * @throws CpeDescriptorException tbd
+ * @throws CpeDescriptorException
+ * tbd
*/
protected void addDefaults() throws CpeDescriptorException {
if (getCasProcessorFilter() == null) {
@@ -271,8 +275,8 @@
/**
* Associates a batch size with this CasProcessor.
*
- * @param aBatchSize -
- * batch size of this CasProcessor
+ * @param aBatchSize
+ * - batch size of this CasProcessor
*/
@Override
public void setBatchSize(int aBatchSize) {
@@ -293,10 +297,11 @@
* Deletes a given param from a param list if it exists. Returns a position in the current Param
* List for a given 'aParamName'.
*
- * @param aParamName -
- * name of the param to find.
+ * @param aParamName
+ * - name of the param to find.
* @return - position in the list as int, -1 if not found
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
private int deleteParam(String aParamName) throws CpeDescriptorException {
CasProcessorDeploymentParams depParams = getDeploymentParameters();
@@ -316,12 +321,13 @@
* Adds a given deployment param to the param list. If a param with a given name exists in the
* list its value will be over-written.
*
- * @param aParamName -
- * name of the new parameter
- * @param aParamValue -
- * value of the new parameter
+ * @param aParamName
+ * - name of the new parameter
+ * @param aParamValue
+ * - value of the new parameter
*
- * @throws CpeDescriptorException tbd
+ * @throws CpeDescriptorException
+ * tbd
*/
@Override
public void addDeployParam(String aParamName, String aParamValue) throws CpeDescriptorException {
@@ -336,16 +342,18 @@
}
}
if (!found) {
- deploymentParameters.add(new CasProcessorDeploymentParamImpl(aParamName, aParamValue,
- "string"));
+ deploymentParameters
+ .add(new CasProcessorDeploymentParamImpl(aParamName, aParamValue, "string"));
}
}
/**
* Sets the deployment params.
*
- * @param aParams the new deployment params
- * @throws CpeDescriptorException tbd
+ * @param aParams
+ * the new deployment params
+ * @throws CpeDescriptorException
+ * tbd
*/
protected void setDeploymentParams(CasProcessorDeploymentParams aParams)
throws CpeDescriptorException {
@@ -366,9 +374,10 @@
/**
* Associates a name with this CasProcessor.
*
- * @param aName -
- * name as string
- * @throws CpeDescriptorException tbd
+ * @param aName
+ * - name as string
+ * @throws CpeDescriptorException
+ * tbd
*/
@Override
public void setName(String aName) throws CpeDescriptorException {
@@ -394,9 +403,11 @@
/**
* Sets the sofa.
*
- * @param aSoFa the new sofa
- * @throws CpeDescriptorException tbd
- * @deprecated
+ * @param aSoFa
+ * the new sofa
+ * @throws CpeDescriptorException
+ * tbd
+ * @deprecated
*/
@Override
@Deprecated
@@ -439,8 +450,10 @@
/**
* Sets the cas processor filter.
*
- * @param aFilter the new cas processor filter
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @param aFilter
+ * the new cas processor filter
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public void setCasProcessorFilter(CasProcessorFilter aFilter) throws CpeDescriptorException {
filter = aFilter;
@@ -449,13 +462,17 @@
/**
* Sets the error handling.
*
- * @param aErrorHandling the new error handling
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @param aErrorHandling
+ * the new error handling
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CpeCasProcessor#setErrorHandling(org.apache.uima.collection.metadata.CasProcessorErrorHandling)
+ * @see
+ * org.apache.uima.collection.metadata.CpeCasProcessor#setErrorHandling(org.apache.uima.collection
+ * .metadata.CasProcessorErrorHandling)
*/
public void setErrorHandling(CasProcessorErrorHandling aErrorHandling)
throws CpeDescriptorException {
@@ -478,8 +495,8 @@
* sample size is defined seperately.
*
*
- * @param aErrorCount -
- * max error tolerance
+ * @param aErrorCount
+ * - max error tolerance
*/
@Override
public void setMaxErrorCount(int aErrorCount) {
@@ -514,8 +531,8 @@
* sample size is defined seperately.
*
*
- * @param aErrorSampleSize -
- * max error tolerance
+ * @param aErrorSampleSize
+ * - max error tolerance
*/
@Override
public void setMaxErrorSampleSize(int aErrorSampleSize) {
@@ -547,8 +564,8 @@
/**
* Check if the action String is valid.
*
- * @param aAction -
- * action as string
+ * @param aAction
+ * - action as string
* @return - true is valid, false otherwise
*/
private boolean validAction(String aAction) {
@@ -564,8 +581,8 @@
* Associates action in the event the errors exceed max tolerance. In such case, the action
* determines appropriate strategy ( terminate, continue, disable).
*
- * @param aAction -
- * action string
+ * @param aAction
+ * - action string
*/
@Override
public void setActionOnMaxError(String aAction) {
@@ -593,8 +610,8 @@
* Associates action in the event CasProcessor restarts exceed max tolerance. In such case, the
* action determines appropriate strategy ( terminate, continue, disable).
*
- * @param aAction -
- * action string
+ * @param aAction
+ * - action string
*/
@Override
public void setActionOnMaxRestart(String aAction) {
@@ -621,8 +638,8 @@
/**
* Associates max tolerance for CasProcessor restarts.
*
- * @param aRestartCount -
- * max number of restarts
+ * @param aRestartCount
+ * - max number of restarts
*/
@Override
public void setMaxRestartCount(int aRestartCount) {
@@ -650,8 +667,8 @@
* Associates timeout in terms of ms, with this CasProcessor. It is the max number of millis to
* wait for response.
*
- * @param aTimeoutValue -
- * millis to wait for response
+ * @param aTimeoutValue
+ * - millis to wait for response
*/
@Override
public void setTimeout(int aTimeoutValue) {
@@ -679,8 +696,10 @@
/**
* Sets configuration parameter settings for this CasProcessor.
*
- * @param settings the new configuration parameter settings
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @param settings
+ * the new configuration parameter settings
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
@Override
public void setConfigurationParameterSettings(CasProcessorConfigurationParameterSettings settings)
@@ -693,8 +712,8 @@
org.apache.uima.resource.metadata.NameValuePair[] nvp = new NameValuePair_impl[settings
.getParameterSettings().length];
for (int i = 0; i < settings.getParameterSettings().length; i++) {
- nvp[i] = new NameValuePair_impl(settings.getParameterSettings()[i].getName(), settings
- .getParameterSettings()[i].getValue());
+ nvp[i] = new NameValuePair_impl(settings.getParameterSettings()[i].getName(),
+ settings.getParameterSettings()[i].getValue());
}
parameterSettings.setParameterSettings(nvp);
}
@@ -716,7 +735,8 @@
/**
* Sets the parameter settings.
*
- * @param settings the new parameter settings
+ * @param settings
+ * the new parameter settings
*/
public void setParameterSettings(ConfigurationParameterSettings settings) {
parameterSettings = settings;
@@ -770,7 +790,8 @@
/**
* Sets the checkpoint.
*
- * @param checkpoint the new checkpoint
+ * @param checkpoint
+ * the new checkpoint
*/
public void setCheckpoint(CpeCheckpoint checkpoint) {
this.checkpoint = checkpoint;
@@ -779,7 +800,8 @@
/**
* Sets the parameters.
*
- * @param aparameters the new parameters
+ * @param aparameters
+ * the new parameters
*/
public void setParameters(Parameter[] aparameters) {
parameters = aparameters;
@@ -788,7 +810,8 @@
/**
* Sets the filter.
*
- * @param aFilter the new filter
+ * @param aFilter
+ * the new filter
*/
public void setFilter(CasProcessorFilter aFilter) {
filter = aFilter;
@@ -807,7 +830,8 @@
/**
* Sets the run in separate process.
*
- * @param process container with configuration info for running CasProcessor in separate process
+ * @param process
+ * container with configuration info for running CasProcessor in separate process
*/
public void setRunInSeparateProcess(CasProcessorRunInSeperateProcess process) {
runInSeparateProcess = process;
@@ -825,7 +849,8 @@
/**
* Sets the deployment parameters.
*
- * @param parameters deployment parameters
+ * @param parameters
+ * deployment parameters
*/
public void setDeploymentParameters(CasProcessorDeploymentParams parameters) {
deploymentParameters = parameters;
@@ -834,10 +859,14 @@
/**
* Overridden to read "name" and "value" attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -874,7 +903,9 @@
return attrs;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -915,14 +946,17 @@
/**
* Sets the sofa name mappings.
*
- * @param mappings sofa name mappings
+ * @param mappings
+ * sofa name mappings
*/
@Override
public void setSofaNameMappings(CpeSofaMappings mappings) {
sofaNameMappings = mappings;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeCasProcessor#setIsParallelizable(boolean)
*/
@Override
@@ -930,7 +964,9 @@
isParallelizable = isP;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeCasProcessor#getIsParallelizable()
*/
@Override
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorDeploymentParamImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorDeploymentParamImpl.java
index 18b31f0..9b31773 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorDeploymentParamImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorDeploymentParamImpl.java
@@ -26,13 +26,12 @@
import org.apache.uima.resource.metadata.impl.XmlizationInfo;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CasProcessorDeploymentParamImpl.
*/
-public class CasProcessorDeploymentParamImpl extends MetaDataObject_impl implements
- CasProcessorDeploymentParam {
-
+public class CasProcessorDeploymentParamImpl extends MetaDataObject_impl
+ implements CasProcessorDeploymentParam {
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 8950620301535742630L;
@@ -54,9 +53,12 @@
/**
* Instantiates a new cas processor deployment param impl.
*
- * @param aName the a name
- * @param aValue the a value
- * @param aType the a type
+ * @param aName
+ * the a name
+ * @param aValue
+ * the a value
+ * @param aType
+ * the a type
*/
public CasProcessorDeploymentParamImpl(String aName, String aValue, String aType) {
name = aName;
@@ -64,8 +66,12 @@
type = aType;
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CasProcessorDeploymentParam#setParameterName(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.metadata.CasProcessorDeploymentParam#setParameterName(java.lang.
+ * String)
*/
@Override
public void setParameterName(String aParamName) throws CpeDescriptorException {
@@ -82,9 +88,12 @@
return name;
}
-
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CasProcessorDeploymentParam#setParameterValue(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.metadata.CasProcessorDeploymentParam#setParameterValue(java.lang.
+ * String)
*/
@Override
public void setParameterValue(String aParamValue) throws CpeDescriptorException {
@@ -104,15 +113,18 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CasProcessorDeploymentParam#setParameterType(java.lang.String)
+ * @see
+ * org.apache.uima.collection.metadata.CasProcessorDeploymentParam#setParameterType(java.lang.
+ * String)
*/
@Override
public void setParameterType(String aParamType) throws CpeDescriptorException {
type = aParamType;
}
-
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CasProcessorDeploymentParam#getParameterType()
*/
@Override
@@ -141,7 +153,9 @@
return attrs;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorDeploymentParamsImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorDeploymentParamsImpl.java
index 483c4ef..38efa09 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorDeploymentParamsImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorDeploymentParamsImpl.java
@@ -38,13 +38,12 @@
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CasProcessorDeploymentParamsImpl.
*/
-public class CasProcessorDeploymentParamsImpl extends MetaDataObject_impl implements
- CasProcessorDeploymentParams {
-
+public class CasProcessorDeploymentParamsImpl extends MetaDataObject_impl
+ implements CasProcessorDeploymentParams {
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 4871710283477856271L;
@@ -60,7 +59,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CasProcessorDeploymentParams#add(org.apache.uima.collection.metadata.CasProcessorDeploymentParam)
+ * @see
+ * org.apache.uima.collection.metadata.CasProcessorDeploymentParams#add(org.apache.uima.collection
+ * .metadata.CasProcessorDeploymentParam)
*/
@Override
public void add(CasProcessorDeploymentParam aParam) {
@@ -97,7 +98,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CasProcessorDeploymentParams#remove(org.apache.uima.collection.metadata.CasProcessorDeploymentParam)
+ * @see org.apache.uima.collection.metadata.CasProcessorDeploymentParams#remove(org.apache.uima.
+ * collection.metadata.CasProcessorDeploymentParam)
*/
@Override
public void remove(CasProcessorDeploymentParam aParam) throws CpeDescriptorException {
@@ -111,10 +113,14 @@
/**
* Overridden to read "name" and "value" attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -141,8 +147,12 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#toXML(org.xml.sax.ContentHandler, boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.resource.metadata.impl.MetaDataObject_impl#toXML(org.xml.sax.ContentHandler,
+ * boolean)
*/
@Override
public void toXML(ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute)
@@ -172,7 +182,9 @@
aContentHandler.endElement(inf.namespace, inf.elementTagName, inf.elementTagName);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorErrorHandlingImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorErrorHandlingImpl.java
index 36d8eb1..b785fed 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorErrorHandlingImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorErrorHandlingImpl.java
@@ -27,12 +27,11 @@
import org.apache.uima.resource.metadata.impl.PropertyXmlInfo;
import org.apache.uima.resource.metadata.impl.XmlizationInfo;
-
/**
* The Class CasProcessorErrorHandlingImpl.
*/
-public class CasProcessorErrorHandlingImpl extends MetaDataObject_impl implements
- CasProcessorErrorHandling {
+public class CasProcessorErrorHandlingImpl extends MetaDataObject_impl
+ implements CasProcessorErrorHandling {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1677062861920690715L;
@@ -55,7 +54,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CasProcessorErrorHandling#setMaxConsecutiveRestarts(org.apache.uima.collection.metadata.CasProcessorMaxRestarts)
+ * @see
+ * org.apache.uima.collection.metadata.CasProcessorErrorHandling#setMaxConsecutiveRestarts(org.
+ * apache.uima.collection.metadata.CasProcessorMaxRestarts)
*/
@Override
public void setMaxConsecutiveRestarts(CasProcessorMaxRestarts aCasPRestarts) {
@@ -75,7 +76,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CasProcessorErrorHandling#setErrorRateThreshold(org.apache.uima.collection.metadata.CasProcessorErrorRateThreshold)
+ * @see
+ * org.apache.uima.collection.metadata.CasProcessorErrorHandling#setErrorRateThreshold(org.apache.
+ * uima.collection.metadata.CasProcessorErrorRateThreshold)
*/
@Override
public void setErrorRateThreshold(CasProcessorErrorRateThreshold aCasPErrorThreshold) {
@@ -95,7 +98,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CasProcessorErrorHandling#setTimeout(org.apache.uima.collection.metadata.CasProcessorTimeout)
+ * @see org.apache.uima.collection.metadata.CasProcessorErrorHandling#setTimeout(org.apache.uima.
+ * collection.metadata.CasProcessorTimeout)
*/
@Override
public void setTimeout(CasProcessorTimeout aTimeout) {
@@ -112,7 +116,9 @@
return timeout;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorErrorRateThresholdImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorErrorRateThresholdImpl.java
index 2d7185e..a90f735 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorErrorRateThresholdImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorErrorRateThresholdImpl.java
@@ -29,13 +29,12 @@
import org.w3c.dom.Element;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CasProcessorErrorRateThresholdImpl.
*/
-public class CasProcessorErrorRateThresholdImpl extends MetaDataObject_impl implements
- CasProcessorErrorRateThreshold {
-
+public class CasProcessorErrorRateThresholdImpl extends MetaDataObject_impl
+ implements CasProcessorErrorRateThreshold {
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -9214395691914383261L;
@@ -51,7 +50,9 @@
public CasProcessorErrorRateThresholdImpl() {
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CasProcessorErrorRateThreshold#setMaxErrorCount(int)
*/
@Override
@@ -87,8 +88,11 @@
return Integer.parseInt(errorCount);
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CasProcessorErrorRateThreshold#setMaxErrorSampleSize(int)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.metadata.CasProcessorErrorRateThreshold#setMaxErrorSampleSize(int)
*/
@Override
public void setMaxErrorSampleSize(int aSampleSize) {
@@ -103,7 +107,9 @@
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CasProcessorErrorRateThreshold#getMaxErrorSampleSize()
*/
@Override
@@ -123,7 +129,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CasProcessorErrorRateThreshold#setAction(java.lang.String)
+ * @see
+ * org.apache.uima.collection.metadata.CasProcessorErrorRateThreshold#setAction(java.lang.String)
*/
@Override
public void setAction(String aAction) {
@@ -143,10 +150,14 @@
/**
* Overridden to read "name" and "value" attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -171,7 +182,9 @@
return attrs;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -195,7 +208,8 @@
/**
* Sets the value.
*
- * @param string the new value
+ * @param string
+ * the new value
*/
public void setValue(String string) {
value = string;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorExecArgImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorExecArgImpl.java
index 2ab3660..ba03223 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorExecArgImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorExecArgImpl.java
@@ -33,7 +33,6 @@
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CasProcessorExecArgImpl.
*/
@@ -74,10 +73,14 @@
/**
* Overridden to read "name" and "value" attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -87,7 +90,9 @@
value = XMLUtils.getText(aElement);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -99,8 +104,12 @@
static final private XmlizationInfo XMLIZATION_INFO = new XmlizationInfo("arg",
new PropertyXmlInfo[0]);
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#toXML(org.xml.sax.ContentHandler, boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.resource.metadata.impl.MetaDataObject_impl#toXML(org.xml.sax.ContentHandler,
+ * boolean)
*/
@Override
public void toXML(ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute)
@@ -127,7 +136,7 @@
}
/**
- * PROTECTED METHODS USED BY THE PARSER *.
+ * PROTECTED METHODS USED BY THE PARSER *.
*
* @return the value
*/
@@ -141,7 +150,8 @@
/**
* Sets the value.
*
- * @param string the new value
+ * @param string
+ * the new value
*/
public void setValue(String string) {
value = string;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorExecArgsImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorExecArgsImpl.java
index 71fecd8..77dfb85 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorExecArgsImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorExecArgsImpl.java
@@ -25,12 +25,11 @@
import org.apache.uima.collection.metadata.CasProcessorExecArgs;
import org.apache.uima.collection.metadata.CpeDescriptorException;
-
/**
* The Class CasProcessorExecArgsImpl.
*/
public class CasProcessorExecArgsImpl implements CasProcessorExecArgs {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -719956786158518508L;
@@ -46,7 +45,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CASProcessorExecArgs#add(org.apache.uima.collection.metadata.CASProcessorExecArg)
+ * @see org.apache.uima.collection.metadata.CASProcessorExecArgs#add(org.apache.uima.collection.
+ * metadata.CASProcessorExecArg)
*/
@Override
public void add(CasProcessorExecArg aArg) {
@@ -81,7 +81,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CASProcessorExecArgs#remove(org.apache.uima.collection.metadata.CASProcessorExecArg)
+ * @see
+ * org.apache.uima.collection.metadata.CASProcessorExecArgs#remove(org.apache.uima.collection.
+ * metadata.CASProcessorExecArg)
*/
@Override
public void remove(int aIndex) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorExecutableImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorExecutableImpl.java
index 2cf0400..2f60099 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorExecutableImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorExecutableImpl.java
@@ -38,13 +38,12 @@
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CasProcessorExecutableImpl.
*/
-public class CasProcessorExecutableImpl extends MetaDataObject_impl implements
- CasProcessorExecutable {
-
+public class CasProcessorExecutableImpl extends MetaDataObject_impl
+ implements CasProcessorExecutable {
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 6897788743141912586L;
@@ -69,12 +68,15 @@
/**
* Sets the CAS processor exec args.
*
- * @param aArgs the new CAS processor exec args
+ * @param aArgs
+ * the new CAS processor exec args
*/
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CasProcessorExecutable#setCASProcessorExecArgs(org.apache.uima.collection.metadata.CASProcessorExecArgs)
+ * @see
+ * org.apache.uima.collection.metadata.CasProcessorExecutable#setCASProcessorExecArgs(org.apache.
+ * uima.collection.metadata.CASProcessorExecArgs)
*/
public void setCASProcessorExecArgs(CasProcessorExecArgs aArgs) {
args = aArgs;
@@ -94,8 +96,12 @@
return args;
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CasProcessorExecutable#addCasProcessorExecArg(org.apache.uima.collection.metadata.CasProcessorExecArg)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.metadata.CasProcessorExecutable#addCasProcessorExecArg(org.apache.
+ * uima.collection.metadata.CasProcessorExecArg)
*/
@Override
public void addCasProcessorExecArg(CasProcessorExecArg aArg) {
@@ -105,13 +111,16 @@
/**
* Adds the cas processor runtime env param.
*
- * @param aParam the a param
+ * @param aParam
+ * the a param
*/
public void addCasProcessorRuntimeEnvParam(CasProcessorRuntimeEnvParam aParam) {
envs.add(aParam);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CasProcessorExecutable#getCasProcessorExecArg(int)
*/
@Override
@@ -124,7 +133,9 @@
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CasProcessorExecutable#getAllCasProcessorExecArgs()
*/
@Override
@@ -132,7 +143,9 @@
return args.getAll();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CasProcessorExecutable#removeCasProcessorExecArg(int)
*/
@Override
@@ -162,7 +175,8 @@
/**
* Sets the dir.
*
- * @param string the new dir
+ * @param string
+ * the new dir
*/
public void setDir(String string) {
dir = string;
@@ -171,7 +185,8 @@
/**
* Sets the executable.
*
- * @param string the new executable
+ * @param string
+ * the new executable
*/
@Override
public void setExecutable(String string) {
@@ -190,7 +205,8 @@
/**
* Sets the args.
*
- * @param aargs the new args
+ * @param aargs
+ * the new args
*/
protected void setArgs(CasProcessorExecArg[] aargs) {
for (int i = 0; aargs != null && i < aargs.length; i++) {
@@ -201,10 +217,14 @@
/**
* Overridden to read "name" and "value" attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -226,8 +246,8 @@
args.add(arg);
} else if ("env".equals(node.getNodeName())) {
// assumes all children are CasProcessor elements
- CasProcessorRuntimeEnvParam env = (CasProcessorRuntimeEnvParam) aParser.buildObject(
- (Element) node, aOptions);
+ CasProcessorRuntimeEnvParam env = (CasProcessorRuntimeEnvParam) aParser
+ .buildObject((Element) node, aOptions);
envs.add(env);
}
}
@@ -235,8 +255,12 @@
}
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#toXML(org.xml.sax.ContentHandler, boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.resource.metadata.impl.MetaDataObject_impl#toXML(org.xml.sax.ContentHandler,
+ * boolean)
*/
@Override
public void toXML(ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute)
@@ -287,7 +311,9 @@
return attrs;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -312,7 +338,8 @@
/**
* Sets the envs.
*
- * @param params the new envs
+ * @param params
+ * the new envs
*/
@Override
public void setEnvs(ArrayList params) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorFilterImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorFilterImpl.java
index ae04d8e..12d2d33 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorFilterImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorFilterImpl.java
@@ -32,12 +32,11 @@
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CasProcessorFilterImpl.
*/
public class CasProcessorFilterImpl extends MetaDataObject_impl implements CasProcessorFilter {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1879442561195094666L;
@@ -50,7 +49,9 @@
public CasProcessorFilterImpl() {
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CasProcessorFilter#setFilterString(java.lang.String)
*/
@Override
@@ -58,7 +59,9 @@
filter = aFilterString;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CasProcessorFilter#getFilterString()
*/
@Override
@@ -69,10 +72,14 @@
/**
* Overridden to read "name" and "value" attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -83,8 +90,12 @@
}
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#toXML(org.xml.sax.ContentHandler, boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.resource.metadata.impl.MetaDataObject_impl#toXML(org.xml.sax.ContentHandler,
+ * boolean)
*/
@Override
public void toXML(ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute)
@@ -110,7 +121,9 @@
aContentHandler.endElement(inf.namespace, inf.elementTagName, inf.elementTagName);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -134,7 +147,8 @@
/**
* Sets the filter.
*
- * @param string the new filter
+ * @param string
+ * the new filter
*/
public void setFilter(String string) {
filter = string;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorMaxRestartsImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorMaxRestartsImpl.java
index 80c128c..d3f2eca 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorMaxRestartsImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorMaxRestartsImpl.java
@@ -29,13 +29,12 @@
import org.w3c.dom.Element;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CasProcessorMaxRestartsImpl.
*/
-public class CasProcessorMaxRestartsImpl extends MetaDataObject_impl implements
- CasProcessorMaxRestarts {
-
+public class CasProcessorMaxRestartsImpl extends MetaDataObject_impl
+ implements CasProcessorMaxRestarts {
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 2863741219504239020L;
@@ -106,7 +105,8 @@
/**
* Sets the value.
*
- * @param string the new value
+ * @param string
+ * the new value
*/
public void setValue(String string) {
value = string;
@@ -115,10 +115,14 @@
/**
* Overridden to read "name" and "value" attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -150,13 +154,15 @@
attrs.addAttribute("", "action", "action", "CDATA", String.valueOf(getAction()));
attrs.addAttribute("", "value", "value", "CDATA", getValue());
if (getWaitTimeBetweenRetries() != 0) {
- attrs.addAttribute("", "waitTimeBetweenRetries", "waitTimeBetweenRetries", "CDATA", String
- .valueOf(getWaitTimeBetweenRetries()));
+ attrs.addAttribute("", "waitTimeBetweenRetries", "waitTimeBetweenRetries", "CDATA",
+ String.valueOf(getWaitTimeBetweenRetries()));
}
return attrs;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -165,8 +171,8 @@
}
/** The Constant XMLIZATION_INFO. */
- static final private XmlizationInfo XMLIZATION_INFO = new XmlizationInfo(
- "maxConsecutiveRestarts", new PropertyXmlInfo[0]);
+ static final private XmlizationInfo XMLIZATION_INFO = new XmlizationInfo("maxConsecutiveRestarts",
+ new PropertyXmlInfo[0]);
/**
* Gets the wait time between retries.
@@ -181,7 +187,8 @@
/**
* Sets the wait time between retries.
*
- * @param i the new wait time between retries
+ * @param i
+ * the new wait time between retries
*/
@Override
public void setWaitTimeBetweenRetries(int i) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorRunInSeperateProcessImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorRunInSeperateProcessImpl.java
index dfbdb15..7e442e8 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorRunInSeperateProcessImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorRunInSeperateProcessImpl.java
@@ -25,12 +25,11 @@
import org.apache.uima.resource.metadata.impl.PropertyXmlInfo;
import org.apache.uima.resource.metadata.impl.XmlizationInfo;
-
/**
* The Class CasProcessorRunInSeperateProcessImpl.
*/
-public class CasProcessorRunInSeperateProcessImpl extends MetaDataObject_impl implements
- CasProcessorRunInSeperateProcess {
+public class CasProcessorRunInSeperateProcessImpl extends MetaDataObject_impl
+ implements CasProcessorRunInSeperateProcess {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1074137401279020375L;
@@ -47,7 +46,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CasProcessorRunInSeperateProcess#setExecutable(org.apache.uima.collection.metadata.CasProcessorExecutable)
+ * @see
+ * org.apache.uima.collection.metadata.CasProcessorRunInSeperateProcess#setExecutable(org.apache.
+ * uima.collection.metadata.CasProcessorExecutable)
*/
@Override
public void setExecutable(CasProcessorExecutable aExec) {
@@ -64,7 +65,9 @@
return exec;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -88,7 +91,8 @@
/**
* Sets the exec.
*
- * @param executable the new exec
+ * @param executable
+ * the new exec
*/
public void setExec(CasProcessorExecutable executable) {
exec = executable;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorRuntimeEnvParamImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorRuntimeEnvParamImpl.java
index a6e5a22..e68d477 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorRuntimeEnvParamImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorRuntimeEnvParamImpl.java
@@ -30,13 +30,12 @@
import org.w3c.dom.Element;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CasProcessorRuntimeEnvParamImpl.
*/
-public class CasProcessorRuntimeEnvParamImpl extends MetaDataObject_impl implements
- CasProcessorRuntimeEnvParam {
-
+public class CasProcessorRuntimeEnvParamImpl extends MetaDataObject_impl
+ implements CasProcessorRuntimeEnvParam {
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -6750487360818463790L;
@@ -55,7 +54,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CasProcessorRuntimeEnvParam#setEnvParamName(java.lang.String)
+ * @see org.apache.uima.collection.metadata.CasProcessorRuntimeEnvParam#setEnvParamName(java.lang.
+ * String)
*/
@Override
public void setEnvParamName(String aEnvParamName) throws CpeDescriptorException {
@@ -75,7 +75,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CasProcessorRuntimeEnvParam#setEnvParamValue(java.lang.String)
+ * @see
+ * org.apache.uima.collection.metadata.CasProcessorRuntimeEnvParam#setEnvParamValue(java.lang.
+ * String)
*/
@Override
public void setEnvParamValue(String aEnvParamValue) throws CpeDescriptorException {
@@ -95,10 +97,14 @@
/**
* Overridden to read "key" and "value" attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -125,7 +131,9 @@
return attrs;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -149,7 +157,8 @@
/**
* Sets the value.
*
- * @param string the new value
+ * @param string
+ * the new value
*/
public void setValue(String string) {
value = string;
@@ -167,7 +176,8 @@
/**
* Sets the key.
*
- * @param string the new key
+ * @param string
+ * the new key
*/
public void setKey(String string) {
key = string;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorTimeoutImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorTimeoutImpl.java
index 9a03611..00a92b8 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorTimeoutImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CasProcessorTimeoutImpl.java
@@ -29,12 +29,11 @@
import org.w3c.dom.Element;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CasProcessorTimeoutImpl.
*/
public class CasProcessorTimeoutImpl extends MetaDataObject_impl implements CasProcessorTimeout {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -8276573951395652039L;
@@ -73,10 +72,14 @@
/**
* Overridden to read "max" and "default" attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -103,7 +106,9 @@
return attrs;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -125,7 +130,7 @@
}
/**
- * PROTECTED METHODS USED BY THE PARSER.
+ * PROTECTED METHODS USED BY THE PARSER.
*
* @return the max
*/
@@ -148,7 +153,8 @@
/**
* Sets the default timeout.
*
- * @param string the new default timeout
+ * @param string
+ * the new default timeout
*/
public void setDefaultTimeout(String string) {
defaultTimeout = string;
@@ -157,7 +163,8 @@
/**
* Sets the max.
*
- * @param string the new max
+ * @param string
+ * the new max
*/
public void setMax(String string) {
max = string;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCasProcessorsImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCasProcessorsImpl.java
index 3577871..86de3dc 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCasProcessorsImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCasProcessorsImpl.java
@@ -40,12 +40,11 @@
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CpeCasProcessorsImpl.
*/
public class CpeCasProcessorsImpl extends MetaDataObject_impl implements CpeCasProcessors {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -5532660061637797550L;
@@ -139,8 +138,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CpeCasProcessors#addCpeCasProcessor(org.apache.uima.collection.metadata.CpeCasProcessor,
- * int)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessors#addCpeCasProcessor(org.apache.uima.
+ * collection.metadata.CpeCasProcessor, int)
*/
@Override
public void addCpeCasProcessor(CpeCasProcessor aCasProcessor, int aInsertPosition)
@@ -151,8 +150,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CpeCasProcessors#addCpeCasProcessor(org.apache.uima.collection.metadata.CpeCasProcessor,
- * int)
+ * @see org.apache.uima.collection.metadata.CpeCasProcessors#addCpeCasProcessor(org.apache.uima.
+ * collection.metadata.CpeCasProcessor, int)
*/
@Override
public void addCpeCasProcessor(CpeCasProcessor aCasProcessor) throws CpeDescriptorException {
@@ -190,8 +189,10 @@
/**
* Sets the all cpe cas processors.
*
- * @param aCpeProcessors the new all cpe cas processors
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @param aCpeProcessors
+ * the new all cpe cas processors
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
/*
* (non-Javadoc)
@@ -215,8 +216,7 @@
public void removeCpeCasProcessor(int aPosition) throws CpeDescriptorException {
if (aPosition <= casProcessors.size()) {
casProcessors.remove(aPosition);
- }
- else {
+ } else {
throw new CpeDescriptorException(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_invalid_array_index__WARNING",
new Object[] { Thread.currentThread().getName() }));
@@ -226,18 +226,20 @@
/**
* New API 01/06/2006.
*
- * @param aPosition the a position
- * @param flag the flag
+ * @param aPosition
+ * the a position
+ * @param flag
+ * the flag
* @return the cpe cas processor[]
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public CpeCasProcessor[] removeCpeCasProcessor(int aPosition, boolean flag)
throws CpeDescriptorException {
if (aPosition <= casProcessors.size()) {
casProcessors.remove(aPosition);
return getAllCpeCasProcessors();
- }
- else {
+ } else {
throw new CpeDescriptorException(CpmLocalizedMessage.getLocalizedMessage(
CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_EXP_invalid_array_index__WARNING",
new Object[] { Thread.currentThread().getName() }));
@@ -268,7 +270,8 @@
* Gets the pool size.
*
* @return the pool size
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
/*
* (non-Javadoc)
@@ -282,8 +285,10 @@
/**
* Sets the drop cas on exception.
*
- * @param aDropCasOnException the new drop cas on exception
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @param aDropCasOnException
+ * the new drop cas on exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
/*
* (non-Javadoc)
@@ -307,10 +312,14 @@
/**
* Overridden to read Cas Processor attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -321,9 +330,9 @@
setDropCasOnException(Boolean.valueOf(aElement.getAttribute("dropCasOnException")));
} catch (Exception e) {
throw new InvalidXMLException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING", new Object[] {
- Thread.currentThread().getName(), "casProcessors", "dropCasOnException",
- "casProcessors" });
+ "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), "casProcessors",
+ "dropCasOnException", "casProcessors" });
}
String cps = aElement.getAttribute("casPoolSize");
@@ -332,8 +341,8 @@
setPoolSize(Integer.parseInt(cps));
} catch (Exception e) {
throw new InvalidXMLException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING", new Object[] {
- Thread.currentThread().getName(), "casProcessors", "casPoolSize",
+ "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), "casProcessors", "casPoolSize",
"casProcessors" });
}
@@ -344,16 +353,16 @@
setConcurrentPUCount(Integer.parseInt(aElement.getAttribute("processingUnitThreadCount")));
} catch (Exception e) {
throw new InvalidXMLException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING", new Object[] {
- Thread.currentThread().getName(), "casProcessors", "processingUnitThreadCount",
- "casProcessors" });
+ "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), "casProcessors",
+ "processingUnitThreadCount", "casProcessors" });
}
} else {
throw new InvalidXMLException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
- "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING", new Object[] {
- Thread.currentThread().getName(), "casProcessors", "processingUnitThreadCount",
- "casProcessors" });
+ "UIMA_CPM_EXP_missing_attribute_from_xml_element__WARNING",
+ new Object[] { Thread.currentThread().getName(), "casProcessors",
+ "processingUnitThreadCount", "casProcessors" });
}
// populate inputQueueSize and outputQueueSize ONLY if casPoolSize is not defined.
// Both of these attributes have been deprecated and should not be used
@@ -405,7 +414,7 @@
}
}
// Continue to parse
- if ( cp != null ) {
+ if (cp != null) {
cp.buildFromXMLElement((Element) node, aParser, aOptions);
}
@@ -415,8 +424,12 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#toXML(org.xml.sax.ContentHandler, boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.resource.metadata.impl.MetaDataObject_impl#toXML(org.xml.sax.ContentHandler,
+ * boolean)
*/
@Override
public void toXML(ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute)
@@ -456,8 +469,8 @@
protected AttributesImpl getXMLAttributes() {
AttributesImpl attrs = super.getXMLAttributes();
if (isDropCasOnException() == true) {
- attrs.addAttribute("", "dropCasOnException", "dropCasOnException", "CDATA", String
- .valueOf(isDropCasOnException()));
+ attrs.addAttribute("", "dropCasOnException", "dropCasOnException", "CDATA",
+ String.valueOf(isDropCasOnException()));
}
attrs.addAttribute("", "casPoolSize", "casPoolSize", "CDATA", String.valueOf(getCasPoolSize()));
attrs.addAttribute("", "processingUnitThreadCount", "processingUnitThreadCount", "CDATA",
@@ -465,16 +478,18 @@
// populate inputQueueSize and outputQueueSize ONLY if casPoolSize is not defined.
// Both of these attributes have been deprecated and should not be used
if (getCasPoolSize() == 0) {
- attrs.addAttribute("", "inputQueueSize", "inputQueueSize", "CDATA", String
- .valueOf(getInputQueueSize()));
- attrs.addAttribute("", "outputQueueSize", "outputQueueSize", "CDATA", String
- .valueOf(getOutputQueueSize()));
+ attrs.addAttribute("", "inputQueueSize", "inputQueueSize", "CDATA",
+ String.valueOf(getInputQueueSize()));
+ attrs.addAttribute("", "outputQueueSize", "outputQueueSize", "CDATA",
+ String.valueOf(getOutputQueueSize()));
}
return attrs;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -486,7 +501,9 @@
static final private XmlizationInfo XMLIZATION_INFO = new XmlizationInfo("casProcessors",
new PropertyXmlInfo[] { new PropertyXmlInfo("allCpeCasProcessors", null), });
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeCasProcessors#getCasPoolSize()
*/
@Override
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCheckpointImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCheckpointImpl.java
index d276efc..2014fc9 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCheckpointImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCheckpointImpl.java
@@ -30,12 +30,11 @@
import org.w3c.dom.Element;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CpeCheckpointImpl.
*/
public class CpeCheckpointImpl extends MetaDataObject_impl implements CpeCheckpoint {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 9155094513948815121L;
@@ -87,7 +86,8 @@
/**
* Convert 2 number.
*
- * @param anObject the an object
+ * @param anObject
+ * the an object
* @return the int
*/
private int convert2Number(Object anObject) {
@@ -99,8 +99,7 @@
for (; i < len; i++) {
if (Character.isDigit(((String) anObject).charAt(i))) {
continue;
- }
- else {
+ } else {
break; // non-digit char
}
}
@@ -155,10 +154,14 @@
/**
* Overridden to read Checkpoint attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -193,7 +196,9 @@
return attrs;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -206,7 +211,7 @@
new PropertyXmlInfo[0]);
// METHODS CALLED BY THE PARSER
-
+
/**
* @return the batch size
*/
@@ -235,7 +240,8 @@
/**
* Sets the batch.
*
- * @param i the new batch
+ * @param i
+ * the new batch
*/
public void setBatch(int i) {
batch = i;
@@ -244,7 +250,8 @@
/**
* Sets the file.
*
- * @param string the new file
+ * @param string
+ * the new file
*/
public void setFile(String string) {
file = string;
@@ -253,7 +260,8 @@
/**
* Sets the time.
*
- * @param i the new time
+ * @param i
+ * the new time
*/
public void setTime(String i) {
time = i;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCollectionReaderCasInitializerImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCollectionReaderCasInitializerImpl.java
index 33f81d0..5b8fb9d 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCollectionReaderCasInitializerImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCollectionReaderCasInitializerImpl.java
@@ -32,16 +32,15 @@
import org.apache.uima.resource.metadata.impl.PropertyXmlInfo;
import org.apache.uima.resource.metadata.impl.XmlizationInfo;
-
/**
* The Class CpeCollectionReaderCasInitializerImpl.
*
* @deprecated As of v2.0, CAS Initializers are deprecated.
*/
@Deprecated
-public class CpeCollectionReaderCasInitializerImpl extends MetaDataObject_impl implements
- CpeCollectionReaderCasInitializer {
-
+public class CpeCollectionReaderCasInitializerImpl extends MetaDataObject_impl
+ implements CpeCollectionReaderCasInitializer {
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -6284616239685904940L;
@@ -66,7 +65,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CpeCollectionReaderCasInitializer#setDescriptorPath(java.lang.String)
+ * @see
+ * org.apache.uima.collection.metadata.CpeCollectionReaderCasInitializer#setDescriptorPath(java.
+ * lang.String)
*/
@Override
public void setDescriptor(CpeComponentDescriptor aDescriptor) {
@@ -96,8 +97,10 @@
/**
* Sets configuration parameter settings for this CasInitializer.
*
- * @param settings the new configuration parameter settings
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @param settings
+ * the new configuration parameter settings
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
@Override
public void setConfigurationParameterSettings(CasProcessorConfigurationParameterSettings settings)
@@ -111,8 +114,8 @@
org.apache.uima.resource.metadata.NameValuePair[] nvp = new NameValuePair_impl[settings
.getParameterSettings().length];
for (int i = 0; i < settings.getParameterSettings().length; i++) {
- nvp[i] = new NameValuePair_impl(settings.getParameterSettings()[i].getName(), settings
- .getParameterSettings()[i].getValue());
+ nvp[i] = new NameValuePair_impl(settings.getParameterSettings()[i].getName(),
+ settings.getParameterSettings()[i].getValue());
}
configurationParameterSettings.setParameterSettings(nvp);
}
@@ -147,7 +150,8 @@
/**
* Sets the parameter settings.
*
- * @param settings the new parameter settings
+ * @param settings
+ * the new parameter settings
*/
public void setParameterSettings(ConfigurationParameterSettings settings) {
configurationParameterSettings = settings;
@@ -157,7 +161,9 @@
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -169,8 +175,7 @@
static final private XmlizationInfo XMLIZATION_INFO = new XmlizationInfo("casInitializer",
new PropertyXmlInfo[] { new PropertyXmlInfo("descriptor", null),
new PropertyXmlInfo("parameterSettings", null),
- new PropertyXmlInfo("sofaNameMappings", null),
- });
+ new PropertyXmlInfo("sofaNameMappings", null), });
/**
* Gets the sofa name mappings.
@@ -185,7 +190,8 @@
/**
* Sets the sofa name mappings.
*
- * @param mappings the new sofa name mappings
+ * @param mappings
+ * the new sofa name mappings
*/
@Override
public void setSofaNameMappings(CpeSofaMappings mappings) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCollectionReaderImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCollectionReaderImpl.java
index 192da9c..5312695 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCollectionReaderImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCollectionReaderImpl.java
@@ -29,12 +29,11 @@
import org.apache.uima.resource.metadata.impl.PropertyXmlInfo;
import org.apache.uima.resource.metadata.impl.XmlizationInfo;
-
/**
* The Class CpeCollectionReaderImpl.
*/
public class CpeCollectionReaderImpl extends MetaDataObject_impl implements CpeCollectionReader {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -7663775553359776495L;
@@ -53,7 +52,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CpeCollectionReader#setCasInitializer(org.apache.uima.collection.metadata.CpeCollectionReaderCasInitializer)
+ * @see org.apache.uima.collection.metadata.CpeCollectionReader#setCasInitializer(org.apache.uima.
+ * collection.metadata.CpeCollectionReaderCasInitializer)
*/
@Override
public void setCasInitializer(CpeCollectionReaderCasInitializer aCasInitializer)
@@ -84,7 +84,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CpeCollectionReaderCasInitializer#setDescriptorPath(java.lang.String)
+ * @see
+ * org.apache.uima.collection.metadata.CpeCollectionReaderCasInitializer#setDescriptorPath(java.
+ * lang.String)
*/
@Override
public void setDescriptor(CpeComponentDescriptor aDescriptor) {
@@ -114,8 +116,10 @@
/**
* Sets configuration parameter settings for this CollectionReader.
*
- * @param aParams the new configuration parameter settings
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @param aParams
+ * the new configuration parameter settings
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
@Override
public void setConfigurationParameterSettings(CasProcessorConfigurationParameterSettings aParams)
@@ -123,7 +127,9 @@
collectionIterator.setConfigurationParameterSettings(aParams);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -139,14 +145,17 @@
/**
* Sets the collection iterator.
*
- * @param iterator the new collection iterator
+ * @param iterator
+ * the new collection iterator
*/
@Override
public void setCollectionIterator(CpeCollectionReaderIterator iterator) {
collectionIterator = iterator;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeCollectionReader#getCollectionIterator()
*/
@Override
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCollectionReaderIteratorImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCollectionReaderIteratorImpl.java
index 8b6316c..dbfd12a 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCollectionReaderIteratorImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeCollectionReaderIteratorImpl.java
@@ -31,13 +31,12 @@
import org.apache.uima.resource.metadata.impl.PropertyXmlInfo;
import org.apache.uima.resource.metadata.impl.XmlizationInfo;
-
/**
* The Class CpeCollectionReaderIteratorImpl.
*/
-public class CpeCollectionReaderIteratorImpl extends MetaDataObject_impl implements
- CpeCollectionReaderIterator {
-
+public class CpeCollectionReaderIteratorImpl extends MetaDataObject_impl
+ implements CpeCollectionReaderIterator {
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -9208074797482603808L;
@@ -66,14 +65,17 @@
/**
* Sets the descriptor.
*
- * @param descriptor the new descriptor
+ * @param descriptor
+ * the new descriptor
*/
@Override
public void setDescriptor(CpeComponentDescriptor descriptor) {
this.descriptor = descriptor;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -104,10 +106,12 @@
/**
* Sets the configuration parameter settings.
*
- * @param settings the new configuration parameter settings
+ * @param settings
+ * the new configuration parameter settings
*/
@Override
- public void setConfigurationParameterSettings(CasProcessorConfigurationParameterSettings settings) {
+ public void setConfigurationParameterSettings(
+ CasProcessorConfigurationParameterSettings settings) {
configurationParameterSettings = settings;
if (settings != null && settings.getParameterSettings() != null) {
int length = settings.getParameterSettings().length;
@@ -116,8 +120,8 @@
org.apache.uima.resource.metadata.NameValuePair[] nvp = new NameValuePair_impl[settings
.getParameterSettings().length];
for (int i = 0; i < settings.getParameterSettings().length; i++) {
- nvp[i] = new NameValuePair_impl(settings.getParameterSettings()[i].getName(), settings
- .getParameterSettings()[i].getValue());
+ nvp[i] = new NameValuePair_impl(settings.getParameterSettings()[i].getName(),
+ settings.getParameterSettings()[i].getValue());
}
configParameterSettings.setParameterSettings(nvp);
}
@@ -149,7 +153,8 @@
/**
* Sets the config parameter settings.
*
- * @param settings the new config parameter settings
+ * @param settings
+ * the new config parameter settings
*/
public void setConfigParameterSettings(ConfigurationParameterSettings settings) {
configParameterSettings = settings;
@@ -172,7 +177,8 @@
/**
* Sets the sofa name mappings.
*
- * @param mappings the new sofa name mappings
+ * @param mappings
+ * the new sofa name mappings
*/
@Override
public void setSofaNameMappings(CpeSofaMappings mappings) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeComponentDescriptorImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeComponentDescriptorImpl.java
index a8fe086..846510d 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeComponentDescriptorImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeComponentDescriptorImpl.java
@@ -33,19 +33,18 @@
import org.apache.uima.resource.metadata.impl.XmlizationInfo;
import org.apache.uima.util.InvalidXMLException;
-
/**
* The Class CpeComponentDescriptorImpl.
*/
-public class CpeComponentDescriptorImpl extends MetaDataObject_impl implements
- CpeComponentDescriptor {
-
+public class CpeComponentDescriptorImpl extends MetaDataObject_impl
+ implements CpeComponentDescriptor {
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1607312024379882416L;
/** The m include. */
private CpeInclude mInclude;
-
+
/** The m import. */
private Import mImport;
@@ -58,7 +57,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CpeComponentDescriptor#setInclude(org.apache.uima.collection.metadata.CpeInclude)
+ * @see org.apache.uima.collection.metadata.CpeComponentDescriptor#setInclude(org.apache.uima.
+ * collection.metadata.CpeInclude)
*/
@Override
public void setInclude(CpeInclude aInclude) {
@@ -74,10 +74,10 @@
public CpeInclude getInclude() {
return mInclude;
}
-
-
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeComponentDescriptor#getImport()
*/
@Override
@@ -85,47 +85,52 @@
return mImport;
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeComponentDescriptor#setImport(org.apache.uima.resource.metadata.Import)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.metadata.CpeComponentDescriptor#setImport(org.apache.uima.resource.
+ * metadata.Import)
*/
@Override
public void setImport(Import aImport) {
mImport = aImport;
}
-
+
/**
* Find absolute url.
*
- * @param aResourceManager the a resource manager
+ * @param aResourceManager
+ * the a resource manager
* @return the url
- * @throws ResourceConfigurationException the resource configuration exception
+ * @throws ResourceConfigurationException
+ * the resource configuration exception
* @see CpeComponentDescriptor#findAbsoluteUrl(ResourceManager)
*/
@Override
- public URL findAbsoluteUrl(ResourceManager aResourceManager) throws ResourceConfigurationException {
+ public URL findAbsoluteUrl(ResourceManager aResourceManager)
+ throws ResourceConfigurationException {
try {
if (mImport != null) {
return mImport.findAbsoluteUrl(aResourceManager);
- }
- else {
+ } else {
String path = mInclude.get();
- //replace ${CPM_HOME}
+ // replace ${CPM_HOME}
if (path.startsWith("${CPM_HOME}")) {
String cpmHome = System.getProperty("CPM_HOME");
path = cpmHome + path.substring("${CPM_HOME}".length());
}
try {
- //try path as a URL, then if that fails try it as a File
- //TODO: is there a good way to tell if it's a valid URL without
- //having to catch MalformedURLException?
- return new URL(path);
+ // try path as a URL, then if that fails try it as a File
+ // TODO: is there a good way to tell if it's a valid URL without
+ // having to catch MalformedURLException?
+ return new URL(path);
} catch (MalformedURLException e) {
try {
return new File(path).getAbsoluteFile().toURI().toURL();
- }
- catch(MalformedURLException e2) {
- throw new InvalidXMLException(InvalidXMLException.MALFORMED_IMPORT_URL, new Object[] {
- path, getSourceUrlString() }, e);
+ } catch (MalformedURLException e2) {
+ throw new InvalidXMLException(InvalidXMLException.MALFORMED_IMPORT_URL,
+ new Object[] { path, getSourceUrlString() }, e);
}
}
}
@@ -134,7 +139,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -144,8 +151,7 @@
/** The Constant XMLIZATION_INFO. */
static final private XmlizationInfo XMLIZATION_INFO = new XmlizationInfo("descriptor",
- new PropertyXmlInfo[] {
- new PropertyXmlInfo("include", null),
- new PropertyXmlInfo("import", null)});
+ new PropertyXmlInfo[] { new PropertyXmlInfo("include", null),
+ new PropertyXmlInfo("import", null) });
}
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeConfigurationImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeConfigurationImpl.java
index 34642da..e866578 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeConfigurationImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeConfigurationImpl.java
@@ -28,12 +28,11 @@
import org.apache.uima.resource.metadata.impl.PropertyXmlInfo;
import org.apache.uima.resource.metadata.impl.XmlizationInfo;
-
/**
* The Class CpeConfigurationImpl.
*/
public class CpeConfigurationImpl extends MetaDataObject_impl implements CpeConfiguration {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1153815602567127240L;
@@ -101,7 +100,9 @@
return (int) num2Process;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeConfiguration#setStartingEntityId(java.lang.String)
*/
@Override
@@ -122,7 +123,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CpeConfiguration#setCheckpoint(org.apache.uima.collection.metadata.CpeCheckpoint)
+ * @see
+ * org.apache.uima.collection.metadata.CpeConfiguration#setCheckpoint(org.apache.uima.collection.
+ * metadata.CpeCheckpoint)
*/
@Override
public void setCheckpoint(CpeCheckpoint aCheckpoint) throws CpeDescriptorException {
@@ -152,7 +155,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.collection.metadata.CpeConfiguration#setCpeTimer(org.apache.uima.collection.metadata.CpeTimer)
+ * @see
+ * org.apache.uima.collection.metadata.CpeConfiguration#setCpeTimer(org.apache.uima.collection.
+ * metadata.CpeTimer)
*/
@Override
public void setCpeTimer(CpeTimer aTimer) {
@@ -206,7 +211,9 @@
return startAt;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeConfiguration#getTimerImpl()
*/
@Override
@@ -217,7 +224,8 @@
/**
* Sets the deploy as.
*
- * @param string the new deploy as
+ * @param string
+ * the new deploy as
*/
public void setDeployAs(String string) {
deployAs = string;
@@ -226,7 +234,8 @@
/**
* Sets the num to process.
*
- * @param l the new num to process
+ * @param l
+ * the new num to process
*/
public void setNumToProcess(long l) {
num2Process = l;
@@ -235,7 +244,8 @@
/**
* Sets the start at.
*
- * @param aStartAt the new start at
+ * @param aStartAt
+ * the new start at
*/
public void setStartAt(String aStartAt) {
@@ -245,13 +255,16 @@
/**
* Sets the timer impl.
*
- * @param string the new timer impl
+ * @param string
+ * the new timer impl
*/
public void setTimerImpl(String string) {
timerImpl = string;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeConfiguration#getOutputQueue()
*/
@Override
@@ -259,7 +272,9 @@
return outputQueue;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeConfiguration#getMaxTimeToWait()
*/
@Override
@@ -273,13 +288,16 @@
/**
* Sets the output queue.
*
- * @param queue the new output queue
+ * @param queue
+ * the new output queue
*/
public void setOutputQueue(OutputQueue queue) {
outputQueue = queue;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeDescriptionImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeDescriptionImpl.java
index 5d465fc..72097e9 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeDescriptionImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeDescriptionImpl.java
@@ -38,12 +38,11 @@
import org.apache.uima.util.XMLParser.ParsingOptions;
import org.w3c.dom.Element;
-
/**
* The Class CpeDescriptionImpl.
*/
public class CpeDescriptionImpl extends MetaDataObject_impl implements CpeDescription {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -8068920415609241198L;
@@ -68,10 +67,12 @@
/**
* Instantiates a new cpe description impl.
*
- * @param aInput the a input
- * @throws InvalidXMLException the invalid XML exception
+ * @param aInput
+ * the a input
+ * @throws InvalidXMLException
+ * the invalid XML exception
*/
- /*
+ /*
* This is needed for XMLParser.parseCpeDesription() to work. Typically users should use
* CpeDescriptorFactory.produceDescriptor() instead. - APL
*/
@@ -114,8 +115,11 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeDescription#addCollectionReader(org.apache.uima.collection.metadata.CpeCollectionReader)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.collection.metadata.CpeDescription#addCollectionReader(org.apache.uima.
+ * collection.metadata.CpeCollectionReader)
*/
@Override
public void addCollectionReader(CpeCollectionReader aCollectionReader)
@@ -123,7 +127,9 @@
collectionReader = aCollectionReader;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeDescription#addCollectionReader(java.lang.String)
*/
@Override
@@ -140,14 +146,16 @@
/**
* Adds the cas initializer.
*
- * @param aInitializerDescriptorPath the a initializer descriptor path
+ * @param aInitializerDescriptorPath
+ * the a initializer descriptor path
* @return the cpe collection reader cas initializer
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
* @deprecated As of v2.0, CAS Initializers are deprecated.
*/
@Override
@Deprecated
-public CpeCollectionReaderCasInitializer addCasInitializer(String aInitializerDescriptorPath)
+ public CpeCollectionReaderCasInitializer addCasInitializer(String aInitializerDescriptorPath)
throws CpeDescriptorException {
if (collectionReader == null) {
collectionReader = CpeDescriptorFactory.produceCollectionReader();
@@ -156,13 +164,15 @@
collectionReader.setCasInitializer(CpeDescriptorFactory
.produceCollectionReaderCasInitializer(aInitializerDescriptorPath, this));
} else {
- collectionReader.getCasInitializer().getDescriptor().getInclude().set(
- aInitializerDescriptorPath);
+ collectionReader.getCasInitializer().getDescriptor().getInclude()
+ .set(aInitializerDescriptorPath);
}
return collectionReader.getCasInitializer();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeDescription#getAllCollectionCollectionReaders()
*/
@Override
@@ -175,22 +185,29 @@
return readers;
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeDescription#setAllCollectionCollectionReaders(org.apache.uima.collection.metadata.CpeCollectionReader[])
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.metadata.CpeDescription#setAllCollectionCollectionReaders(org.apache
+ * .uima.collection.metadata.CpeCollectionReader[])
*/
@Override
public void setAllCollectionCollectionReaders(CpeCollectionReader[] areaders)
throws CpeDescriptorException {
if (areaders == null || areaders.length == 0) {
collectionReader = null;
- }
- else {
+ } else {
collectionReader = areaders[0];
}
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeDescription#setResourceManagerConfiguration(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.metadata.CpeDescription#setResourceManagerConfiguration(java.lang.
+ * String)
*/
@Override
public void setResourceManagerConfiguration(String aResMgrConfPagth) {
@@ -199,8 +216,11 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeDescription#setCpeResourceManagerConfiguration(org.apache.uima.collection.metadata.CpeResourceManagerConfiguration)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.collection.metadata.CpeDescription#setCpeResourceManagerConfiguration(org.
+ * apache.uima.collection.metadata.CpeResourceManagerConfiguration)
*/
@Override
public void setCpeResourceManagerConfiguration(CpeResourceManagerConfiguration aResMgrConfPagth) {
@@ -219,9 +239,11 @@
/**
* Sets the input queue size.
*
- * @param aSize the new input queue size
- * @throws CpeDescriptorException the cpe descriptor exception
- * @deprecated
+ * @param aSize
+ * the new input queue size
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
+ * @deprecated
*/
@Override
@Deprecated
@@ -232,7 +254,9 @@
casProcessors.setInputQueueSize(aSize);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeDescription#setProcessingUnitThreadCount(int)
*/
@Override
@@ -246,9 +270,11 @@
/**
* Sets the output queue size.
*
- * @param aSize the new output queue size
- * @throws CpeDescriptorException the cpe descriptor exception
- * @deprecated
+ * @param aSize
+ * the new output queue size
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
+ * @deprecated
*/
@Override
@Deprecated
@@ -259,15 +285,20 @@
casProcessors.setOutputQueueSize(aSize);
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeDescription#setCpeCasProcessors(org.apache.uima.collection.metadata.CpeCasProcessors)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.collection.metadata.CpeDescription#setCpeCasProcessors(org.apache.uima.
+ * collection.metadata.CpeCasProcessors)
*/
@Override
public void setCpeCasProcessors(CpeCasProcessors aCasProcessors) {
casProcessors = aCasProcessors;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeDescription#getCpeCasProcessors()
*/
@Override
@@ -275,8 +306,12 @@
return casProcessors;
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeDescription#addCasProcessor(org.apache.uima.collection.metadata.CpeCasProcessor)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.metadata.CpeDescription#addCasProcessor(org.apache.uima.collection.
+ * metadata.CpeCasProcessor)
*/
@Override
public void addCasProcessor(CpeCasProcessor aCasProcessor) throws CpeDescriptorException {
@@ -286,8 +321,11 @@
casProcessors.addCpeCasProcessor(aCasProcessor);
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeDescription#addCasProcessor(int, org.apache.uima.collection.metadata.CpeCasProcessor)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.collection.metadata.CpeDescription#addCasProcessor(int,
+ * org.apache.uima.collection.metadata.CpeCasProcessor)
*/
@Override
public void addCasProcessor(int index, CpeCasProcessor aCasProcessor)
@@ -300,15 +338,20 @@
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeDescription#setCpeConfiguration(org.apache.uima.collection.metadata.CpeConfiguration)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.collection.metadata.CpeDescription#setCpeConfiguration(org.apache.uima.
+ * collection.metadata.CpeConfiguration)
*/
@Override
public void setCpeConfiguration(CpeConfiguration aConfiguration) {
cpeConfiguration = aConfiguration;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeDescription#getCpeConfiguration()
*/
@Override
@@ -319,7 +362,8 @@
/**
* Sets the cpe config.
*
- * @param aConfiguration the new cpe config
+ * @param aConfiguration
+ * the new cpe config
*/
public void setCpeConfig(CpeConfiguration aConfiguration) {
cpeConfiguration = aConfiguration;
@@ -329,13 +373,16 @@
* Gets the cpe config.
*
* @return the cpe config
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public CpeConfiguration getCpeConfig() throws CpeDescriptorException {
return cpeConfiguration;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeDescription#setCheckpoint(java.lang.String, int)
*/
@Override
@@ -350,7 +397,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeDescription#setDeployment(java.lang.String)
*/
@Override
@@ -364,7 +413,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeDescription#setNumToProcess(long)
*/
@Override
@@ -378,7 +429,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeDescription#setStartingEntityId(java.lang.String)
*/
@Override
@@ -392,7 +445,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeDescription#setTimer(java.lang.String)
*/
@Override
@@ -406,7 +461,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeDescription#getResourceManagerConfiguration()
*/
@Override
@@ -417,9 +474,9 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#readUnknownPropertyValueFromXMLElement(org.w3c.dom.Element,
- * org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions,
- * java.util.List)
+ * @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#
+ * readUnknownPropertyValueFromXMLElement(org.w3c.dom.Element, org.apache.uima.util.XMLParser,
+ * org.apache.uima.util.XMLParser.ParsingOptions, java.util.List)
*/
@Override
protected void readUnknownPropertyValueFromXMLElement(Element aElement, XMLParser aParser,
@@ -428,13 +485,14 @@
resourceMgrConfig = new CpeResourceManagerConfigurationImpl();
resourceMgrConfig.buildFromXMLElement(aElement, aParser, aOptions);
} else {
- super
- .readUnknownPropertyValueFromXMLElement(aElement, aParser, aOptions,
- aKnownPropertyNames);
+ super.readUnknownPropertyValueFromXMLElement(aElement, aParser, aOptions,
+ aKnownPropertyNames);
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -445,8 +503,7 @@
/** The Constant XMLIZATION_INFO. */
static final private XmlizationInfo XMLIZATION_INFO = new XmlizationInfo("cpeDescription",
new PropertyXmlInfo[] { new PropertyXmlInfo("allCollectionCollectionReaders", null),
- new PropertyXmlInfo("cpeCasProcessors", null),
- new PropertyXmlInfo("cpeConfig", null),
+ new PropertyXmlInfo("cpeCasProcessors", null), new PropertyXmlInfo("cpeConfig", null),
new PropertyXmlInfo("cpeResourceManagerConfiguration", null),
});
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeDescriptorFactory.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeDescriptorFactory.java
index ecf35b5..f7e1890 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeDescriptorFactory.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeDescriptorFactory.java
@@ -56,7 +56,6 @@
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.XMLInputSource;
-
/**
* Factory class for creating CpeDescriptors and their constituent objects.
*
@@ -118,7 +117,8 @@
throw new InvalidXMLException(e);
}
- throw new InvalidXMLException(new Exception("Unexpected Object Type Produced By the XMLParser"));
+ throw new InvalidXMLException(
+ new Exception("Unexpected Object Type Produced By the XMLParser"));
}
/**
@@ -139,10 +139,13 @@
/**
* Produce collection reader.
*
- * @param aCollectionReaderDescriptorPath a path to the collection reader descriptor
- * @param aDescriptor the descriptor to associate the collection reader with
+ * @param aCollectionReaderDescriptorPath
+ * a path to the collection reader descriptor
+ * @param aDescriptor
+ * the descriptor to associate the collection reader with
* @return the CPE Collection Reader
- * @throws CpeDescriptorException if there is a failure
+ * @throws CpeDescriptorException
+ * if there is a failure
*/
public static CpeCollectionReader produceCollectionReader(String aCollectionReaderDescriptorPath,
CpeDescription aDescriptor) throws CpeDescriptorException {
@@ -162,9 +165,11 @@
/**
* Produce collection reader.
*
- * @param aCollectionReaderDescriptorPath the a collection reader descriptor path
+ * @param aCollectionReaderDescriptorPath
+ * the a collection reader descriptor path
* @return the cpe collection reader
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public static CpeCollectionReader produceCollectionReader(String aCollectionReaderDescriptorPath)
throws CpeDescriptorException {
@@ -177,7 +182,8 @@
* Produce collection reader.
*
* @return the cpe collection reader
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public static CpeCollectionReader produceCollectionReader() throws CpeDescriptorException {
CpeCollectionReader colR = new CpeCollectionReaderImpl();
@@ -188,9 +194,11 @@
/**
* Produce collection reader iterator.
*
- * @param aPath the a path
+ * @param aPath
+ * the a path
* @return the cpe collection reader iterator
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public static CpeCollectionReaderIterator produceCollectionReaderIterator(String aPath)
throws CpeDescriptorException {
@@ -202,14 +210,17 @@
/**
* Produce collection reader cas initializer.
*
- * @param aPath don't use
- * @param aDescriptor don't use
+ * @param aPath
+ * don't use
+ * @param aDescriptor
+ * don't use
* @return a CPE Collection Reader CAS Initializer
- * @throws CpeDescriptorException passed thru
+ * @throws CpeDescriptorException
+ * passed thru
* @deprecated As of v2.0, CAS Initializers are deprecated.
*/
@Deprecated
-public static CpeCollectionReaderCasInitializer produceCollectionReaderCasInitializer(
+ public static CpeCollectionReaderCasInitializer produceCollectionReaderCasInitializer(
String aPath, CpeDescription aDescriptor) throws CpeDescriptorException {
if (aDescriptor == null) {
aDescriptor = produceDescriptor();
@@ -222,12 +233,13 @@
/**
* Produce collection reader cas initializer.
*
- * @param aInitializerDescriptorPath path to the initializer descriptor
+ * @param aInitializerDescriptorPath
+ * path to the initializer descriptor
* @return CPE Collection Reader CAS Initializer
* @deprecated As of v2.0, CAS Initializers are deprecated.
*/
@Deprecated
-protected static CpeCollectionReaderCasInitializer produceCollectionReaderCasInitializer(
+ protected static CpeCollectionReaderCasInitializer produceCollectionReaderCasInitializer(
String aInitializerDescriptorPath) {
try {
return produceCollectionReaderCasInitializer(aInitializerDescriptorPath, null);
@@ -240,7 +252,8 @@
/**
* Produce component descriptor.
*
- * @param aPath The path to the the CPE component Descriptor
+ * @param aPath
+ * The path to the the CPE component Descriptor
* @return the CPE Component Description
*/
public static CpeComponentDescriptor produceComponentDescriptor(String aPath) {
@@ -255,9 +268,11 @@
/**
* Produce cpe configuration.
*
- * @param aDescriptor CPE descriptor to use
+ * @param aDescriptor
+ * CPE descriptor to use
* @return the Cpe Configuration
- * @throws CpeDescriptorException if it fails
+ * @throws CpeDescriptorException
+ * if it fails
*/
public static CpeConfiguration produceCpeConfiguration(CpeDescription aDescriptor)
throws CpeDescriptorException {
@@ -273,7 +288,8 @@
* Produce cpe configuration.
*
* @return the cpe configuration
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public static CpeConfiguration produceCpeConfiguration() throws CpeDescriptorException {
return new CpeConfigurationImpl();
@@ -319,9 +335,11 @@
/**
* Produce cas processors.
*
- * @param aDescriptor to use to produce the CPE CAS Processors
+ * @param aDescriptor
+ * to use to produce the CPE CAS Processors
* @return Cpe CAS Processors
- * @throws CpeDescriptorException if an error occurs
+ * @throws CpeDescriptorException
+ * if an error occurs
*/
public static CpeCasProcessors produceCasProcessors(CpeDescription aDescriptor)
throws CpeDescriptorException {
@@ -337,7 +355,8 @@
* Produce cas processors.
*
* @return the cpe cas processors
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public static CpeCasProcessors produceCasProcessors() throws CpeDescriptorException {
return new CpeCasProcessorsImpl();
@@ -346,12 +365,17 @@
/**
* Produce cas processors.
*
- * @param aInputQSize the input queue size
- * @param aOutputQSize the output queue size
- * @param aPuCount the number of processing units
- * @param aDescriptor the CPE descriptor
+ * @param aInputQSize
+ * the input queue size
+ * @param aOutputQSize
+ * the output queue size
+ * @param aPuCount
+ * the number of processing units
+ * @param aDescriptor
+ * the CPE descriptor
* @return CPE CAS Processors
- * @throws CpeDescriptorException if an error occurs
+ * @throws CpeDescriptorException
+ * if an error occurs
*/
public static CpeCasProcessors produceCasProcessors(int aInputQSize, int aOutputQSize,
int aPuCount, CpeDescription aDescriptor) throws CpeDescriptorException {
@@ -369,7 +393,8 @@
/**
* Produce cas processor.
*
- * @param aName the a name
+ * @param aName
+ * the a name
* @return the cpe integrated cas processor
*/
// Default deployment=integrated
@@ -386,10 +411,13 @@
/**
* Produce local cas processor.
*
- * @param aName the processor name
- * @param aSoFa the processor SofA
+ * @param aName
+ * the processor name
+ * @param aSoFa
+ * the processor SofA
* @return CPE Local CAS Processor
- * @throws CpeDescriptorException if an error occurs
+ * @throws CpeDescriptorException
+ * if an error occurs
*/
public static CpeLocalCasProcessor produceLocalCasProcessor(String aName, String aSoFa)
throws CpeDescriptorException {
@@ -402,9 +430,11 @@
/**
* Produce remote cas processor.
*
- * @param aName the processor name
+ * @param aName
+ * the processor name
* @return CPE Remote CAS Processor
- * @throws CpeDescriptorException if an error occurs
+ * @throws CpeDescriptorException
+ * if an error occurs
*/
public static CpeRemoteCasProcessor produceRemoteCasProcessor(String aName)
throws CpeDescriptorException {
@@ -416,7 +446,8 @@
/**
* Produce cpe timer.
*
- * @param aTimerClass the a timer class
+ * @param aTimerClass
+ * the a timer class
* @return the cpe timer
*/
public static CpeTimer produceCpeTimer(String aTimerClass) {
@@ -426,10 +457,13 @@
/**
* Produce resource manager configuration.
*
- * @param aResourceMgrConfigurationPath the a resource mgr configuration path
- * @param aDescriptor the a descriptor
+ * @param aResourceMgrConfigurationPath
+ * the a resource mgr configuration path
+ * @param aDescriptor
+ * the a descriptor
* @return the cpe resource manager configuration
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public static CpeResourceManagerConfiguration produceResourceManagerConfiguration(
String aResourceMgrConfigurationPath, CpeDescription aDescriptor)
@@ -437,7 +471,8 @@
if (aDescriptor == null) {
aDescriptor = produceDescriptor();
}
- CpeResourceManagerConfiguration resMgr = produceResourceManagerConfiguration(aResourceMgrConfigurationPath);
+ CpeResourceManagerConfiguration resMgr = produceResourceManagerConfiguration(
+ aResourceMgrConfigurationPath);
aDescriptor.setCpeResourceManagerConfiguration(resMgr);
return resMgr;
}
@@ -445,9 +480,11 @@
/**
* Produce resource manager configuration.
*
- * @param aResourceMgrConfigurationPath the a resource mgr configuration path
+ * @param aResourceMgrConfigurationPath
+ * the a resource mgr configuration path
* @return the cpe resource manager configuration
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public static CpeResourceManagerConfiguration produceResourceManagerConfiguration(
String aResourceMgrConfigurationPath) throws CpeDescriptorException {
@@ -486,7 +523,8 @@
/**
* Produce cas processor filter.
*
- * @param aFilter the filter string
+ * @param aFilter
+ * the filter string
* @return a CAS Processor Filter
*/
public static CasProcessorFilter produceCasProcessorFilter(String aFilter) {
@@ -530,7 +568,7 @@
public static CasProcessorExecArg produceCasProcessorExecArg() {
return new CasProcessorExecArgImpl();
}
-
+
/**
* Produce cas processor executable.
*
@@ -575,7 +613,7 @@
public static CpeSofaMapping produceSofaMapping() {
return new CpeSofaMappingImpl();
}
-
+
/**
* Produce sofa mappings.
*
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeIncludeImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeIncludeImpl.java
index d222e1e..f40aa07 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeIncludeImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeIncludeImpl.java
@@ -29,12 +29,11 @@
import org.w3c.dom.Element;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CpeIncludeImpl.
*/
public class CpeIncludeImpl extends MetaDataObject_impl implements CpeInclude {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 5694100109656286384L;
@@ -70,10 +69,14 @@
/**
* Overridden to read "href" attribute.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -97,7 +100,9 @@
return attrs;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -114,7 +119,7 @@
*
* @return the href
*/
- /* METHODS CALLED BY THE PARSER * */
+ /* METHODS CALLED BY THE PARSER * */
public String getHref() {
return href;
}
@@ -122,7 +127,8 @@
/**
* Sets the href.
*
- * @param string the new href
+ * @param string
+ * the new href
*/
public void setHref(String string) {
href = string;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeIntegratedCasProcessorImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeIntegratedCasProcessorImpl.java
index 3705c44..16d3e1c 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeIntegratedCasProcessorImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeIntegratedCasProcessorImpl.java
@@ -22,13 +22,12 @@
import org.apache.uima.collection.metadata.CasProcessorDeploymentParams;
import org.apache.uima.collection.metadata.CpeIntegratedCasProcessor;
-
/**
* The Class CpeIntegratedCasProcessorImpl.
*/
-public class CpeIntegratedCasProcessorImpl extends CasProcessorCpeObject implements
- CpeIntegratedCasProcessor {
-
+public class CpeIntegratedCasProcessorImpl extends CasProcessorCpeObject
+ implements CpeIntegratedCasProcessor {
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 6076012896926381047L;
@@ -47,7 +46,9 @@
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.metadata.cpe.CasProcessorCpeObject#addDefaults()
*/
@Override
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeLocalCasProcessorImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeLocalCasProcessorImpl.java
index 7eec10c..5af5745 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeLocalCasProcessorImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeLocalCasProcessorImpl.java
@@ -31,11 +31,11 @@
import org.apache.uima.collection.metadata.CpeLocalCasProcessor;
import org.apache.uima.collection.metadata.NameValuePair;
-
/**
* The Class CpeLocalCasProcessorImpl.
*/
-public class CpeLocalCasProcessorImpl extends CasProcessorCpeObject implements CpeLocalCasProcessor {
+public class CpeLocalCasProcessorImpl extends CasProcessorCpeObject
+ implements CpeLocalCasProcessor {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -2239520502855587544L;
@@ -56,7 +56,8 @@
/**
* Instantiates a new cpe local cas processor impl.
*
- * @param initializeWithDefaultValues the initialize with default values
+ * @param initializeWithDefaultValues
+ * the initialize with default values
*/
public CpeLocalCasProcessorImpl(boolean initializeWithDefaultValues) {
try {
@@ -73,9 +74,12 @@
/**
* Instantiates a new cpe local cas processor impl.
*
- * @param aName the a name
- * @param aSoFa the a so fa
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @param aName
+ * the a name
+ * @param aSoFa
+ * the a so fa
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
protected CpeLocalCasProcessorImpl(String aName, String aSoFa) throws CpeDescriptorException {
try {
@@ -93,7 +97,8 @@
* Gets the base run in seperate process.
*
* @return the base run in seperate process
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
private CasProcessorRunInSeperateProcess getBaseRunInSeperateProcess()
throws CpeDescriptorException {
@@ -108,7 +113,9 @@
return sepProcess;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeLocalCasProcessor#addExecArg(java.lang.String)
*/
@Override
@@ -123,8 +130,10 @@
/**
* Removes the exec arg.
*
- * @param aIndex the a index
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @param aIndex
+ * the a index
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public void removeExecArg(int aIndex) throws CpeDescriptorException {
CasProcessorRunInSeperateProcess rip = getRunInSeparateProcess();
@@ -140,7 +149,8 @@
* Gets the exec args.
*
* @return the exec args
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public List getExecArgs() throws CpeDescriptorException {
ArrayList list = new ArrayList();
@@ -158,7 +168,9 @@
return list;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.metadata.cpe.CasProcessorCpeObject#addDefaults()
*/
@Override
@@ -212,9 +224,12 @@
* Adds a new env key to the list of env keys. If a kay with a given key name exists the new key
* value replaces the old.
*
- * @param aEnvKeyName the a env key name
- * @param aEnvKeyValue the a env key value
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @param aEnvKeyName
+ * the a env key name
+ * @param aEnvKeyValue
+ * the a env key value
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
@Override
public void addExecEnv(String aEnvKeyName, String aEnvKeyValue) throws CpeDescriptorException {
@@ -248,7 +263,8 @@
* Gets the exec env.
*
* @return the exec env
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public List getExecEnv() throws CpeDescriptorException {
CasProcessorRunInSeperateProcess rip = getRunInSeparateProcess();
@@ -264,8 +280,10 @@
/**
* Removes the exec env.
*
- * @param aIndex the a index
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @param aIndex
+ * the a index
+ * @throws CpeDescriptorException
+ * the cpe descriptor exception
*/
public void removeExecEnv(int aIndex) throws CpeDescriptorException {
CasProcessorRunInSeperateProcess rip = getRunInSeparateProcess();
@@ -280,7 +298,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeLocalCasProcessor#setExecutable(java.lang.String)
*/
@Override
@@ -294,7 +314,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeLocalCasProcessor#getExecutable()
*/
@Override
@@ -326,8 +348,12 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.metadata.CpeLocalCasProcessor#setRunInSeperateProcess(org.apache.uima.collection.metadata.CasProcessorRunInSeperateProcess)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.metadata.CpeLocalCasProcessor#setRunInSeperateProcess(org.apache.
+ * uima.collection.metadata.CasProcessorRunInSeperateProcess)
*/
@Override
public void setRunInSeperateProcess(CasProcessorRunInSeperateProcess aSepProcess)
@@ -335,7 +361,9 @@
super.setRunInSeparateProcess(aSepProcess);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.CpeLocalCasProcessor#getRunInSeperateProcess()
*/
@Override
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeObject.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeObject.java
index 7790bf6..e80d1aa 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeObject.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeObject.java
@@ -19,19 +19,19 @@
package org.apache.uima.collection.impl.metadata.cpe;
-
/**
* The Class CpeObject.
*/
public class CpeObject {
-
+
/** The internal object. */
private Object internalObject = null;
/**
* Instantiates a new cpe object.
*
- * @param aObject the a object
+ * @param aObject
+ * the a object
*/
protected CpeObject(Object aObject) {
internalObject = aObject;
@@ -40,7 +40,8 @@
/**
* Sets the.
*
- * @param aObject the a object
+ * @param aObject
+ * the a object
*/
protected void set(Object aObject) {
internalObject = aObject;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeRemoteCasProcessorImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeRemoteCasProcessorImpl.java
index ab51fda..1bd47c4 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeRemoteCasProcessorImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeRemoteCasProcessorImpl.java
@@ -22,13 +22,12 @@
import org.apache.uima.collection.metadata.CasProcessorDeploymentParams;
import org.apache.uima.collection.metadata.CpeRemoteCasProcessor;
-
/**
* The Class CpeRemoteCasProcessorImpl.
*/
-public class CpeRemoteCasProcessorImpl extends CasProcessorCpeObject implements
- CpeRemoteCasProcessor {
-
+public class CpeRemoteCasProcessorImpl extends CasProcessorCpeObject
+ implements CpeRemoteCasProcessor {
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -1290194910813284905L;
@@ -44,8 +43,9 @@
}
}
-
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.impl.metadata.cpe.CasProcessorCpeObject#addDefaults()
*/
@Override
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeResourceManagerConfigurationImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeResourceManagerConfigurationImpl.java
index e775d31..73079eb 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeResourceManagerConfigurationImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeResourceManagerConfigurationImpl.java
@@ -29,13 +29,12 @@
import org.w3c.dom.Element;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CpeResourceManagerConfigurationImpl.
*/
-public class CpeResourceManagerConfigurationImpl extends MetaDataObject_impl implements
- CpeResourceManagerConfiguration {
-
+public class CpeResourceManagerConfigurationImpl extends MetaDataObject_impl
+ implements CpeResourceManagerConfiguration {
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -8905321767282361433L;
@@ -71,10 +70,14 @@
/**
* Overridden to read "href" attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -104,7 +107,9 @@
static final private XmlizationInfo XMLIZATION_INFO = new XmlizationInfo(
"resourceManagerConfiguration", new PropertyXmlInfo[0]);
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -124,7 +129,8 @@
/**
* Sets the href.
*
- * @param string the new href
+ * @param string
+ * the new href
*/
public void setHref(String string) {
href = string;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeSofaMappingImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeSofaMappingImpl.java
index 7b97039..362cdce 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeSofaMappingImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeSofaMappingImpl.java
@@ -30,12 +30,11 @@
import org.w3c.dom.NamedNodeMap;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CpeSofaMappingImpl.
*/
public class CpeSofaMappingImpl extends MetaDataObject_impl implements CpeSofaMapping {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -2488866857646083657L;
@@ -45,7 +44,9 @@
/** The cpe sofa name. */
private String cpeSofaName;
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -83,10 +84,14 @@
/**
* Overridden to read "name" and "value" attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -122,7 +127,8 @@
/**
* Sets the component sofa name.
*
- * @param string the new component sofa name
+ * @param string
+ * the new component sofa name
*/
@Override
public void setComponentSofaName(String string) {
@@ -132,7 +138,8 @@
/**
* Sets the cpe sofa name.
*
- * @param string the new cpe sofa name
+ * @param string
+ * the new cpe sofa name
*/
@Override
public void setCpeSofaName(String string) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeSofaMappingsImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeSofaMappingsImpl.java
index ff9b91b..2fa01ac 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeSofaMappingsImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeSofaMappingsImpl.java
@@ -37,19 +37,20 @@
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class CpeSofaMappingsImpl.
*/
public class CpeSofaMappingsImpl extends MetaDataObject_impl implements CpeSofaMappings {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -4193487704594409253L;
/** The sofa name mappings. */
private ArrayList sofaNameMappings = new ArrayList();
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -60,10 +61,14 @@
/**
* Overridden to read "name" and "value" attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -89,8 +94,12 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#toXML(org.xml.sax.ContentHandler, boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.resource.metadata.impl.MetaDataObject_impl#toXML(org.xml.sax.ContentHandler,
+ * boolean)
*/
@Override
public void toXML(ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute)
@@ -138,7 +147,8 @@
/**
* Sets the sofa name mappings.
*
- * @param sofaMappings the new sofa name mappings
+ * @param sofaMappings
+ * the new sofa name mappings
*/
@Override
public void setSofaNameMappings(CpeSofaMapping[] sofaMappings) {
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeTimerImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeTimerImpl.java
index 7310f16..7898b31 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeTimerImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/CpeTimerImpl.java
@@ -22,13 +22,12 @@
import org.apache.uima.collection.metadata.CpeDescriptorException;
import org.apache.uima.collection.metadata.CpeTimer;
-
/**
* This class provides an API to plug in custom timers.
*
*/
public class CpeTimerImpl implements CpeTimer {
-
+
/**
* Instantiates a new cpe timer impl.
*/
@@ -41,7 +40,8 @@
/**
* Instantiates a new cpe timer impl.
*
- * @param aTimerClass the a timer class
+ * @param aTimerClass
+ * the a timer class
*/
public CpeTimerImpl(String aTimerClass) {
timer = aTimerClass;
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/NameValuePairImpl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/NameValuePairImpl.java
index e53472d..bd757be 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/NameValuePairImpl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/NameValuePairImpl.java
@@ -21,12 +21,11 @@
import org.apache.uima.collection.metadata.NameValuePair;
-
/**
* The Class NameValuePairImpl.
*/
public class NameValuePairImpl implements NameValuePair {
-
+
/** The name. */
private String name;
@@ -42,15 +41,19 @@
/**
* Instantiates a new name value pair impl.
*
- * @param aName the a name
- * @param aValue the a value
+ * @param aName
+ * the a name
+ * @param aValue
+ * the a value
*/
public NameValuePairImpl(String aName, Object aValue) {
name = aName;
value = aValue;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.NameValuePair#getName()
*/
@Override
@@ -58,7 +61,9 @@
return name;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.NameValuePair#setName(java.lang.String)
*/
@Override
@@ -66,7 +71,9 @@
name = aName;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.NameValuePair#getValue()
*/
@Override
@@ -74,7 +81,9 @@
return value;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.metadata.NameValuePair#setValue(java.lang.Object)
*/
@Override
diff --git a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/OutputQueue_impl.java b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/OutputQueue_impl.java
index 4de68a5..59daad9 100644
--- a/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/OutputQueue_impl.java
+++ b/uimaj-cpe/src/main/java/org/apache/uima/collection/impl/metadata/cpe/OutputQueue_impl.java
@@ -29,12 +29,11 @@
import org.w3c.dom.Element;
import org.xml.sax.helpers.AttributesImpl;
-
/**
* The Class OutputQueue_impl.
*/
public class OutputQueue_impl extends MetaDataObject_impl implements OutputQueue {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -3001016349004832820L;
@@ -47,10 +46,14 @@
/**
* Overridden to read "queueClass" and "dequeueTimeout" attributes.
*
- * @param aElement the a element
- * @param aParser the a parser
- * @param aOptions the a options
- * @throws InvalidXMLException the invalid XML exception
+ * @param aElement
+ * the a element
+ * @param aParser
+ * the a parser
+ * @param aOptions
+ * the a options
+ * @throws InvalidXMLException
+ * the invalid XML exception
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#buildFromXMLElement(org.w3c.dom.Element,
* org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
*/
@@ -74,13 +77,15 @@
@Override
protected AttributesImpl getXMLAttributes() {
AttributesImpl attrs = super.getXMLAttributes();
- attrs.addAttribute("", "dequeueTimeout", "dequeueTimeout", "CDATA", String
- .valueOf(getDequeueTimeout()));
+ attrs.addAttribute("", "dequeueTimeout", "dequeueTimeout", "CDATA",
+ String.valueOf(getDequeueTimeout()));
attrs.addAttribute("", "queueClass", "queueClass", "CDATA", String.valueOf(getQueueClass()));
return attrs;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.resource.metadata.impl.MetaDataObject_impl#getXmlizationInfo()
*/
@Override
@@ -115,7 +120,8 @@
/**
* Sets the dequeue timeout.
*
- * @param i the new dequeue timeout
+ * @param i
+ * the new dequeue timeout
*/
@Override
public void setDequeueTimeout(int i) {
@@ -125,7 +131,8 @@
/**
* Sets the queue class.
*
- * @param string the new queue class
+ * @param string
+ * the new queue class
*/
@Override
public void setQueueClass(String string) {
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/analysis_engine/impl/SofaNamingInAggregateTest.java b/uimaj-cpe/src/test/java/org/apache/uima/analysis_engine/impl/SofaNamingInAggregateTest.java
index a42811f..541f03e 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/analysis_engine/impl/SofaNamingInAggregateTest.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/analysis_engine/impl/SofaNamingInAggregateTest.java
@@ -52,13 +52,13 @@
PrimitiveAnalysisEngine_impl delegateAE2;
- @BeforeEach
- public void setUp() throws Exception {
+ @BeforeEach
+ public void setUp() throws Exception {
try {
UIMAFramework.getXMLParser().enableSchemaValidation(true);
// create aggregate analysis engine with sofa name mappings
- XMLInputSource in1 = new XMLInputSource(JUnitExtension
- .getFile("CpeSofaTest/TransAnnotatorAggregate.xml"));
+ XMLInputSource in1 = new XMLInputSource(
+ JUnitExtension.getFile("CpeSofaTest/TransAnnotatorAggregate.xml"));
// parse XML descriptor
aeDescriptor = UIMAFramework.getXMLParser().parseAnalysisEngineDescription(in1);
additionalParams = new HashMap();
@@ -75,8 +75,8 @@
// also try an aggregate that contains a sofa mapping for a
// sofa-unaware component
- XMLInputSource in2 = new XMLInputSource(JUnitExtension
- .getFile("CpeSofaTest/TCasTransAnnotatorAggregate.xml"));
+ XMLInputSource in2 = new XMLInputSource(
+ JUnitExtension.getFile("CpeSofaTest/TCasTransAnnotatorAggregate.xml"));
AnalysisEngineDescription aeDescriptor2 = UIMAFramework.getXMLParser()
.parseAnalysisEngineDescription(in2);
aggregateAE2 = (AggregateAnalysisEngine_impl) UIMAFramework
@@ -92,8 +92,8 @@
/**
* Do full validation of descriptor; this checks validity of Sofa Mappings.
*/
- @Test
- public void testFullValidation() throws Exception {
+ @Test
+ public void testFullValidation() throws Exception {
try {
aeDescriptor.doFullValidation();
} catch (Exception e) {
@@ -106,8 +106,8 @@
* delegate AE.
*
*/
- @Test
- public void testGetSofaMappings() throws Exception {
+ @Test
+ public void testGetSofaMappings() throws Exception {
try {
SofaID[] sofamappings = delegateAE.getUimaContext().getSofaMappings();
Assert.assertEquals(2, sofamappings.length);
@@ -126,8 +126,8 @@
* Test the mapToSofaID method in UimaContext.
*
*/
- @Test
- public void testGetUimaContextMapToSofaID() throws Exception {
+ @Test
+ public void testGetUimaContextMapToSofaID() throws Exception {
try {
SofaID sofaid1 = delegateAE.getUimaContext().mapToSofaID("EnglishDocument");
Assert.assertEquals("SourceDocument", sofaid1.getSofaID());
@@ -152,8 +152,8 @@
* Test the mapToSofaID method in UimaContext.
*
*/
- @Test
- public void testMapRootSofaNameToSofaID() throws Exception {
+ @Test
+ public void testMapRootSofaNameToSofaID() throws Exception {
try {
SofaID sofaid1 = delegateAE.getUimaContext().mapToSofaID("EnglishDocument.1.txt");
Assert.assertEquals("SourceDocument.1.txt", sofaid1.getSofaID());
@@ -168,8 +168,8 @@
* Test the mapToSofaID method in Annotator Context.
*
*/
- @Test
- public void testGetAnnotatorContextMapToSofaID() throws Exception {
+ @Test
+ public void testGetAnnotatorContextMapToSofaID() throws Exception {
try {
AnnotatorContext context = new AnnotatorContext_impl(delegateAE.getUimaContextAdmin());
SofaID sofaid1 = context.mapToSofaID("EnglishDocument");
@@ -185,8 +185,8 @@
* Test the whether input sofa specified in the AE descriptar are in the AE meta data.
*
*/
- @Test
- public void testGetInputSofas() throws Exception {
+ @Test
+ public void testGetInputSofas() throws Exception {
try {
Capability[] capabilities = aggregateAE.getAnalysisEngineMetaData().getCapabilities();
String[] inputSofas = capabilities[0].getInputSofas();
@@ -201,8 +201,8 @@
* Test whether the output sofa specified in the AE descriptor are in the AE meta data.
*
*/
- @Test
- public void testGetOutputSofas() throws Exception {
+ @Test
+ public void testGetOutputSofas() throws Exception {
try {
Capability[] capabilities = aggregateAE.getAnalysisEngineMetaData().getCapabilities();
String[] outputSofas = capabilities[0].getOutputSofas();
@@ -218,8 +218,8 @@
* Tests programmatically specifying the sofa name mapping in a aggregate AE.
*
*/
- @Test
- public void testSetSofaNameMappingInAggregateDescriptor() throws Exception {
+ @Test
+ public void testSetSofaNameMappingInAggregateDescriptor() throws Exception {
try {
// create aggregate analysis engine with sofa name mappings
XMLInputSource in1 = new XMLInputSource(JUnitExtension
@@ -261,15 +261,15 @@
AnalysisEngine delegateAE1 = (PrimitiveAnalysisEngine_impl) aggregateAE._getASB()
.getComponentAnalysisEngines().get("Translator1");
Assert.assertEquals(2, delegateAE1.getUimaContext().getSofaMappings().length);
- Assert.assertEquals("SourceDocument", delegateAE1.getUimaContext().mapToSofaID(
- "EnglishDocument").getSofaID());
+ Assert.assertEquals("SourceDocument",
+ delegateAE1.getUimaContext().mapToSofaID("EnglishDocument").getSofaID());
// get the second delegate AE
AnalysisEngine delegateAE2 = (PrimitiveAnalysisEngine_impl) aggregateAE._getASB()
.getComponentAnalysisEngines().get("Translator2");
Assert.assertEquals(2, delegateAE2.getUimaContext().getSofaMappings().length);
- Assert.assertEquals("SourceDocument", delegateAE2.getUimaContext().mapToSofaID(
- "EnglishDocument").getSofaID());
+ Assert.assertEquals("SourceDocument",
+ delegateAE2.getUimaContext().mapToSofaID("EnglishDocument").getSofaID());
} catch (Exception e) {
JUnitExtension.handleException(e);
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/analysis_engine/impl/TestAnnotator.java b/uimaj-cpe/src/test/java/org/apache/uima/analysis_engine/impl/TestAnnotator.java
index f648002..9d440e8 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/analysis_engine/impl/TestAnnotator.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/analysis_engine/impl/TestAnnotator.java
@@ -49,8 +49,8 @@
* @see org.apache.uima.analysis_engine.annotator.Annotator#initialize(CAS, AnnotatorContext)
*/
@Override
- public void initialize(AnnotatorContext aContext) throws AnnotatorConfigurationException,
- AnnotatorInitializationException {
+ public void initialize(AnnotatorContext aContext)
+ throws AnnotatorConfigurationException, AnnotatorInitializationException {
super.initialize(aContext);
typeSystemInitCalled = false;
lastResultSpec = null;
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/cas/impl/CasTestUtil.java b/uimaj-cpe/src/test/java/org/apache/uima/cas/impl/CasTestUtil.java
index 6578080..d86bdbf 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/cas/impl/CasTestUtil.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/cas/impl/CasTestUtil.java
@@ -21,11 +21,9 @@
import org.apache.uima.cas.CAS;
-
public class CasTestUtil {
public static int getHeapSize(CAS aCAS) {
return ((CASImpl) aCAS).getInitialHeapSize();
}
}
-
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/CasHeapSizeTestCollectionReader.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/CasHeapSizeTestCollectionReader.java
index 6ef135e..e4ead73 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/CasHeapSizeTestCollectionReader.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/CasHeapSizeTestCollectionReader.java
@@ -44,9 +44,9 @@
@Override
public void getNext(CAS aCAS) throws IOException, CollectionException {
int actualHeapSize = CasTestUtil.getHeapSize(aCAS);
-
- // in v3 the actualHeap is always 500,000, so this test always miscompares
-// Assert.assertEquals(EXPECTED_HEAP_SIZE, actualHeapSize);
+
+ // in v3 the actualHeap is always 500,000, so this test always miscompares
+ // Assert.assertEquals(EXPECTED_HEAP_SIZE, actualHeapSize);
numChecks--;
// populate with doc to avoid error
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/CollectionProcessingEngine_implTest.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/CollectionProcessingEngine_implTest.java
index d866cfb..e5b34a8 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/CollectionProcessingEngine_implTest.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/CollectionProcessingEngine_implTest.java
@@ -40,30 +40,30 @@
import org.junit.jupiter.api.Test;
public class CollectionProcessingEngine_implTest {
- protected final String TEST_DATAPATH = JUnitExtension.getFile(
- "CollectionProcessingEngineImplTest").getPath()
- + System.getProperty("path.separator") + JUnitExtension.getFile("ResourceTest");
+ protected final String TEST_DATAPATH = JUnitExtension
+ .getFile("CollectionProcessingEngineImplTest").getPath()
+ + System.getProperty("path.separator") + JUnitExtension.getFile("ResourceTest");
- @BeforeEach
- public void setUp() throws Exception {
+ @BeforeEach
+ public void setUp() throws Exception {
File referenceFile = JUnitExtension
- .getFile("CollectionProcessingEngineImplTest/performanceTuningSettingsTestCpe.xml");
+ .getFile("CollectionProcessingEngineImplTest/performanceTuningSettingsTestCpe.xml");
System.setProperty("CPM_HOME", referenceFile.getParentFile().getParentFile().getAbsolutePath());
}
- @Test
- public void testPerformanceTuningSettings() throws Exception {
+ @Test
+ public void testPerformanceTuningSettings() throws Exception {
try {
Properties newProps = UIMAFramework.getDefaultPerformanceTuningProperties();
newProps.setProperty(UIMAFramework.CAS_INITIAL_HEAP_SIZE, "100000");
HashMap params = new HashMap();
params.put(Resource.PARAM_PERFORMANCE_TUNING_SETTINGS, newProps);
- CpeDescription cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(
- new XMLInputSource(JUnitExtension
- .getFile("CollectionProcessingEngineImplTest/performanceTuningSettingsTestCpe.xml")));
+ CpeDescription cpeDesc = UIMAFramework.getXMLParser()
+ .parseCpeDescription(new XMLInputSource(JUnitExtension.getFile(
+ "CollectionProcessingEngineImplTest/performanceTuningSettingsTestCpe.xml")));
CollectionProcessingEngine cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc,
- params);
+ params);
cpe.process();
// Need to give CPE time to do its work. The following should work, but
// doesn't
@@ -77,35 +77,35 @@
}
}
- @Test
- public void testExternalResoures() throws Exception {
+ @Test
+ public void testExternalResoures() throws Exception {
try {
ResourceManager rm = UIMAFramework.newDefaultResourceManager();
rm.setDataPath(TEST_DATAPATH);
- CpeDescription cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(
- new XMLInputSource(JUnitExtension
- .getFile("CollectionProcessingEngineImplTest/externalResourceTestCpe.xml")));
+ CpeDescription cpeDesc = UIMAFramework.getXMLParser()
+ .parseCpeDescription(new XMLInputSource(JUnitExtension
+ .getFile("CollectionProcessingEngineImplTest/externalResourceTestCpe.xml")));
CollectionProcessingEngine cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc, rm,
- null);
+ null);
CollectionReader colRdr = (CollectionReader) cpe.getCollectionReader();
assertNotNull(colRdr.getUimaContext().getResourceObject("TestFileResource"));
CasInitializer casIni = colRdr.getCasInitializer();
assertNotNull(casIni.getUimaContext().getResourceObject("TestFileLanguageResource",
- new String[] { "en" }));
+ new String[] { "en" }));
AnalysisEngine ae = (AnalysisEngine) cpe.getCasProcessors()[0];
assertNotNull(ae.getUimaContext().getResourceObject("TestResourceObject"));
assertNotNull(ae.getUimaContext().getResourceObject("TestLanguageResourceObject",
- new String[] { "en" }));
+ new String[] { "en" }));
} catch (Exception e) {
JUnitExtension.handleException(e);
}
}
-
- @Test
- public void testCasMultiplierTypeSystem() throws Throwable {
+
+ @Test
+ public void testCasMultiplierTypeSystem() throws Throwable {
CpeDescription cpeDesc = UIMAFramework.getXMLParser()
- .parseCpeDescription(new XMLInputSource(
- JUnitExtension.getFile("CollectionProcessingEngineImplTest/cpeWithWrappedCasMultiplier.xml")));
+ .parseCpeDescription(new XMLInputSource(JUnitExtension.getFile(
+ "CollectionProcessingEngineImplTest/cpeWithWrappedCasMultiplier.xml")));
CollectionProcessingEngine cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc);
// create and register a status callback listener
TestStatusCallbackListener listener = new TestStatusCallbackListener();
@@ -118,10 +118,10 @@
while (!listener.isFinished()) {
Thread.sleep(5);
}
-
- //check that there was no exception
+
+ // check that there was no exception
if (listener.getLastStatus().isException()) {
- throw (Throwable)listener.getLastStatus().getExceptions().get(0);
+ throw (Throwable) listener.getLastStatus().getExceptions().get(0);
}
}
}
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/SingleDocCollectionReader.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/SingleDocCollectionReader.java
index 206a054..1dddec6 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/SingleDocCollectionReader.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/SingleDocCollectionReader.java
@@ -42,10 +42,10 @@
*/
@Override
public void getNext(CAS aCAS) throws IOException, CollectionException {
- assert(!done);
+ assert (!done);
aCAS.setDocumentText("This is a test");
-
+
done = true;
}
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/TestCasInitializer.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/TestCasInitializer.java
index 499216e..d8d4a4c 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/TestCasInitializer.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/TestCasInitializer.java
@@ -31,7 +31,7 @@
* (non-Javadoc)
*
* @see org.apache.uima.collection.CasInitializer#initializeCas(java.lang.Object,
- * org.apache.uima.cas.CAS)
+ * org.apache.uima.cas.CAS)
*/
@Override
public void initializeCas(Object aObj, CAS aCAS) throws CollectionException, IOException {
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/TestCasMultiplier.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/TestCasMultiplier.java
index 1abdee5..23d2176 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/TestCasMultiplier.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/TestCasMultiplier.java
@@ -26,13 +26,14 @@
import org.junit.Assert;
/**
- * Test CAS Multiplier that asserts that input and output CAS type systems
- * are identical.
+ * Test CAS Multiplier that asserts that input and output CAS type systems are identical.
*/
public class TestCasMultiplier extends CasMultiplier_ImplBase {
private CAS mInputCAS;
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.analysis_component.CasMultiplier_ImplBase#process(org.apache.uima.cas.CAS)
*/
@Override
@@ -40,29 +41,33 @@
mInputCAS = aCAS;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.analysis_component.AnalysisComponent#hasNext()
*/
@Override
public boolean hasNext() throws AnalysisEngineProcessException {
CAS outputCas = getEmptyCAS();
try {
- Assert.assertTrue(((TypeSystemImpl)mInputCAS.getTypeSystem()).getLargestTypeCode() ==
- ((TypeSystemImpl)outputCas.getTypeSystem()).getLargestTypeCode());
+ Assert.assertTrue(((TypeSystemImpl) mInputCAS.getTypeSystem())
+ .getLargestTypeCode() == ((TypeSystemImpl) outputCas.getTypeSystem())
+ .getLargestTypeCode());
Assert.assertTrue(mInputCAS.getTypeSystem() == outputCas.getTypeSystem());
- }
- finally {
+ } finally {
outputCas.release();
}
return false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.analysis_component.AnalysisComponent#next()
*/
@Override
public AbstractCas next() throws AnalysisEngineProcessException {
- Assert.fail(); //should never get here
+ Assert.fail(); // should never get here
return null;
}
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CasPoolTest.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CasPoolTest.java
index b01331f..88c2525 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CasPoolTest.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CasPoolTest.java
@@ -46,29 +46,30 @@
/**
* @see junit.framework.TestCase#setUp()
*/
- @BeforeEach
- public void setUp() throws Exception {
+ @BeforeEach
+ public void setUp() throws Exception {
// disable schema validation -- this test uses descriptors
// that don't validate, for some reason
UIMAFramework.getXMLParser().enableSchemaValidation(false);
}
/**
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @AfterEach
- public void tearDown() throws Exception {
+ @AfterEach
+ public void tearDown() throws Exception {
FunctionErrorStore.resetCount();
}
-
/**
* Create multiple processors which have to process multiple documents
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testCasPool() throws Exception {
+ @Test
+ public void testCasPool() throws Exception {
// process 100 documents and multiple threads
int documentCount = 100;
int threadCount = 5;
@@ -79,6 +80,7 @@
// create and register a status callback listener
TestStatusCallbackListener listener = new TestStatusCallbackListener() {
TypeSystem sts = null;
+
@Override
public void entityProcessComplete(CAS aCas, EntityProcessStatus aStatus) {
super.entityProcessComplete(aCas, aStatus);
@@ -87,7 +89,7 @@
} else {
Assert.assertTrue(sts == aCas.getTypeSystem());
}
- }
+ }
};
cpe.addStatusCallbackListener(listener);
@@ -100,14 +102,14 @@
}
// check if CasConsumer was called
- Assert.assertEquals("StatusCallbackListener", documentCount, listener
- .getEntityProcessCompleteCount());
- Assert.assertEquals("CasConsumer process Count", documentCount, FunctionErrorStore
- .getCasConsumerProcessCount());
- Assert.assertEquals("Annotator process count", documentCount, FunctionErrorStore
- .getAnnotatorProcessCount());
- Assert.assertEquals("Collection reader getNext count", documentCount, FunctionErrorStore
- .getCollectionReaderGetNextCount());
+ Assert.assertEquals("StatusCallbackListener", documentCount,
+ listener.getEntityProcessCompleteCount());
+ Assert.assertEquals("CasConsumer process Count", documentCount,
+ FunctionErrorStore.getCasConsumerProcessCount());
+ Assert.assertEquals("Annotator process count", documentCount,
+ FunctionErrorStore.getAnnotatorProcessCount());
+ Assert.assertEquals("Collection reader getNext count", documentCount,
+ FunctionErrorStore.getCollectionReaderGetNextCount());
Assert.assertEquals("number of annoators", threadCount, FunctionErrorStore.getAnnotatorCount());
}
@@ -126,11 +128,12 @@
CollectionProcessingEngine cpe = null;
try {
- String colReaderBase = JUnitExtension.getFile("CpmTests" + separator
- + "ErrorTestCollectionReader.xml").getAbsolutePath();
- String taeBase = JUnitExtension.getFile("CpmTests" + separator + "ErrorTestAnnotator.xml").getAbsolutePath();
- String casConsumerBase = JUnitExtension.getFile("CpmTests" + separator
- + "ErrorTestCasConsumer.xml").getAbsolutePath();
+ String colReaderBase = JUnitExtension
+ .getFile("CpmTests" + separator + "ErrorTestCollectionReader.xml").getAbsolutePath();
+ String taeBase = JUnitExtension.getFile("CpmTests" + separator + "ErrorTestAnnotator.xml")
+ .getAbsolutePath();
+ String casConsumerBase = JUnitExtension
+ .getFile("CpmTests" + separator + "ErrorTestCasConsumer.xml").getAbsolutePath();
// created needed descriptors
String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, documentCount);
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeCasProcessorAPI_Test.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeCasProcessorAPI_Test.java
index 3586a92..08aa5d7 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeCasProcessorAPI_Test.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeCasProcessorAPI_Test.java
@@ -57,16 +57,16 @@
*
* @see junit.framework.TestCase#setUp()
*/
- @BeforeEach
- public void setUp() throws Exception {
+ @BeforeEach
+ public void setUp() throws Exception {
// Creates the Cpe Descriptor
cpe = CpeDescriptorFactory.produceDescriptor();
// Create CollectionReader and associate it with the descriptor
CpeDescriptorFactory.produceCollectionReader(confLocation + "collectionReaders/WFReader.xml",
cpe);
// Crate CasInitializer and associate it with the CollectionReader
- CpeDescriptorFactory.produceCollectionReaderCasInitializer(confLocation
- + "casinitializers/WFReaderInitializer.xml", cpe);
+ CpeDescriptorFactory.produceCollectionReaderCasInitializer(
+ confLocation + "casinitializers/WFReaderInitializer.xml", cpe);
// Create CasProcessors
CpeCasProcessors processors = CpeDescriptorFactory.produceCasProcessors(2, 4, 3, cpe);
// Create Detag CasProcessor
@@ -90,11 +90,11 @@
processors.addCpeCasProcessor(remoteProcessor);
// Create Detag CasProcessor
- CpeLocalCasProcessor localProcessor = CpeDescriptorFactory.produceLocalCasProcessor(
- "DupShingle Miner", "Detag:DetagContent");
+ CpeLocalCasProcessor localProcessor = CpeDescriptorFactory
+ .produceLocalCasProcessor("DupShingle Miner", "Detag:DetagContent");
localProcessor.setDescriptor("c://cpm/annotators/wfminers/detag/descriptor.xml");
- localProcessor
- .setExecutable("/home/cwiklik/cpm/wfcp/annotators/wfminers/detagger/bin/runDetagger.sh");
+ localProcessor.setExecutable(
+ "/home/cwiklik/cpm/wfcp/annotators/wfminers/detagger/bin/runDetagger.sh");
localProcessor.addDeployParam("Parm1", "Value1");
localProcessor.addDeployParam("vnsHost", "Host1");
localProcessor.addExecArg("-DVNS_HOST=127.0.0.1");
@@ -131,10 +131,11 @@
/**
* test the config of a remote CasProcessor with all possible values set
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testAddRemoteCasProcessor() throws Exception {
+ @Test
+ public void testAddRemoteCasProcessor() throws Exception {
CpeCasProcessors processors = cpe.getCpeCasProcessors();
CpeRemoteCasProcessor remoteProcessor = CpeDescriptorFactory
@@ -156,10 +157,10 @@
assertEquals("Descriptor()", "c://cpm/annotators/dummy.xml", remoteProcessor.getDescriptor());
assertEquals("DeploymentParam", "9999",
((remoteProcessor.getDeploymentParams()).get("vnsPort")).getParameterValue());
- assertEquals("DeploymentParam", "localhost", ((remoteProcessor.getDeploymentParams())
- .get("vnsHost")).getParameterValue());
- assertEquals("CasProcessorFilter", "where Detag_colon_DetagContent_2", remoteProcessor
- .getCasProcessorFilter());
+ assertEquals("DeploymentParam", "localhost",
+ ((remoteProcessor.getDeploymentParams()).get("vnsHost")).getParameterValue());
+ assertEquals("CasProcessorFilter", "where Detag_colon_DetagContent_2",
+ remoteProcessor.getCasProcessorFilter());
assertEquals("BatchSize", 5, remoteProcessor.getBatchSize());
assertEquals("MaxErrorCount", 51, remoteProcessor.getMaxErrorCount());
assertEquals("MaxErrorSampleSize", 505, remoteProcessor.getMaxErrorSampleSize());
@@ -172,15 +173,16 @@
/**
* test the config of a local CasProcessor with all possible values set
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testAddLocalCasProcessor() throws Exception {
+ @Test
+ public void testAddLocalCasProcessor() throws Exception {
CpeCasProcessors processors = cpe.getCpeCasProcessors();
// Create Detag CasProcessor
- CpeLocalCasProcessor localProcessor = CpeDescriptorFactory.produceLocalCasProcessor(
- "DupShingle Miner", "Detag:DetagContent");
+ CpeLocalCasProcessor localProcessor = CpeDescriptorFactory
+ .produceLocalCasProcessor("DupShingle Miner", "Detag:DetagContent");
localProcessor.setDescriptor("c://cpm/annotators/example.xml");
localProcessor.setExecutable("/some/path/executable.sh");
localProcessor.addDeployParam("Parm1", "Value1x");
@@ -201,10 +203,10 @@
assertEquals("Descriptor()", "c://cpm/annotators/example.xml", localProcessor.getDescriptor());
assertEquals("DeploymentParam", "Value1x",
((localProcessor.getDeploymentParams()).get("Parm1")).getParameterValue());
- assertEquals("DeploymentParam", "Host1x", ((localProcessor.getDeploymentParams())
- .get("vnsHost")).getParameterValue());
- assertEquals("CasProcessorFilter", "where Detag_colon_DetagContent", localProcessor
- .getCasProcessorFilter());
+ assertEquals("DeploymentParam", "Host1x",
+ ((localProcessor.getDeploymentParams()).get("vnsHost")).getParameterValue());
+ assertEquals("CasProcessorFilter", "where Detag_colon_DetagContent",
+ localProcessor.getCasProcessorFilter());
assertEquals("BatchSize", 4, localProcessor.getBatchSize());
assertEquals("MaxErrorCount", 52, localProcessor.getMaxErrorCount());
assertEquals("MaxErrorSampleSize", 503, localProcessor.getMaxErrorSampleSize());
@@ -217,10 +219,11 @@
/**
* test the config of a integrated CasProcessor with all possible values set
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testAddIntegratedCasProcessor() throws Exception {
+ @Test
+ public void testAddIntegratedCasProcessor() throws Exception {
CpeCasProcessors processors = cpe.getCpeCasProcessors();
CpeIntegratedCasProcessor integratedProcessor = CpeDescriptorFactory
@@ -242,10 +245,10 @@
processors.addCpeCasProcessor(integratedProcessor);
assertEquals("name", "special name", integratedProcessor.getName());
- assertEquals("Descriptor()", confLocation + "consumers/bla.xml", integratedProcessor
- .getDescriptor());
- assertEquals("DeploymentParam", "V1.0", ((integratedProcessor.getDeploymentParams())
- .get("testversion")).getParameterValue());
+ assertEquals("Descriptor()", confLocation + "consumers/bla.xml",
+ integratedProcessor.getDescriptor());
+ assertEquals("DeploymentParam", "V1.0",
+ ((integratedProcessor.getDeploymentParams()).get("testversion")).getParameterValue());
assertEquals("CasProcessorFilter", "some filter", integratedProcessor.getCasProcessorFilter());
assertEquals("BatchSize", 25, integratedProcessor.getBatchSize());
assertEquals("MaxErrorCount", 300, integratedProcessor.getMaxErrorCount());
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeDescriptorSerialization_Test.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeDescriptorSerialization_Test.java
index da4cfbd..287199b 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeDescriptorSerialization_Test.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeDescriptorSerialization_Test.java
@@ -60,8 +60,8 @@
/**
* @see junit.framework.TestCase#setUp()
*/
- @BeforeEach
- public void setUp() throws Exception {
+ @BeforeEach
+ public void setUp() throws Exception {
// get test base path setting
this.testBaseDir = JUnitExtension.getFile("CpmTests/CpeAPITest");
}
@@ -70,10 +70,11 @@
* test to be sure, that first reading and then writing a discriptor produces the same file as the
* original.(old configuration file format)
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testReadDescriptor() throws Exception {
+ @Test
+ public void testReadDescriptor() throws Exception {
// input file
File cpeDescFile = JUnitExtension.getFile("CpmTests/CpeAPITest/refConf.xml");
@@ -100,10 +101,11 @@
* test to be sure, that first reading and then writing a discriptor produces the same file as the
* original (new configuration file format).
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testReadDescriptor2() throws Exception {
+ @Test
+ public void testReadDescriptor2() throws Exception {
// input file
File cpeDescFile = JUnitExtension.getFile("CpmTests/CpeAPITest/refConf2.xml");
@@ -130,10 +132,11 @@
* given descriptor from a file. Write the new descriptor back to a file and compare this with an
* expected descriptor configuration.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testAddRemoteCasProcessor() throws Exception {
+ @Test
+ public void testAddRemoteCasProcessor() throws Exception {
// parse cpe descriptor file
File cpeDescFile = JUnitExtension.getFile("CpmTests/CpeAPITest/refConf3.xml");
@@ -167,10 +170,11 @@
* given descriptor from a file. Write the new descriptor back to a file and compare this with an
* expected descriptor configuration.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testAddLocalCasProcessor() throws Exception {
+ @Test
+ public void testAddLocalCasProcessor() throws Exception {
// parse cpe descriptor file
File cpeDescFile = JUnitExtension.getFile("CpmTests/CpeAPITest/refConf3.xml");
@@ -181,8 +185,8 @@
File refFile = JUnitExtension.getFile("CpmTests/CpeAPITest/testLocalDesc.xml");
// Create Detag CasProcessor
- CpeLocalCasProcessor localProcessor = CpeDescriptorFactory.produceLocalCasProcessor(
- "DupShingle Miner", "Detag:DetagContent");
+ CpeLocalCasProcessor localProcessor = CpeDescriptorFactory
+ .produceLocalCasProcessor("DupShingle Miner", "Detag:DetagContent");
localProcessor.setDescriptor("c://cpm/annotators/example.xml");
localProcessor.setExecutable("/some/path/executable.sh");
localProcessor.addDeployParam("Parm1", "Value1x");
@@ -202,10 +206,11 @@
* a given descriptor from a file. Write the new descriptor back to a file and compare this with
* an expected descriptor configuration.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testAddIntegratedCasProcessor() throws Exception {
+ @Test
+ public void testAddIntegratedCasProcessor() throws Exception {
// parse cpe descriptor file
File cpeDescFile = JUnitExtension.getFile("CpmTests/CpeAPITest/refConf3.xml");
@@ -236,7 +241,7 @@
public void equal(File aReferenceDescriptorFile, CpeDescription aGeneratedDescriptor) {
try {
-
+
XMLInputSource in = new XMLInputSource(aReferenceDescriptorFile);
CpeDescription referenceDesc = UIMAFramework.getXMLParser().parseCpeDescription(in);
@@ -256,8 +261,9 @@
}
if (readers[0].getCasInitializer() != null) {
- assertTrue(isCasInitializerTheSame(readers[0].getCasInitializer(), aGeneratedDescriptor
- .getAllCollectionCollectionReaders()[0].getCasInitializer()));
+ assertTrue(isCasInitializerTheSame(readers[0].getCasInitializer(),
+ aGeneratedDescriptor.getAllCollectionCollectionReaders()[0]
+ .getCasInitializer()));
}
}
@@ -276,8 +282,8 @@
if (aGeneratedDescriptor.getCpeCasProcessors() == null) {
fail("<casProcessors> element not found in generated CPE Descriptor");
} else {
- compareCasProcessors(referenceDesc.getCpeCasProcessors(), aGeneratedDescriptor
- .getCpeCasProcessors());
+ compareCasProcessors(referenceDesc.getCpeCasProcessors(),
+ aGeneratedDescriptor.getCpeCasProcessors());
}
}
} catch (Exception e) {
@@ -288,29 +294,31 @@
public void compareCasProcessors(CpeCasProcessors aRefCasProcessors,
CpeCasProcessors aGenCasProcessors) {
assertEquals(aRefCasProcessors.getCasPoolSize(), aGenCasProcessors.getCasPoolSize());
- assertEquals(aRefCasProcessors.getConcurrentPUCount(), aGenCasProcessors.getConcurrentPUCount());
+ assertEquals(aRefCasProcessors.getConcurrentPUCount(),
+ aGenCasProcessors.getConcurrentPUCount());
try {
int expectedCasProcessorCount = aRefCasProcessors.getAllCpeCasProcessors().length;
if (aGenCasProcessors.getAllCpeCasProcessors() == null) {
fail("Generated CPE Descriptor does not have any Cas Processors. Expected <"
+ expectedCasProcessorCount + "> Cas Processors");
} else {
- assertEquals("Generated CPE Descriptor does not have expected number of Cas Processors. "
- + "Expected <" + expectedCasProcessorCount + "> Cas Processors. Got <"
- + aGenCasProcessors.getAllCpeCasProcessors().length + ">",
+ assertEquals(
+ "Generated CPE Descriptor does not have expected number of Cas Processors. "
+ + "Expected <" + expectedCasProcessorCount + "> Cas Processors. Got <"
+ + aGenCasProcessors.getAllCpeCasProcessors().length + ">",
expectedCasProcessorCount, aGenCasProcessors.getAllCpeCasProcessors().length);
}
CpeCasProcessor[] refCasProcessorList = aRefCasProcessors.getAllCpeCasProcessors();
for (int i = 0; i < aRefCasProcessors.getAllCpeCasProcessors().length; i++) {
if (refCasProcessorList[i].getDeployment().equals("integrated")) {
- compareIntegratedCasProcessors(refCasProcessorList[i], aGenCasProcessors
- .getAllCpeCasProcessors()[i]);
+ compareIntegratedCasProcessors(refCasProcessorList[i],
+ aGenCasProcessors.getAllCpeCasProcessors()[i]);
} else if (refCasProcessorList[i].getDeployment().equals("remote")) {
- compareRemoteCasProcessors(refCasProcessorList[i], aGenCasProcessors
- .getAllCpeCasProcessors()[i]);
+ compareRemoteCasProcessors(refCasProcessorList[i],
+ aGenCasProcessors.getAllCpeCasProcessors()[i]);
} else if (refCasProcessorList[i].getDeployment().equals("local")) {
- compareLocalCasProcessors(refCasProcessorList[i], aGenCasProcessors
- .getAllCpeCasProcessors()[i]);
+ compareLocalCasProcessors(refCasProcessorList[i],
+ aGenCasProcessors.getAllCpeCasProcessors()[i]);
}
}
} catch (Exception e) {
@@ -326,8 +334,7 @@
assertEquals(aRefCasProcessor.getDescriptor(), aGenCasProcessor.getDescriptor());
if (aRefCasProcessor.getDeploymentParams() == null) {
if (aGenCasProcessor.getDeploymentParams() != null) {
- fail(aRefCasProcessor.getDeployment()
- + " Cas Processor with name="
+ fail(aRefCasProcessor.getDeployment() + " Cas Processor with name="
+ aGenCasProcessor.getName()
+ " contains <deploymentParameters> element. Expected to find empty <deploymentParameters> element");
}
@@ -340,17 +347,19 @@
}
}
if (aRefCasProcessor.getErrorHandling() != null) {
- compareErrorHandling(aRefCasProcessor.getErrorHandling(),
- aGenCasProcessor.getErrorHandling(), aRefCasProcessor.getName());
+ compareErrorHandling(aRefCasProcessor.getErrorHandling(), aGenCasProcessor.getErrorHandling(),
+ aRefCasProcessor.getName());
}
if (aRefCasProcessor.getCheckpoint() != null) {
if (aGenCasProcessor.getCheckpoint() == null) {
fail(aRefCasProcessor.getDeployment() + " Cas Processor with name="
+ aGenCasProcessor.getName() + " is missing <checkpoint> element.");
} else {
- assertEquals("Generated Cas Processor:" + aGenCasProcessor.getName()
- + " batch size does match expected value", aRefCasProcessor.getCheckpoint()
- .getBatchSize(), aGenCasProcessor.getCheckpoint().getBatchSize());
+ assertEquals(
+ "Generated Cas Processor:" + aGenCasProcessor.getName()
+ + " batch size does match expected value",
+ aRefCasProcessor.getCheckpoint().getBatchSize(),
+ aGenCasProcessor.getCheckpoint().getBatchSize());
}
}
@@ -387,9 +396,9 @@
aGenCasProcessorErrorHandling.getErrorRateThreshold().getAction());
assertEquals(aRefCasProcessorErrorHandling.getErrorRateThreshold().getMaxErrorCount(),
aGenCasProcessorErrorHandling.getErrorRateThreshold().getMaxErrorCount());
- assertEquals(aRefCasProcessorErrorHandling.getErrorRateThreshold()
- .getMaxErrorSampleSize(), aGenCasProcessorErrorHandling.getErrorRateThreshold()
- .getMaxErrorSampleSize());
+ assertEquals(
+ aRefCasProcessorErrorHandling.getErrorRateThreshold().getMaxErrorSampleSize(),
+ aGenCasProcessorErrorHandling.getErrorRateThreshold().getMaxErrorSampleSize());
}
}
if (aRefCasProcessorErrorHandling.getMaxConsecutiveRestarts() != null) {
@@ -401,9 +410,11 @@
aGenCasProcessorErrorHandling.getMaxConsecutiveRestarts().getAction());
assertEquals(aRefCasProcessorErrorHandling.getMaxConsecutiveRestarts().getRestartCount(),
aGenCasProcessorErrorHandling.getMaxConsecutiveRestarts().getRestartCount());
- assertEquals(aRefCasProcessorErrorHandling.getMaxConsecutiveRestarts()
- .getWaitTimeBetweenRetries(), aGenCasProcessorErrorHandling
- .getMaxConsecutiveRestarts().getWaitTimeBetweenRetries());
+ assertEquals(
+ aRefCasProcessorErrorHandling.getMaxConsecutiveRestarts()
+ .getWaitTimeBetweenRetries(),
+ aGenCasProcessorErrorHandling.getMaxConsecutiveRestarts()
+ .getWaitTimeBetweenRetries());
}
}
if (aRefCasProcessorErrorHandling.getTimeout() != null) {
@@ -430,8 +441,8 @@
if (aGenCpeConfig.getStartingEntityId() != null) {
assertTrue(
"Generated Cpe Descriptor has an invalid value for <startAt> in <cpeConfig>.Expected no value OR empty string. Instead got value of:"
- + aGenCpeConfig.getStartingEntityId(), aGenCpeConfig
- .getStartingEntityId().trim().length() == 0);
+ + aGenCpeConfig.getStartingEntityId(),
+ aGenCpeConfig.getStartingEntityId().trim().length() == 0);
}
}
if (aRefCpeConfig.getCheckpoint() != null) {
@@ -442,14 +453,14 @@
if (aGenCpeConfig.getCheckpoint().getFilePath() == null) {
fail("Expected attribute 'file' in <checkpoint> element in <cpeConfig> not found in generated Cpe Descriptor.");
} else {
- assertEquals(aRefCpeConfig.getCheckpoint().getFilePath(), aGenCpeConfig
- .getCheckpoint().getFilePath());
+ assertEquals(aRefCpeConfig.getCheckpoint().getFilePath(),
+ aGenCpeConfig.getCheckpoint().getFilePath());
}
}
- assertEquals(aRefCpeConfig.getCheckpoint().getBatchSize(), aGenCpeConfig.getCheckpoint()
- .getBatchSize());
- assertEquals(aRefCpeConfig.getCheckpoint().getFrequency(), aGenCpeConfig.getCheckpoint()
- .getFrequency());
+ assertEquals(aRefCpeConfig.getCheckpoint().getBatchSize(),
+ aGenCpeConfig.getCheckpoint().getBatchSize());
+ assertEquals(aRefCpeConfig.getCheckpoint().getFrequency(),
+ aGenCpeConfig.getCheckpoint().getFrequency());
}
}
} catch (Exception e) {
@@ -471,8 +482,8 @@
if (refFilePath != null) {
assertEquals(
"Component Descriptor in Generated CPE Descriptor has unexpected value. Expected:"
- + refFilePath + " Got:" + genFilePath + " Instead.", refFilePath,
- genFilePath);
+ + refFilePath + " Got:" + genFilePath + " Instead.",
+ refFilePath, genFilePath);
}
}
}
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeImportTest.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeImportTest.java
index 123401f..9e7f1e3 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeImportTest.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeImportTest.java
@@ -43,25 +43,25 @@
public class CpeImportTest {
private static final String separator = System.getProperties().getProperty("file.separator");
- @BeforeEach
- public void setUp() throws Exception {
+ @BeforeEach
+ public void setUp() throws Exception {
// disable schema validation -- this test uses descriptors
// that don't validate, for some reason
UIMAFramework.getXMLParser().enableSchemaValidation(false);
}
@AfterEach
- public void tearDown() throws Exception {
+ public void tearDown() throws Exception {
FunctionErrorStore.resetCount();
}
/**
* Test a CPE descriptor that uses the import syntax.
*/
- @Test
- public void testImports() throws Exception {
- CpeDescription cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(
- new XMLInputSource(JUnitExtension.getFile("CollectionProcessingEngineImplTest/CpeImportTest.xml")));
+ @Test
+ public void testImports() throws Exception {
+ CpeDescription cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(new XMLInputSource(
+ JUnitExtension.getFile("CollectionProcessingEngineImplTest/CpeImportTest.xml")));
CollectionProcessingEngine cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc);
TestStatusCallbackListener listener = new TestStatusCallbackListener();
@@ -75,28 +75,31 @@
}
// check that components were called
- final int documentCount = 1000; //this is the # of documents produced by the test CollectionReader
- Assert.assertEquals("StatusCallbackListener", documentCount, listener
- .getEntityProcessCompleteCount());
- Assert.assertEquals("CasConsumer process Count", documentCount, FunctionErrorStore
- .getCasConsumerProcessCount());
- Assert.assertEquals("Annotator process count", documentCount, FunctionErrorStore
- .getAnnotatorProcessCount());
- Assert.assertEquals("Collection reader getNext count", documentCount, FunctionErrorStore
- .getCollectionReaderGetNextCount());
+ final int documentCount = 1000; // this is the # of documents produced by the test
+ // CollectionReader
+ Assert.assertEquals("StatusCallbackListener", documentCount,
+ listener.getEntityProcessCompleteCount());
+ Assert.assertEquals("CasConsumer process Count", documentCount,
+ FunctionErrorStore.getCasConsumerProcessCount());
+ Assert.assertEquals("Annotator process count", documentCount,
+ FunctionErrorStore.getAnnotatorProcessCount());
+ Assert.assertEquals("Collection reader getNext count", documentCount,
+ FunctionErrorStore.getCollectionReaderGetNextCount());
}
-
+
/**
* Test a CPE descriptor using import by name and requiring data patht o be set
*/
- @Test
- public void testImportsWithDataPath() throws Exception {
- CpeDescription cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(
- new XMLInputSource(JUnitExtension.getFile("CollectionProcessingEngineImplTest/CpeImportDataPathTest.xml")));
+ @Test
+ public void testImportsWithDataPath() throws Exception {
+ CpeDescription cpeDesc = UIMAFramework.getXMLParser()
+ .parseCpeDescription(new XMLInputSource(JUnitExtension
+ .getFile("CollectionProcessingEngineImplTest/CpeImportDataPathTest.xml")));
ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
File dataPathDir = JUnitExtension.getFile("CollectionProcessingEngineImplTest/imports");
resMgr.setDataPath(dataPathDir.getAbsolutePath());
- CollectionProcessingEngine cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc, resMgr, null);
+ CollectionProcessingEngine cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc,
+ resMgr, null);
TestStatusCallbackListener listener = new TestStatusCallbackListener();
cpe.addStatusCallbackListener(listener);
@@ -109,14 +112,15 @@
}
// check that components were called
- final int documentCount = 1000; //this is the # of documents produced by the test CollectionReader
- Assert.assertEquals("StatusCallbackListener", documentCount, listener
- .getEntityProcessCompleteCount());
- Assert.assertEquals("CasConsumer process Count", documentCount, FunctionErrorStore
- .getCasConsumerProcessCount());
- Assert.assertEquals("Annotator process count", documentCount, FunctionErrorStore
- .getAnnotatorProcessCount());
- Assert.assertEquals("Collection reader getNext count", documentCount, FunctionErrorStore
- .getCollectionReaderGetNextCount());
- }
+ final int documentCount = 1000; // this is the # of documents produced by the test
+ // CollectionReader
+ Assert.assertEquals("StatusCallbackListener", documentCount,
+ listener.getEntityProcessCompleteCount());
+ Assert.assertEquals("CasConsumer process Count", documentCount,
+ FunctionErrorStore.getCasConsumerProcessCount());
+ Assert.assertEquals("Annotator process count", documentCount,
+ FunctionErrorStore.getAnnotatorProcessCount());
+ Assert.assertEquals("Collection reader getNext count", documentCount,
+ FunctionErrorStore.getCollectionReaderGetNextCount());
+ }
}
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmAE_ErrorTest.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmAE_ErrorTest.java
index 8a663cb..c9f55d7 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmAE_ErrorTest.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmAE_ErrorTest.java
@@ -41,10 +41,9 @@
*
* In detail the TestCase currently comprises the following test scenarios:<br>
* <ul>
- * <li> Function tests with errorhandling of the methods defined in
- * {@link org.apache.uima.analysis_engine.annotator.BaseAnnotator} and
- * {@link JTextAnnotator}. </li>
- * <li> CPM function tests concerning errorhandling </li>
+ * <li>Function tests with errorhandling of the methods defined in
+ * {@link org.apache.uima.analysis_engine.annotator.BaseAnnotator} and {@link JTextAnnotator}.</li>
+ * <li>CPM function tests concerning errorhandling</li>
* </ul>
* <p>
* The first section of tests analyse the behaviour of the different methods implemented with the
@@ -59,12 +58,11 @@
* list:
* </p>
* <ul>
- * <li> generate the descriptors, with fit to the testcase. For instance an annotator which throws a
- * (runtime) exception after every 5th document. </li>
- * <li> create the cpe an set all needed values (error handling params f. instance) </li>
- * <li> [optional] add some mechanism to stop the cpm if it crashes in the test (timeouts or so)
- * </li>
- * <li> run the test and check for the results </li>
+ * <li>generate the descriptors, with fit to the testcase. For instance an annotator which throws a
+ * (runtime) exception after every 5th document.</li>
+ * <li>create the cpe an set all needed values (error handling params f. instance)</li>
+ * <li>[optional] add some mechanism to stop the cpm if it crashes in the test (timeouts or so)</li>
+ * <li>run the test and check for the results</li>
* </ul>
*
* Also have a look at <br>
@@ -80,7 +78,8 @@
System.gc();
}
- private void cpeProcessNoMsg(CollectionProcessingEngine cpe, TestStatusCallbackListener listener) throws Exception {
+ private void cpeProcessNoMsg(CollectionProcessingEngine cpe, TestStatusCallbackListener listener)
+ throws Exception {
UIMAFramework.getLogger().setLevel(Level.OFF);
try {
cpe.process();
@@ -91,17 +90,18 @@
UIMAFramework.getLogger().setLevel(Level.INFO);
}
}
-
+
/**
* <b>testcase:</b> the process method throws multiple AnnotatorProcessException.<br>
* <b>expected behaviour:</b><br>
* the cpm should regular finish after processing all documents. No error and no abort should
* occur.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testProcessWithAnnotatorProcessException() throws Exception {
+ @Test
+ public void testProcessWithAnnotatorProcessException() throws Exception {
int documentCount = 20; // number of document to process
int exceptionSequence = 4; // the sequence in which errors are produced
ManageOutputDevice.setAllSystemOutputToNirvana();
@@ -122,8 +122,8 @@
assertEquals(
"The cpm propably didn't finish correctly! The aborted method of the listener was called.",
false, listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ", countExceptions(documentCount,
- exceptionSequence), FunctionErrorStore.getCount());
+ assertEquals("There are not as much exceptions as expected! ",
+ countExceptions(documentCount, exceptionSequence), FunctionErrorStore.getCount());
}
@@ -133,10 +133,11 @@
* the cpm should regular finish after processing all documents. No error and no abort should
* occur.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testProcessWithOutOfMemoryException() throws Exception {
+ @Test
+ public void testProcessWithOutOfMemoryException() throws Exception {
int documentCount = 20; // number of documents to process
int exceptionSequence = 3; // the sequence in which errors are produced
ManageOutputDevice.setAllSystemOutputToNirvana();
@@ -169,10 +170,11 @@
* the cpm should regular finish after processing all documents. No error and no abort should
* occur.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testProcessWithNullPointerException() throws Exception {
+ @Test
+ public void testProcessWithNullPointerException() throws Exception {
int documentCount = 20; // number of documents to process
int exceptionSequence = 3; // the sequence in which errors are produced
ManageOutputDevice.setAllSystemOutputToNirvana();
@@ -194,8 +196,8 @@
assertEquals(
"The cpm propably didn't finish correctly! The aborted method of the listener was called.",
false, listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ", countExceptions(documentCount,
- exceptionSequence), FunctionErrorStore.getCount());
+ assertEquals("There are not as much exceptions as expected! ",
+ countExceptions(documentCount, exceptionSequence), FunctionErrorStore.getCount());
// that's it.
}
@@ -205,10 +207,11 @@
* The cpm should not finish. Instead, the exception is passed back to the testscript. Neither the
* collectionProcessComplete-, nor the aborted- method of the listener is called.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testInitializeWithNullPointerException() throws Exception {
+ @Test
+ public void testInitializeWithNullPointerException() throws Exception {
int documentCount = 20; // number of document to process
int exceptionSequence = 1; // the sequence in which errors are produced
boolean exceptionThrown = false;
@@ -236,9 +239,10 @@
assertEquals(
"The cpm called the listener, that the cpm has finished - which normally could not be.",
false, listener.isFinished());
- assertEquals("The aborted-method of the listener was called. (new behaviour?)", false, listener
- .isAborted());
- assertEquals("There are not as much exceptions as expected! ", 1, FunctionErrorStore.getCount());
+ assertEquals("The aborted-method of the listener was called. (new behaviour?)", false,
+ listener.isAborted());
+ assertEquals("There are not as much exceptions as expected! ", 1,
+ FunctionErrorStore.getCount());
}
/**
@@ -247,10 +251,11 @@
* the cpm should regular finish, but don't process the documents. No error and no abort should
* occur. the collectionProcessComplete -method of the listener is called.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testInitializeWithOutOfMemoryException() throws Exception {
+ @Test
+ public void testInitializeWithOutOfMemoryException() throws Exception {
int documentCount = 20; // number of document to process
int exceptionSequence = 1; // the sequence in which errors are produced
ManageOutputDevice.setAllSystemOutputToNirvana();
@@ -274,7 +279,8 @@
assertEquals(
"The cpm propably didn't finish correctly! The aborted method of the listener was called.",
false, listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ", 1, FunctionErrorStore.getCount());
+ assertEquals("There are not as much exceptions as expected! ", 1,
+ FunctionErrorStore.getCount());
// that's it.
}
@@ -285,10 +291,11 @@
* the testclass. Neither the collectionProcessComplete-, nor the aborted- method of the listener
* is called.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testInitializeWithAnnotatorInitializationException() throws Exception {
+ @Test
+ public void testInitializeWithAnnotatorInitializationException() throws Exception {
int documentCount = 20; // number of document to process
int exceptionSequence = 1; // the sequence in which errors are produced
boolean exceptionThrown = false;
@@ -316,9 +323,10 @@
assertEquals(
"The cpm called the listener, that the cpm has finished - which normally could not be.",
false, listener.isFinished());
- assertEquals("The aborted-method of the listener was called. (new behaviour?)", false, listener
- .isAborted());
- assertEquals("There are not as much exceptions as expected! ", 1, FunctionErrorStore.getCount());
+ assertEquals("The aborted-method of the listener was called. (new behaviour?)", false,
+ listener.isAborted());
+ assertEquals("There are not as much exceptions as expected! ", 1,
+ FunctionErrorStore.getCount());
}
/**
@@ -328,10 +336,11 @@
* the testclass. Neither the collectionProcessComplete-, nor the aborted- method of the listener
* is called.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testInitializeWithAnnotatorConfigurationException() throws Exception {
+ @Test
+ public void testInitializeWithAnnotatorConfigurationException() throws Exception {
int documentCount = 20; // number of documents processed
int exceptionSequence = 1; // the sequence in which errors are produced
boolean exceptionThrown = false;
@@ -359,13 +368,14 @@
assertEquals(
"The cpm called the listener, that the cpm has finished - which normally could not be.",
false, listener.isFinished());
- assertEquals("The aborted-method of the listener was called. (new behaviour?)", false, listener
- .isAborted());
- assertEquals("There are not as much exceptions as expected! ", 1, FunctionErrorStore.getCount());
+ assertEquals("The aborted-method of the listener was called. (new behaviour?)", false,
+ listener.isAborted());
+ assertEquals("There are not as much exceptions as expected! ", 1,
+ FunctionErrorStore.getCount());
}
// // TODO: Find a way to call the reconfigure-method for testing perpose.
- //
+ //
// public void testReconfigureWithAnnotatorConfigurationException() throws Exception{
// int documentCount = 20; // number of documents processed
// int exceptionSequence = 1; // the sequence in which errors are produced
@@ -380,7 +390,7 @@
// "AnnotatorConfigurationException",
// exceptionSequence,
// "reconfigure");
- //
+ //
// //Create and register a Status Callback Listener
// listener = new CollectionReaderStatusCallbackListener(cpe);
// cpe.addStatusCallbackListener(listener);
@@ -392,7 +402,7 @@
// } catch (NullPointerException e) {
// // e.printStackTrace();
// exceptionThrown = true;
- //
+ //
// }
// // check the results, if everything worked as expected
// assertEquals("The cpm didn't finish correctly! Abort was called.", false,
@@ -410,10 +420,11 @@
* the testclass. Neither the collectionProcessComplete-, nor the aborted- method of the listener
* is called.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testAeProcessingUnitThreadCount() throws Exception {
+ @Test
+ public void testAeProcessingUnitThreadCount() throws Exception {
int documentCount = 20; // number of documents processed
int count = 5; // thread number
TestStatusCallbackListener listener = null;
@@ -437,8 +448,8 @@
// check the results, if everything worked as expected
assertEquals("The cpm didn't finish correctly! Abort was called.", false, listener.isAborted());
assertEquals("The cpm didn't finish by calling the Listener.", true, listener.isFinished());
- assertEquals("There are not as much ae's running as expected ", count, FunctionErrorStore
- .getAnnotatorCount());
+ assertEquals("There are not as much ae's running as expected ", count,
+ FunctionErrorStore.getAnnotatorCount());
// that's it.
}
@@ -450,10 +461,11 @@
* The cpm should not finish. Instead, after 100 Exceptions + 1 the aborted -method is called by
* the cpm. The cpm shut down.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testAeErrorRateThresholdTerminateDefault() throws Exception {
+ @Test
+ public void testAeErrorRateThresholdTerminateDefault() throws Exception {
int documentCount = 1000; // number of documents to process
TestStatusCallbackListener listener = new TestStatusCallbackListener();
int exceptionSequence = 5;
@@ -482,8 +494,8 @@
"The cpm called the listener, that the cpm has finished - which normally could not be.",
false, listener.isFinished());
assertEquals("The aborted-method of the listener wasn't called.", true, listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ", (100 + 1), FunctionErrorStore
- .getCount());
+ assertEquals("There are not as much exceptions as expected! ", (100 + 1),
+ FunctionErrorStore.getCount());
// that's it.
}
@@ -495,10 +507,11 @@
* The cpm should not finish. Instead, after 5 Exceptions + 1 the aborted -method is called by the
* cpm. The cpm shut down.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testAeErrorRateThresholdTerminateModified1() throws Exception {
+ @Test
+ public void testAeErrorRateThresholdTerminateModified1() throws Exception {
int documentCount = 500; // number of documents to process
TestStatusCallbackListener listener = new TestStatusCallbackListener();
int exceptionSequence = 5;
@@ -528,8 +541,8 @@
"The cpm called the listener, that the cpm has finished - which normally could not be.",
false, listener.isFinished());
assertEquals("The aborted-method of the listener wasn't called.", true, listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ", (5 + 1), FunctionErrorStore
- .getCount());
+ assertEquals("There are not as much exceptions as expected! ", (5 + 1),
+ FunctionErrorStore.getCount());
}
/**
@@ -539,10 +552,11 @@
* <b>expected behaviour:</b><br>
* The cpm should finish, because this failure-rate is in the accepted range.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testAeErrorRateThresholdTerminateModified2() throws Exception {
+ @Test
+ public void testAeErrorRateThresholdTerminateModified2() throws Exception {
int exceptionSequence = 5;
int documentCount = 100; // number of documents processed
TestStatusCallbackListener listener = new TestStatusCallbackListener();
@@ -575,22 +589,23 @@
true, listener.isFinished());
assertEquals("The cpm didn't finish correctly! Abort in the listener was called.", false,
listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ", countExceptions(documentCount,
- exceptionSequence), FunctionErrorStore.getCount());
+ assertEquals("There are not as much exceptions as expected! ",
+ countExceptions(documentCount, exceptionSequence), FunctionErrorStore.getCount());
// that's it.
}
/**
- * <b>testcase:</b> set the errorRateThreshold to action:continue and set the value to 5/15.
- * Every 2nd document an AnnotatorProcessException is thrown.
+ * <b>testcase:</b> set the errorRateThreshold to action:continue and set the value to 5/15. Every
+ * 2nd document an AnnotatorProcessException is thrown.
* <code><errorRateThreshold action="continue" value="5/15"/></code><br>
* <b>expected behaviour:</b><br>
* The cpm should finish, because of the continue action.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testAeErrorRateThresholdContinue() throws Exception {
+ @Test
+ public void testAeErrorRateThresholdContinue() throws Exception {
int exceptionSequence = 4;
int documentCount = 20; // number of documents processed
TestStatusCallbackListener listener = new TestStatusCallbackListener();
@@ -633,10 +648,11 @@
* <b>expected behaviour:</b><br>
* The annotator should stop working. The cpm changes to the "isFinished" state.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testAeErrorRateThresholdDisable() throws Exception {
+ @Test
+ public void testAeErrorRateThresholdDisable() throws Exception {
int exceptionSequence = 2;
int documentCount = 50; // number of documents processed
TestStatusCallbackListener listener = new TestStatusCallbackListener();
@@ -668,11 +684,12 @@
"The cpm propably didn't finish correctly! The aborted method of the listener was called.",
false, listener.isAborted());
assertEquals("The cpm didn't finish by calling the Listener.", true, listener.isFinished());
- assertEquals("There are not as much exceptions as expected! ", 6, FunctionErrorStore.getCount());
+ assertEquals("There are not as much exceptions as expected! ", 6,
+ FunctionErrorStore.getCount());
}
- @Test
- public void testAeErrorRateActionOnMaxRestarts() throws Exception {
+ @Test
+ public void testAeErrorRateActionOnMaxRestarts() throws Exception {
int exceptionSequence = 1;
int documentCount = 10; // number of documents processed
TestStatusCallbackListener listener = new TestStatusCallbackListener();
@@ -705,7 +722,8 @@
"The cpm propably didn't finish correctly! The aborted method of the listener was called.",
false, listener.isAborted());
assertEquals("The cpm didn't finish by calling the Listener.", true, listener.isFinished());
- assertEquals("There are not as many exceptions as expected:", 40, FunctionErrorStore.getCount());
+ assertEquals("There are not as many exceptions as expected:", 40,
+ FunctionErrorStore.getCount());
}
/**
@@ -714,10 +732,11 @@
* <b>expected behaviour:</b><br>
* After havening successfully processed the given number of documents the process should finish.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testNumToProcess() throws Exception {
+ @Test
+ public void testNumToProcess() throws Exception {
int exceptionSequence = 25;
int documentCount = 50; // number of documents processed
TestStatusCallbackListener listener = new TestStatusCallbackListener();
@@ -748,13 +767,14 @@
"The cpm propably didn't finish correctly! The aborted method of the listener was called.",
false, listener.isAborted());
assertEquals("The cpm didn't finish by calling the Listener.", true, listener.isFinished());
- assertEquals("There are not as much exceptions as expected! ", 0, FunctionErrorStore.getCount());
+ assertEquals("There are not as much exceptions as expected! ", 0,
+ FunctionErrorStore.getCount());
assertEquals("There is a difference between the expected and the processed document number. ",
20, FunctionErrorStore.getAnnotatorProcessCount());
}
- @AfterEach
- public void tearDown() throws Exception {
+ @AfterEach
+ public void tearDown() throws Exception {
FunctionErrorStore.resetCount();
}
@@ -797,8 +817,8 @@
CollectionProcessingEngine cpe = null;
try {
- String colReaderBase = JUnitExtension.getFile(
- "CpmTests" + FS + "ErrorTestCollectionReader.xml").getAbsolutePath();
+ String colReaderBase = JUnitExtension
+ .getFile("CpmTests" + FS + "ErrorTestCollectionReader.xml").getAbsolutePath();
String taeBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestAnnotator.xml")
.getAbsolutePath();
String casConsumerBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestCasConsumer.xml")
@@ -874,8 +894,8 @@
CpeDescription cpeDesc = null;
CpeIntegratedCasProcessor integratedProcessor = null;
try {
- String colReaderBase = JUnitExtension.getFile(
- "CpmTests" + FS + "ErrorTestCollectionReader.xml").getAbsolutePath();
+ String colReaderBase = JUnitExtension
+ .getFile("CpmTests" + FS + "ErrorTestCollectionReader.xml").getAbsolutePath();
String taeBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestAnnotator.xml")
.getAbsolutePath();
String casConsumerBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestCasConsumer.xml")
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCasConsumer_ErrorTest.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCasConsumer_ErrorTest.java
index 8bc43cc..39d2406 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCasConsumer_ErrorTest.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCasConsumer_ErrorTest.java
@@ -56,11 +56,11 @@
* list:
* </p>
* <ul>
- * <li> generate the descriptors, with fit to the testcase. For instance an annotator which throws a
- * (runtime) exception every 5th document. </li>
- * <li> [optional] add some mechanism to handle errors in the tests (timeouts or try-catch blocks)
+ * <li>generate the descriptors, with fit to the testcase. For instance an annotator which throws a
+ * (runtime) exception every 5th document.</li>
+ * <li>[optional] add some mechanism to handle errors in the tests (timeouts or try-catch blocks)
* </li>
- * <li> run the test and check for the results </li>
+ * <li>run the test and check for the results</li>
* </ul>
*
* Also have a look at <br>
@@ -72,7 +72,8 @@
private static final String FS = System.getProperties().getProperty("file.separator");
- private void cpeProcessNoMsg(CollectionProcessingEngine cpe, TestStatusCallbackListener listener) throws Exception {
+ private void cpeProcessNoMsg(CollectionProcessingEngine cpe, TestStatusCallbackListener listener)
+ throws Exception {
UIMAFramework.getLogger().setLevel(Level.OFF);
try {
cpe.process();
@@ -90,10 +91,11 @@
* The cpm should not finish. Instead, the exception is passed back to the testscript. Neither the
* collectionProcessComplete-, nor the aborted- method of the listener is called.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testInitializeWithResourceInitializationException() throws Exception {
+ @Test
+ public void testInitializeWithResourceInitializationException() throws Exception {
int documentCount = 20; // number of documents processed
int exceptionSequence = 1; // the sequence in which errors are produced
boolean exceptionThrown = false;
@@ -119,8 +121,8 @@
false, listener.isFinished());
assertEquals("The aborted-method of the listener was called. (new behaviour?)", false,
listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ", 1, FunctionErrorStore
- .getCount());
+ assertEquals("There are not as much exceptions as expected! ", 1,
+ FunctionErrorStore.getCount());
}
}
@@ -130,10 +132,11 @@
* The cpm should not finish. Instead, the exception is passed back to the testscript. Neither the
* collectionProcessComplete-, nor the aborted- method of the listener is called.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testInitializeWithNullPointerException() throws Exception {
+ @Test
+ public void testInitializeWithNullPointerException() throws Exception {
int documentCount = 20; // number of documents processed
int exceptionSequence = 1; // the sequence in which errors are produced
boolean exceptionThrown = false;
@@ -160,8 +163,8 @@
false, listener.isFinished());
assertEquals("The aborted-method of the listener was called. (new behaviour?)", false,
listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ", 1, FunctionErrorStore
- .getCount());
+ assertEquals("There are not as much exceptions as expected! ", 1,
+ FunctionErrorStore.getCount());
}
}
@@ -171,10 +174,11 @@
* The cpm should not finish. Instead, the exception is passed back to the testscript. Neither the
* collectionProcessComplete-, nor the aborted- method of the listener is called.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testInitializeWithOutOfMemoryError() throws Exception {
+ @Test
+ public void testInitializeWithOutOfMemoryError() throws Exception {
int documentCount = 20; // number of documents processed
int exceptionSequence = 1; // the sequence in which errors are produced
boolean errorThrown = false;
@@ -199,8 +203,8 @@
false, listener.isFinished());
assertEquals("The aborted-method of the listener was called. (new behaviour?)", false,
listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ", 1, FunctionErrorStore
- .getCount());
+ assertEquals("There are not as much exceptions as expected! ", 1,
+ FunctionErrorStore.getCount());
assertEquals("The expected Error wasn't thrown! ", true, errorThrown);
}
}
@@ -210,10 +214,11 @@
* <b>expected behaviour:</b><br>
* The cpm should finish correctly.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testProcessCasWithIOException() throws Exception {
+ @Test
+ public void testProcessCasWithIOException() throws Exception {
int documentCount = 20; // number of documents processed
int exceptionSequence = 3; // the sequence in which errors are produced
ManageOutputDevice.setAllSystemOutputToNirvana();
@@ -230,8 +235,8 @@
assertEquals(
"The cpm is still working or the collectionProcessComplete-method of the listener was not called.",
true, listener.isFinished());
- assertEquals("The aborted-method of the listener was called. (new behaviour?)", false, listener
- .isAborted());
+ assertEquals("The aborted-method of the listener was called. (new behaviour?)", false,
+ listener.isAborted());
assertEquals("There are not as much exceptions thrown as expected! ",
((documentCount) / exceptionSequence), FunctionErrorStore.getCount());
assertEquals(
@@ -244,10 +249,11 @@
* <b>expected behaviour:</b><br>
* The cpm should finish correctly. The aborted- method of the listener is not called.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testProcessCasWithResourceProcessException() throws Exception {
+ @Test
+ public void testProcessCasWithResourceProcessException() throws Exception {
int documentCount = 20; // number of documents processed
int exceptionSequence = 3; // the sequence in which errors are produced
ManageOutputDevice.setAllSystemOutputToNirvana();
@@ -261,11 +267,11 @@
cpeProcessNoMsg(cpe, listener);
// check the results, if everything worked as expected
ManageOutputDevice.setAllSystemOutputToDefault();
- assertEquals("The cpm did not call the listener, that the cpm has finished.", true, listener
- .isFinished());
+ assertEquals("The cpm did not call the listener, that the cpm has finished.", true,
+ listener.isFinished());
assertEquals("The aborted-method of the listener was called!", false, listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ", countExceptions(documentCount,
- exceptionSequence), FunctionErrorStore.getCount());
+ assertEquals("There are not as much exceptions as expected! ",
+ countExceptions(documentCount, exceptionSequence), FunctionErrorStore.getCount());
}
/**
@@ -277,10 +283,11 @@
* abort-methode is called, to comunicate the status of the cpm to everyone who is listening for
* errors.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testProcessCasWithOutOfMemoryError() throws Exception {
+ @Test
+ public void testProcessCasWithOutOfMemoryError() throws Exception {
int documentCount = 20; // number of documents processed
int exceptionSequence = 3; // the sequence in which errors are produced
ManageOutputDevice.setAllSystemOutputToNirvana();
@@ -298,7 +305,8 @@
ManageOutputDevice.setAllSystemOutputToDefault();
// System.out.println(FunctionErrorStore.printStats());
assertEquals("Abort was not called!", true, listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ", 1, FunctionErrorStore.getCount());
+ assertEquals("There are not as much exceptions as expected! ", 1,
+ FunctionErrorStore.getCount());
assertEquals("There is no Error thrown! ", true, listener.hasError());
}
@@ -307,10 +315,11 @@
* <b>expected behaviour:</b><br>
* The cpm should finish correctly. The aborted- method of the listener is not called.
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testProcessCasWithNullPointerException() throws Exception {
+ @Test
+ public void testProcessCasWithNullPointerException() throws Exception {
int documentCount = 20; // number of documents processed
int exceptionSequence = 3; // the sequence in which errors are produced
ManageOutputDevice.setAllSystemOutputToNirvana();
@@ -324,15 +333,15 @@
cpeProcessNoMsg(cpe, listener);
// check the results, if everything worked as expected
ManageOutputDevice.setAllSystemOutputToDefault();
- assertEquals("The cpm did not call the listener, that the cpm has finished.", true, listener
- .isFinished());
+ assertEquals("The cpm did not call the listener, that the cpm has finished.", true,
+ listener.isFinished());
assertEquals("The aborted-method of the listener was called!", false, listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ", countExceptions(documentCount,
- exceptionSequence), FunctionErrorStore.getCount());
+ assertEquals("There are not as much exceptions as expected! ",
+ countExceptions(documentCount, exceptionSequence), FunctionErrorStore.getCount());
}
- @AfterEach
- public void tearDown() throws Exception {
+ @AfterEach
+ public void tearDown() throws Exception {
FunctionErrorStore.resetCount();
}
@@ -356,9 +365,12 @@
CollectionProcessingEngine cpe = null;
try {
- String colReaderBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestCollectionReader.xml").getAbsolutePath();
- String taeBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestAnnotator.xml").getAbsolutePath();
- String casConsumerBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestCasConsumer.xml").getAbsolutePath();
+ String colReaderBase = JUnitExtension
+ .getFile("CpmTests" + FS + "ErrorTestCollectionReader.xml").getAbsolutePath();
+ String taeBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestAnnotator.xml")
+ .getAbsolutePath();
+ String casConsumerBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestCasConsumer.xml")
+ .getAbsolutePath();
// first, prepare all descriptors as needed
String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, documentCount);
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCollectionReader_ErrorTest.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCollectionReader_ErrorTest.java
index 8362b08..e820203 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCollectionReader_ErrorTest.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCollectionReader_ErrorTest.java
@@ -45,21 +45,20 @@
* Test CollectionReader Error Handling<br>
*
* <p>
- * The TestCase aims to test the important methods normally used within the
- * CollectionReader (initialize, getNext, hasNext and getProgress). In each
- * function different Exceptions are thrown to test the behavior of the system
- * in such a situation.
+ * The TestCase aims to test the important methods normally used within the CollectionReader
+ * (initialize, getNext, hasNext and getProgress). In each function different Exceptions are thrown
+ * to test the behavior of the system in such a situation.
* </p>
* <p>
- * To offer a short introduction into the general mode of operation have a look
- * at the following list:
+ * To offer a short introduction into the general mode of operation have a look at the following
+ * list:
* </p>
* <ul>
- * <li> generate the descriptors, with fit to the test case. For instance a
- * CollectionReader which throws a (runtime) exception every 5th document. </li>
- * <li> [optional] add some mechanism to handle errors in the tests (timeouts or
- * try-catch blocks) </li>
- * <li> run the test and check for the results </li>
+ * <li>generate the descriptors, with fit to the test case. For instance a CollectionReader which
+ * throws a (runtime) exception every 5th document.</li>
+ * <li>[optional] add some mechanism to handle errors in the tests (timeouts or try-catch blocks)
+ * </li>
+ * <li>run the test and check for the results</li>
* </ul>
*
* Also have a look at <br>
@@ -69,743 +68,723 @@
*/
public class CpmCollectionReader_ErrorTest {
- private static final String FS = System.getProperties().getProperty(
- "file.separator");
+ private static final String FS = System.getProperties().getProperty("file.separator");
- private void cpeProcessNoMsg(CollectionProcessingEngine cpe,
- TestStatusCallbackListener listener) throws Exception {
- UIMAFramework.getLogger().setLevel(Level.OFF);
- try {
- cpe.process();
- while (!listener.isFinished() && !listener.isAborted()) {
- Thread.sleep(5);
- }
- } finally {
- UIMAFramework.getLogger().setLevel(Level.INFO);
- }
- }
-
- /**
- * <b>test case:</b> the getNext method throws an OutOfMemoryError.<br>
- * <b>expected behavior:</b><br>
- * The cpm notify the entityProcessComplete method of the listener and
- * propagate the error in the EntityProcessStatus. After that, the cpm is
- * shut down and the abort method is called.
- *
- * @throws Exception -
- */
- @Test
- public void testGetNextWithOutOfMemoryError() throws Exception {
- int documentCount = 20; // number of documents processed
- int exceptionSequence = 5; // the sequence in which errors are produced
- ManageOutputDevice.setAllSystemOutputToNirvana();
-
- // setup CPM
- CollectionProcessingEngine cpe = setupCpm(documentCount,
- "OutOfMemoryError", exceptionSequence, "getNext");
-
- // Create and register a Status Callback Listener
- CollectionReaderStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
- cpe);
- cpe.addStatusCallbackListener(listener);
-
+ private void cpeProcessNoMsg(CollectionProcessingEngine cpe, TestStatusCallbackListener listener)
+ throws Exception {
+ UIMAFramework.getLogger().setLevel(Level.OFF);
+ try {
cpe.process();
-
- // wait until cpm has finished
while (!listener.isFinished() && !listener.isAborted()) {
- Thread.sleep(5);
+ Thread.sleep(5);
}
- ManageOutputDevice.setAllSystemOutputToDefault();
- assertEquals("Abort was not called as expected.", true, listener
- .isAborted());
- assertEquals(
+ } finally {
+ UIMAFramework.getLogger().setLevel(Level.INFO);
+ }
+ }
+
+ /**
+ * <b>test case:</b> the getNext method throws an OutOfMemoryError.<br>
+ * <b>expected behavior:</b><br>
+ * The cpm notify the entityProcessComplete method of the listener and propagate the error in the
+ * EntityProcessStatus. After that, the cpm is shut down and the abort method is called.
+ *
+ * @throws Exception
+ * -
+ */
+ @Test
+ public void testGetNextWithOutOfMemoryError() throws Exception {
+ int documentCount = 20; // number of documents processed
+ int exceptionSequence = 5; // the sequence in which errors are produced
+ ManageOutputDevice.setAllSystemOutputToNirvana();
+
+ // setup CPM
+ CollectionProcessingEngine cpe = setupCpm(documentCount, "OutOfMemoryError", exceptionSequence,
+ "getNext");
+
+ // Create and register a Status Callback Listener
+ CollectionReaderStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
+ cpe);
+ cpe.addStatusCallbackListener(listener);
+
+ cpe.process();
+
+ // wait until cpm has finished
+ while (!listener.isFinished() && !listener.isAborted()) {
+ Thread.sleep(5);
+ }
+ ManageOutputDevice.setAllSystemOutputToDefault();
+ assertEquals("Abort was not called as expected.", true, listener.isAborted());
+ assertEquals(
"The cpm called the listener, that the cpm has finished - which normally could not be.",
false, listener.isFinished());
- assertEquals("There are not as much exceptions as expected! ", 1,
+ assertEquals("There are not as much exceptions as expected! ", 1,
FunctionErrorStore.getCount());
- checkForOutOfMemoryError(listener);
- }
+ checkForOutOfMemoryError(listener);
+ }
- /**
- * <b>test case:</b> the getNext method throws multiple
- * CollectionExceptions.<br>
- * <b>expected behavior:</b><br>
- * The cpm should finish. The cpm by itself is shut down, and the
- * collectionProcessComplete-method of the listener was called
- *
- * @throws Exception -
- */
- @Test
- public void testGetNextWithCollectionException() throws Exception {
- int documentCount = 20; // number of documents processed
- int exceptionSequence = 2; // the sequence in which errors are produced
- ManageOutputDevice.setAllSystemOutputToNirvana();
+ /**
+ * <b>test case:</b> the getNext method throws multiple CollectionExceptions.<br>
+ * <b>expected behavior:</b><br>
+ * The cpm should finish. The cpm by itself is shut down, and the collectionProcessComplete-method
+ * of the listener was called
+ *
+ * @throws Exception
+ * -
+ */
+ @Test
+ public void testGetNextWithCollectionException() throws Exception {
+ int documentCount = 20; // number of documents processed
+ int exceptionSequence = 2; // the sequence in which errors are produced
+ ManageOutputDevice.setAllSystemOutputToNirvana();
- // setup CPM
- CollectionProcessingEngine cpe = setupCpm(documentCount,
- "CollectionException", exceptionSequence, "getNext");
-
- // Create and register a Status Callback Listener
- TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
- cpe);
- cpe.addStatusCallbackListener(listener);
-
- cpeProcessNoMsg(cpe, listener);
-
- ManageOutputDevice.setAllSystemOutputToDefault();
- // check the results, if everything worked as expected
- assertEquals(
- "The cpm is still working or the collectionProcessComplete-method of the listener was not called.",
- true, listener.isFinished());
- assertEquals(
- "The cpm propably didn't finish correctly! The aborted method of the listener was called.",
- false, listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ",
- documentCount / exceptionSequence, FunctionErrorStore.getCount());
- }
-
- /**
- * <b>test case:</b> the getNext method throws multiple IOExceptions.<br>
- * <b>expected behavior:</b><br>
- * The cpm should finish. The cpm by itself is shut down, and the
- * collectionProcessComplete-method of the listener was called
- *
- * @throws Exception -
- */
- @Test
- public void testGetNextWithIOException() throws Exception {
- int TIMEOUT = 10; // seconds, till the test is aborted
- int documentCount = 20; // number of documents processed
- int exceptionSequence = 3; // the sequence in which errors are produced
- ManageOutputDevice.setAllSystemOutputToNirvana();
-
- // setup CPM
- CollectionProcessingEngine cpe = setupCpm(documentCount, "IOException",
+ // setup CPM
+ CollectionProcessingEngine cpe = setupCpm(documentCount, "CollectionException",
exceptionSequence, "getNext");
- // Create and register a Status Callback Listener
- TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
- cpe);
- cpe.addStatusCallbackListener(listener);
+ // Create and register a Status Callback Listener
+ TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(cpe);
+ cpe.addStatusCallbackListener(listener);
- cpe.process();
+ cpeProcessNoMsg(cpe, listener);
- // wait until cpm has finished
- Date d = new Date();
- long time = d.getTime() + 1000 * TIMEOUT;
- while (!listener.isFinished() && !listener.isAborted()) {
- Thread.sleep(5);
- d = new Date();
- // timeout mechanism
- if (time < d.getTime()) {
- System.out.println("CPM manually aborted!");
- cpe.stop();
- // wait until CPM has aborted
- while (!listener.isAborted()) {
- Thread.sleep(5);
- }
- }
+ ManageOutputDevice.setAllSystemOutputToDefault();
+ // check the results, if everything worked as expected
+ assertEquals(
+ "The cpm is still working or the collectionProcessComplete-method of the listener was not called.",
+ true, listener.isFinished());
+ assertEquals(
+ "The cpm propably didn't finish correctly! The aborted method of the listener was called.",
+ false, listener.isAborted());
+ assertEquals("There are not as much exceptions as expected! ",
+ documentCount / exceptionSequence, FunctionErrorStore.getCount());
+ }
+
+ /**
+ * <b>test case:</b> the getNext method throws multiple IOExceptions.<br>
+ * <b>expected behavior:</b><br>
+ * The cpm should finish. The cpm by itself is shut down, and the collectionProcessComplete-method
+ * of the listener was called
+ *
+ * @throws Exception
+ * -
+ */
+ @Test
+ public void testGetNextWithIOException() throws Exception {
+ int TIMEOUT = 10; // seconds, till the test is aborted
+ int documentCount = 20; // number of documents processed
+ int exceptionSequence = 3; // the sequence in which errors are produced
+ ManageOutputDevice.setAllSystemOutputToNirvana();
+
+ // setup CPM
+ CollectionProcessingEngine cpe = setupCpm(documentCount, "IOException", exceptionSequence,
+ "getNext");
+
+ // Create and register a Status Callback Listener
+ TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(cpe);
+ cpe.addStatusCallbackListener(listener);
+
+ cpe.process();
+
+ // wait until cpm has finished
+ Date d = new Date();
+ long time = d.getTime() + 1000 * TIMEOUT;
+ while (!listener.isFinished() && !listener.isAborted()) {
+ Thread.sleep(5);
+ d = new Date();
+ // timeout mechanism
+ if (time < d.getTime()) {
+ System.out.println("CPM manually aborted!");
+ cpe.stop();
+ // wait until CPM has aborted
+ while (!listener.isAborted()) {
+ Thread.sleep(5);
+ }
}
+ }
- ManageOutputDevice.setAllSystemOutputToDefault();
- // check the results, if everything worked as expected
- assertEquals(
+ ManageOutputDevice.setAllSystemOutputToDefault();
+ // check the results, if everything worked as expected
+ assertEquals(
"The cpm is still working or the collectionProcessComplete-method of the listener was not called.",
true, listener.isFinished());
- assertEquals(
+ assertEquals(
"The cpm propably didn't finish correctly! The aborted method of the listener was called.",
false, listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ",
+ assertEquals("There are not as much exceptions as expected! ",
documentCount / exceptionSequence, FunctionErrorStore.getCount());
- }
+ }
- /**
- * <b>test case:</b> the getNext method throws multiple
- * NullPointerExceptions.<br>
- * <b>expected behavior:</b><br>
- * The cpm should finish. The cpm by itself is shut down, and the
- * collectionProcessComplete-method of the listener was called
- *
- * @throws Exception -
- */
- @Test
- public void testGetNextWithNullPointerException() throws Exception {
- int documentCount = 20; // number of documents processed
- int exceptionSequence = 2; // the sequence in which errors are produced
- ManageOutputDevice.setAllSystemOutputToNirvana();
+ /**
+ * <b>test case:</b> the getNext method throws multiple NullPointerExceptions.<br>
+ * <b>expected behavior:</b><br>
+ * The cpm should finish. The cpm by itself is shut down, and the collectionProcessComplete-method
+ * of the listener was called
+ *
+ * @throws Exception
+ * -
+ */
+ @Test
+ public void testGetNextWithNullPointerException() throws Exception {
+ int documentCount = 20; // number of documents processed
+ int exceptionSequence = 2; // the sequence in which errors are produced
+ ManageOutputDevice.setAllSystemOutputToNirvana();
- // setup CPM
- CollectionProcessingEngine cpe = setupCpm(documentCount,
- "NullPointerException", exceptionSequence, "getNext");
+ // setup CPM
+ CollectionProcessingEngine cpe = setupCpm(documentCount, "NullPointerException",
+ exceptionSequence, "getNext");
- // Create and register a Status Callback Listener
- TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
- cpe);
- cpe.addStatusCallbackListener(listener);
+ // Create and register a Status Callback Listener
+ TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(cpe);
+ cpe.addStatusCallbackListener(listener);
- cpeProcessNoMsg(cpe, listener);
+ cpeProcessNoMsg(cpe, listener);
- ManageOutputDevice.setAllSystemOutputToDefault();
- // check the results, if everything worked as expected
- assertEquals(
+ ManageOutputDevice.setAllSystemOutputToDefault();
+ // check the results, if everything worked as expected
+ assertEquals(
"The cpm is still working or the collectionProcessComplete-method of the listener was not called.",
true, listener.isFinished());
- assertEquals(
+ assertEquals(
"The cpm propably didn't finish correctly! The aborted method of the listener was called.",
false, listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ",
+ assertEquals("There are not as much exceptions as expected! ",
documentCount / exceptionSequence, FunctionErrorStore.getCount());
- }
+ }
- /**
- * <b>test case:</b> the hasNext method throws a OutOfMemoryError.<br>
- * <b>expected behavior:</b><br>
- * The cpm notifies the entityProcessComplete method of the listener and
- * propagate the error in the EntityProcessStatus. After that, the cpm is
- * shut down and the abort method is called.
- *
- * @throws Exception -
- */
- @Test
- public void testHasNextWithOutOfMemoryError() throws Exception {
- int documentCount = 20; // number of documents processed
- int exceptionSequence = 4; // the sequence in which errors are produced
- ManageOutputDevice.setAllSystemOutputToNirvana();
+ /**
+ * <b>test case:</b> the hasNext method throws a OutOfMemoryError.<br>
+ * <b>expected behavior:</b><br>
+ * The cpm notifies the entityProcessComplete method of the listener and propagate the error in
+ * the EntityProcessStatus. After that, the cpm is shut down and the abort method is called.
+ *
+ * @throws Exception
+ * -
+ */
+ @Test
+ public void testHasNextWithOutOfMemoryError() throws Exception {
+ int documentCount = 20; // number of documents processed
+ int exceptionSequence = 4; // the sequence in which errors are produced
+ ManageOutputDevice.setAllSystemOutputToNirvana();
- // setup CPM
- CollectionProcessingEngine cpe = setupCpm(documentCount,
- "OutOfMemoryError", exceptionSequence, "hasNext");
+ // setup CPM
+ CollectionProcessingEngine cpe = setupCpm(documentCount, "OutOfMemoryError", exceptionSequence,
+ "hasNext");
- // Create and register a Status Callback Listener
- CollectionReaderStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
+ // Create and register a Status Callback Listener
+ CollectionReaderStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
cpe);
- cpe.addStatusCallbackListener(listener);
+ cpe.addStatusCallbackListener(listener);
- cpeProcessNoMsg(cpe, listener);
+ cpeProcessNoMsg(cpe, listener);
- ManageOutputDevice.setAllSystemOutputToDefault();
- // check the results, if everything worked as expected
- assertEquals(
+ ManageOutputDevice.setAllSystemOutputToDefault();
+ // check the results, if everything worked as expected
+ assertEquals(
"The cpm called the listener, that the cpm has finished - which normally could not be.",
false, listener.isFinished());
- assertEquals("Abort was not called.", true, listener.isAborted());
- assertEquals("There are not as much exceptions as expected! ", 1,
+ assertEquals("Abort was not called.", true, listener.isAborted());
+ assertEquals("There are not as much exceptions as expected! ", 1,
FunctionErrorStore.getCount());
- checkForOutOfMemoryError(listener);
- }
+ checkForOutOfMemoryError(listener);
+ }
- /**
- * <b>test case:</b> the hasNext method throws a NullPointerException.<br>
- * <b>expected behavior:</b><br>
- * The cpm should automatically finish. No error should be reported and the
- * finished method
- *
- * @throws Exception -
- */
- @Test
- public void testHasNextWithNullPointerException() throws Exception {
- int TIMEOUT = 20; // seconds, till the test is aborted
- int documentCount = 30; // number of documents processed
- int exceptionSequence = 4; // the sequence in which errors are produced
- boolean manuallyAborted = false; // flag, if we shut down the cpm by hand.
- ManageOutputDevice.setAllSystemOutputToNirvana();
+ /**
+ * <b>test case:</b> the hasNext method throws a NullPointerException.<br>
+ * <b>expected behavior:</b><br>
+ * The cpm should automatically finish. No error should be reported and the finished method
+ *
+ * @throws Exception
+ * -
+ */
+ @Test
+ public void testHasNextWithNullPointerException() throws Exception {
+ int TIMEOUT = 20; // seconds, till the test is aborted
+ int documentCount = 30; // number of documents processed
+ int exceptionSequence = 4; // the sequence in which errors are produced
+ boolean manuallyAborted = false; // flag, if we shut down the cpm by hand.
+ ManageOutputDevice.setAllSystemOutputToNirvana();
+ // setup CPM
+ CollectionProcessingEngine cpe = setupCpm(documentCount, "NullPointerException",
+ exceptionSequence, "hasNext");
+
+ // Create and register a Status Callback Listener
+ TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(cpe);
+ cpe.addStatusCallbackListener(listener);
+
+ cpe.process();
+
+ // wait until cpm has finished
+ Date d = new Date();
+ long time = d.getTime() + 1000 * TIMEOUT;
+ while (!listener.isFinished() && !listener.isAborted()) {
+ Thread.sleep(5);
+ d = new Date();
+ // timeout mechanism
+ if (time < d.getTime()) {
+ manuallyAborted = true;
+ cpe.stop();
+ // wait until CPM has aborted
+ while (!listener.isAborted()) {
+ Thread.sleep(5);
+ }
+ }
+ }
+
+ ManageOutputDevice.setAllSystemOutputToDefault();
+ // check the results, if everything worked as expected
+ assertEquals("The cpm didn't finish correctly! Abort was called.", false, listener.isAborted());
+ assertEquals("The cpm didn't finish correctly! Finish was not called.", true,
+ listener.isFinished());
+ assertEquals("The cpm was manually aborted.", false, manuallyAborted);
+ }
+
+ /**
+ * <b>test case:</b> the hasNext method throws a ResourceInitializationException.<br>
+ * <b>expected behavior:</b><br>
+ * The cpm should not finish. An exception is thrown to the caller class.
+ *
+ * @throws Exception
+ * -
+ */
+ @Test
+ public void testInitializeWithResourceInitializationException() throws Exception {
+ int documentCount = 20; // number of documents processed
+ int exceptionSequence = 1; // the sequence in which errors are produced
+ TestStatusCallbackListener listener = null; // listener with which the
+ // status information are
+ // made available
+ boolean exceptionThrown = false; // flag, if the expected exception was
+ // thrown
+ ManageOutputDevice.setAllSystemOutputToNirvana();
+
+ try {
// setup CPM
- CollectionProcessingEngine cpe = setupCpm(documentCount,
- "NullPointerException", exceptionSequence, "hasNext");
+ CollectionProcessingEngine cpe = setupCpm(documentCount, "ResourceInitializationException",
+ exceptionSequence, "initialize");
// Create and register a Status Callback Listener
- TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
- cpe);
+ listener = new CollectionReaderStatusCallbackListener(cpe);
cpe.addStatusCallbackListener(listener);
cpe.process();
// wait until cpm has finished
- Date d = new Date();
- long time = d.getTime() + 1000 * TIMEOUT;
- while (!listener.isFinished() && !listener.isAborted()) {
- Thread.sleep(5);
- d = new Date();
- // timeout mechanism
- if (time < d.getTime()) {
- manuallyAborted = true;
- cpe.stop();
- // wait until CPM has aborted
- while (!listener.isAborted()) {
- Thread.sleep(5);
- }
- }
- }
+ while (!listener.isFinished() && !listener.isAborted()) {
+ Thread.sleep(5);
+ }
+ } catch (ResourceInitializationException e) {
+ exceptionThrown = true;
+ } finally {
ManageOutputDevice.setAllSystemOutputToDefault();
// check the results, if everything worked as expected
assertEquals("The cpm didn't finish correctly! Abort was called.", false,
- listener.isAborted());
- assertEquals("The cpm didn't finish correctly! Finish was not called.",
- true, listener.isFinished());
- assertEquals("The cpm was manually aborted.", false, manuallyAborted);
- }
+ listener.isAborted());
+ assertEquals(
+ "The cpm called the listener, that the cpm has finished - which normally could not be.",
+ false, listener.isFinished());
+ assertEquals("There are not as much exceptions as expected! ", 1,
+ FunctionErrorStore.getCount());
+ assertEquals(
+ "The expected ResourceInitializationException was not fiven back to the programm. ",
+ true, exceptionThrown);
+ // that's it.
+ }
+ }
- /**
- * <b>test case:</b> the hasNext method throws a
- * ResourceInitializationException.<br>
- * <b>expected behavior:</b><br>
- * The cpm should not finish. An exception is thrown to the caller class.
- *
- * @throws Exception -
- */
- @Test
- public void testInitializeWithResourceInitializationException()
- throws Exception {
- int documentCount = 20; // number of documents processed
- int exceptionSequence = 1; // the sequence in which errors are produced
- TestStatusCallbackListener listener = null; // listener with which the
- // status information are
- // made available
- boolean exceptionThrown = false; // flag, if the expected exception was
- // thrown
- ManageOutputDevice.setAllSystemOutputToNirvana();
+ /**
+ * <b>test case:</b> the initialize method throws a NullPointerException.<br>
+ * <b>expected behavior:</b><br>
+ * The cpm should not finish. An exception is thrown to the caller class.
+ *
+ * @throws Exception
+ * -
+ */
+ @Test
+ public void testInitializeWithNullPointerException() throws Exception {
+ int documentCount = 20; // number of documents processed
+ int exceptionSequence = 1; // the sequence in which errors are produced
+ boolean exceptionThrown = false; // flag, if the expected exception was
+ // thrown
+ ManageOutputDevice.setAllSystemOutputToNirvana();
+ TestStatusCallbackListener listener = null;
- try {
- // setup CPM
- CollectionProcessingEngine cpe = setupCpm(documentCount,
- "ResourceInitializationException", exceptionSequence,
- "initialize");
-
- // Create and register a Status Callback Listener
- listener = new CollectionReaderStatusCallbackListener(cpe);
- cpe.addStatusCallbackListener(listener);
-
- cpe.process();
-
- // wait until cpm has finished
-
- while (!listener.isFinished() && !listener.isAborted()) {
- Thread.sleep(5);
- }
- } catch (ResourceInitializationException e) {
- exceptionThrown = true;
- } finally {
- ManageOutputDevice.setAllSystemOutputToDefault();
- // check the results, if everything worked as expected
- assertEquals("The cpm didn't finish correctly! Abort was called.",
- false, listener.isAborted());
- assertEquals(
- "The cpm called the listener, that the cpm has finished - which normally could not be.",
- false, listener.isFinished());
- assertEquals("There are not as much exceptions as expected! ", 1,
- FunctionErrorStore.getCount());
- assertEquals(
- "The expected ResourceInitializationException was not fiven back to the programm. ",
- true, exceptionThrown);
- // that's it.
- }
- }
-
- /**
- * <b>test case:</b> the initialize method throws a NullPointerException.<br>
- * <b>expected behavior:</b><br>
- * The cpm should not finish. An exception is thrown to the caller class.
- *
- * @throws Exception -
- */
- @Test
- public void testInitializeWithNullPointerException() throws Exception {
- int documentCount = 20; // number of documents processed
- int exceptionSequence = 1; // the sequence in which errors are produced
- boolean exceptionThrown = false; // flag, if the expected exception was
- // thrown
- ManageOutputDevice.setAllSystemOutputToNirvana();
- TestStatusCallbackListener listener = null;
-
- try {
- // setup CPM
- CollectionProcessingEngine cpe = setupCpm(documentCount,
- "NullPointerException", exceptionSequence, "initialize");
-
- // Create and register a Status Callback Listener
- listener = new CollectionReaderStatusCallbackListener(cpe);
- cpe.addStatusCallbackListener(listener);
-
- cpe.process();
-
- // wait until cpm has finished
- while (!listener.isFinished() && !listener.isAborted()) {
- Thread.sleep(5);
- }
- } catch (ResourceInitializationException e) {
- // e.printStackTrace();
- exceptionThrown = true;
- } finally {
- ManageOutputDevice.setAllSystemOutputToDefault();
- // check the results, if everything worked as expected
- assertEquals("Abort was called.", false, listener.isAborted());
- assertEquals(
- "The cpm called the listener, that the cpm has finished - which normally could not be.",
- false, listener.isFinished());
- assertEquals("There are not as much exceptions as expected! ", 1,
- FunctionErrorStore.getCount());
- assertEquals(
- "The expected ResourceInitializationException was not fiven back to the programm. ",
- true, exceptionThrown);
- }
- }
-
- /**
- * <b>test case:</b> the initialize method throws a OutOfMemoryError.<br>
- * <b>expected behavior:</b><br>
- * The cpm should not finish correctly. An exception is thrown to the caller
- * class.
- *
- * @throws Exception -
- */
- @Test
- public void testInitializeWithOutOfMemoryError() throws Exception {
- boolean outOfMemoryError = false;
- int documentCount = 20; // number of documents processed
- int exceptionSequence = 1; // the sequence in which errors are produced
- ManageOutputDevice.setAllSystemOutputToNirvana();
- CollectionReaderStatusCallbackListener listener = null; // listener with
- // which the
- // statusinformation are made avaiable
-
- try {
- // setup CPM
- CollectionProcessingEngine cpe = setupCpm(documentCount,
- "OutOfMemoryError", exceptionSequence, "initialize");
-
- // Create and register a Status Callback Listener
- listener = new CollectionReaderStatusCallbackListener(cpe);
- cpe.addStatusCallbackListener(listener);
-
- cpe.process();
-
- // wait until cpm has finished
- while (!listener.isFinished() && !listener.isAborted()) {
- Thread.sleep(5);
- }
- } catch (OutOfMemoryError e) {
- outOfMemoryError = true;
- } finally {
- ManageOutputDevice.setAllSystemOutputToDefault();
- // check the results, if everything worked as expected
- assertEquals("The OutOfMemoryError is not given back to the caller.",
- true, outOfMemoryError);
- assertEquals("Abort was called.", false, listener.isAborted());
- assertEquals(
- "The cpm called the listener, that the cpm has finished - which normally could not be.",
- false, listener.isFinished());
- assertEquals("There are not as much exceptions as expected! ", 1,
- FunctionErrorStore.getCount());
- }
-
- }
-
- /**
- * <b>test case:</b> the getProgress method throws multiple IOExceptions.<br>
- * <b>expected behavior:</b><br>
- * The cpm should finish. The cpm by itself is shut down, and the
- * collectionProcessComplete-method of the listener was called
- *
- * @throws Exception -
- */
- @Test
- public void testGetProgressWithIOException() throws Exception {
- int documentCount = 20; // number of documents processed
- int exceptionSequence = 3; // the sequence in which errors are produced
- ManageOutputDevice.setAllSystemOutputToNirvana();
-
+ try {
// setup CPM
- CollectionProcessingEngine cpe = setupCpm(documentCount, "IOException",
+ CollectionProcessingEngine cpe = setupCpm(documentCount, "NullPointerException",
+ exceptionSequence, "initialize");
+
+ // Create and register a Status Callback Listener
+ listener = new CollectionReaderStatusCallbackListener(cpe);
+ cpe.addStatusCallbackListener(listener);
+
+ cpe.process();
+
+ // wait until cpm has finished
+ while (!listener.isFinished() && !listener.isAborted()) {
+ Thread.sleep(5);
+ }
+ } catch (ResourceInitializationException e) {
+ // e.printStackTrace();
+ exceptionThrown = true;
+ } finally {
+ ManageOutputDevice.setAllSystemOutputToDefault();
+ // check the results, if everything worked as expected
+ assertEquals("Abort was called.", false, listener.isAborted());
+ assertEquals(
+ "The cpm called the listener, that the cpm has finished - which normally could not be.",
+ false, listener.isFinished());
+ assertEquals("There are not as much exceptions as expected! ", 1,
+ FunctionErrorStore.getCount());
+ assertEquals(
+ "The expected ResourceInitializationException was not fiven back to the programm. ",
+ true, exceptionThrown);
+ }
+ }
+
+ /**
+ * <b>test case:</b> the initialize method throws a OutOfMemoryError.<br>
+ * <b>expected behavior:</b><br>
+ * The cpm should not finish correctly. An exception is thrown to the caller class.
+ *
+ * @throws Exception
+ * -
+ */
+ @Test
+ public void testInitializeWithOutOfMemoryError() throws Exception {
+ boolean outOfMemoryError = false;
+ int documentCount = 20; // number of documents processed
+ int exceptionSequence = 1; // the sequence in which errors are produced
+ ManageOutputDevice.setAllSystemOutputToNirvana();
+ CollectionReaderStatusCallbackListener listener = null; // listener with
+ // which the
+ // statusinformation are made avaiable
+
+ try {
+ // setup CPM
+ CollectionProcessingEngine cpe = setupCpm(documentCount, "OutOfMemoryError",
+ exceptionSequence, "initialize");
+
+ // Create and register a Status Callback Listener
+ listener = new CollectionReaderStatusCallbackListener(cpe);
+ cpe.addStatusCallbackListener(listener);
+
+ cpe.process();
+
+ // wait until cpm has finished
+ while (!listener.isFinished() && !listener.isAborted()) {
+ Thread.sleep(5);
+ }
+ } catch (OutOfMemoryError e) {
+ outOfMemoryError = true;
+ } finally {
+ ManageOutputDevice.setAllSystemOutputToDefault();
+ // check the results, if everything worked as expected
+ assertEquals("The OutOfMemoryError is not given back to the caller.", true, outOfMemoryError);
+ assertEquals("Abort was called.", false, listener.isAborted());
+ assertEquals(
+ "The cpm called the listener, that the cpm has finished - which normally could not be.",
+ false, listener.isFinished());
+ assertEquals("There are not as much exceptions as expected! ", 1,
+ FunctionErrorStore.getCount());
+ }
+
+ }
+
+ /**
+ * <b>test case:</b> the getProgress method throws multiple IOExceptions.<br>
+ * <b>expected behavior:</b><br>
+ * The cpm should finish. The cpm by itself is shut down, and the collectionProcessComplete-method
+ * of the listener was called
+ *
+ * @throws Exception
+ * -
+ */
+ @Test
+ public void testGetProgressWithIOException() throws Exception {
+ int documentCount = 20; // number of documents processed
+ int exceptionSequence = 3; // the sequence in which errors are produced
+ ManageOutputDevice.setAllSystemOutputToNirvana();
+
+ // setup CPM
+ CollectionProcessingEngine cpe = setupCpm(documentCount, "IOException", exceptionSequence,
+ "getProgress");
+
+ // Create and register a Status Callback Listener
+ TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(cpe);
+ cpe.addStatusCallbackListener(listener);
+
+ cpe.process();
+
+ // wait until cpm has finished
+ while (!listener.isFinished() && !listener.isAborted()) {
+ Thread.sleep(5);
+ }
+
+ ManageOutputDevice.setAllSystemOutputToDefault();
+ // check the results, if everything worked as expected
+ assertEquals("Abort was called.", false, listener.isAborted());
+ assertEquals(
+ "The cpm is still working or the collectionProcessComplete-method of the listener was not called.",
+ true, listener.isFinished());
+ assertEquals("There are not as much exceptions as expected! ",
+ (documentCount / exceptionSequence), FunctionErrorStore.getCount());
+ // that's it.
+ }
+
+ /**
+ * <b>test case:</b> the getProgress method throws one OutOfMemoryError.<br>
+ * <b>expected behavior:</b><br>
+ * The cpm notifies the entityProcessComplete method of the listener and propagate the error in
+ * the EntityProcessStatus. After that, the cpm is shut down and the abort method is called.
+ *
+ * @throws Exception
+ * -
+ */
+ @Test
+ public void testGetProcessWithOutOfMemoryError() throws Exception {
+ int documentCount = 20; // number of documents processed
+ int exceptionSequence = 3; // the sequence in which errors are produced
+ ManageOutputDevice.setAllSystemOutputToNirvana();
+
+ // setup CPM
+ CollectionProcessingEngine cpe = setupCpm(documentCount, "OutOfMemoryError", exceptionSequence,
+ "getProgress");
+
+ // Create and register a Status Callback Listener
+ CollectionReaderStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
+ cpe);
+ cpe.addStatusCallbackListener(listener);
+
+ cpe.process();
+
+ // wait until cpm has finished
+ while (!listener.isFinished() && !listener.isAborted()) {
+ Thread.sleep(5);
+ }
+
+ ManageOutputDevice.setAllSystemOutputToDefault();
+ // check the results, if everything worked as expected
+ assertEquals("Abort was not called.", true, listener.isAborted());
+ assertEquals("The collectionProcessComplete-method of the listener was called. - Unexpected!",
+ false, listener.isFinished());
+ assertEquals("There are not as much exceptions as expected! ", 1,
+ FunctionErrorStore.getCount());
+ checkForOutOfMemoryError(listener);
+ }
+
+ /**
+ * <b>test case:</b> the getProgress method throws multiple NullPointerExceptions.<br>
+ * <b>expected behavior:</b><br>
+ * The cpm should finish. The cpm by itself is shut down, and the collectionProcessComplete-method
+ * of the listener was called
+ *
+ * @throws Exception
+ * -
+ */
+ @Test
+ public void testGetProgressWithNullPointerException() throws Exception {
+ int documentCount = 20; // number of documents processed
+ int exceptionSequence = 3; // the sequence in which errors are produced
+ ManageOutputDevice.setAllSystemOutputToNirvana();
+
+ // setup CPM
+ CollectionProcessingEngine cpe = setupCpm(documentCount, "NullPointerException",
exceptionSequence, "getProgress");
- // Create and register a Status Callback Listener
- TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
- cpe);
- cpe.addStatusCallbackListener(listener);
+ // Create and register a Status Callback Listener
+ TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(cpe);
+ cpe.addStatusCallbackListener(listener);
- cpe.process();
+ cpe.process();
- // wait until cpm has finished
- while (!listener.isFinished() && !listener.isAborted()) {
- Thread.sleep(5);
- }
+ // wait until cpm has finished
+ while (!listener.isFinished() && !listener.isAborted()) {
+ Thread.sleep(5);
+ }
- ManageOutputDevice.setAllSystemOutputToDefault();
- // check the results, if everything worked as expected
- assertEquals("Abort was called.", false, listener.isAborted());
- assertEquals(
+ ManageOutputDevice.setAllSystemOutputToDefault();
+ // check the results, if everything worked as expected
+ assertEquals("Abort was called.", false, listener.isAborted());
+ assertEquals(
"The cpm is still working or the collectionProcessComplete-method of the listener was not called.",
true, listener.isFinished());
- assertEquals("There are not as much exceptions as expected! ",
- (documentCount / exceptionSequence), FunctionErrorStore.getCount());
- // that's it.
- }
-
- /**
- * <b>test case:</b> the getProgress method throws one OutOfMemoryError.<br>
- * <b>expected behavior:</b><br>
- * The cpm notifies the entityProcessComplete method of the listener and
- * propagate the error in the EntityProcessStatus. After that, the cpm is
- * shut down and the abort method is called.
- *
- * @throws Exception -
- */
- @Test
- public void testGetProcessWithOutOfMemoryError() throws Exception {
- int documentCount = 20; // number of documents processed
- int exceptionSequence = 3; // the sequence in which errors are produced
- ManageOutputDevice.setAllSystemOutputToNirvana();
-
- // setup CPM
- CollectionProcessingEngine cpe = setupCpm(documentCount,
- "OutOfMemoryError", exceptionSequence, "getProgress");
-
- // Create and register a Status Callback Listener
- CollectionReaderStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
- cpe);
- cpe.addStatusCallbackListener(listener);
-
- cpe.process();
-
- // wait until cpm has finished
- while (!listener.isFinished() && !listener.isAborted()) {
- Thread.sleep(5);
- }
-
- ManageOutputDevice.setAllSystemOutputToDefault();
- // check the results, if everything worked as expected
- assertEquals("Abort was not called.", true, listener.isAborted());
- assertEquals(
- "The collectionProcessComplete-method of the listener was called. - Unexpected!",
- false, listener.isFinished());
- assertEquals("There are not as much exceptions as expected! ", 1,
- FunctionErrorStore.getCount());
- checkForOutOfMemoryError(listener);
- }
-
- /**
- * <b>test case:</b> the getProgress method throws multiple
- * NullPointerExceptions.<br>
- * <b>expected behavior:</b><br>
- * The cpm should finish. The cpm by itself is shut down, and the
- * collectionProcessComplete-method of the listener was called
- *
- * @throws Exception -
- */
- @Test
- public void testGetProgressWithNullPointerException() throws Exception {
- int documentCount = 20; // number of documents processed
- int exceptionSequence = 3; // the sequence in which errors are produced
- ManageOutputDevice.setAllSystemOutputToNirvana();
-
- // setup CPM
- CollectionProcessingEngine cpe = setupCpm(documentCount,
- "NullPointerException", exceptionSequence, "getProgress");
-
- // Create and register a Status Callback Listener
- TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
- cpe);
- cpe.addStatusCallbackListener(listener);
-
- cpe.process();
-
- // wait until cpm has finished
- while (!listener.isFinished() && !listener.isAborted()) {
- Thread.sleep(5);
- }
-
- ManageOutputDevice.setAllSystemOutputToDefault();
- // check the results, if everything worked as expected
- assertEquals("Abort was called.", false, listener.isAborted());
- assertEquals(
- "The cpm is still working or the collectionProcessComplete-method of the listener was not called.",
- true, listener.isFinished());
- assertEquals("There are not as much exceptions as expected! ",
+ assertEquals("There are not as much exceptions as expected! ",
(documentCount / exceptionSequence), FunctionErrorStore.getCount());
- }
+ }
- // INFO: the close -methode could not be invoked by an external action
- // public void testCloseWithNullPointerException() throws Exception{
- // int TIMEOUT = 15; // seconds, till the test is aborted
- // int documentCount = 20; // number of documents processed
- // int exceptionSequence = 1; // the sequence in which errors are produced
- //
- // //setup CPM
- // CollectionProcessingEngine cpe =
- // setupCpm(
- // documentCount,
- // "NullPointerException",
- // exceptionSequence,
- // "close");
- //
- // //Create and register a Status Callback Listener
- // TestStatusCallbackListener listener =
- // new CollectionReaderStatusCallbackListener(cpe);
- // cpe.addStatusCallbackListener(listener);
- //
- // cpe.process();
- //
- // //wait until cpm has finished
- // while (!listener.isFinished() && !listener.isAborted()) {
- // Thread.sleep(5);
- //
- // }
- // // check the results, if everything worked as expected
- // assertEquals("The cpm didn't finish correctly! Abort was called.", false,
- // listener.isAborted());
- // assertEquals("The cpm didn't should down correctly", true,
- // listener.isFinished());
- // assertEquals("The cpm crashed.", false, manuallyAborted);
- // assertEquals("No Exception should be thrown!", 0,
- // FunctionErrorStore.getCount());
- // // that's it.
- // }
+ // INFO: the close -methode could not be invoked by an external action
+ // public void testCloseWithNullPointerException() throws Exception{
+ // int TIMEOUT = 15; // seconds, till the test is aborted
+ // int documentCount = 20; // number of documents processed
+ // int exceptionSequence = 1; // the sequence in which errors are produced
+ //
+ // //setup CPM
+ // CollectionProcessingEngine cpe =
+ // setupCpm(
+ // documentCount,
+ // "NullPointerException",
+ // exceptionSequence,
+ // "close");
+ //
+ // //Create and register a Status Callback Listener
+ // TestStatusCallbackListener listener =
+ // new CollectionReaderStatusCallbackListener(cpe);
+ // cpe.addStatusCallbackListener(listener);
+ //
+ // cpe.process();
+ //
+ // //wait until cpm has finished
+ // while (!listener.isFinished() && !listener.isAborted()) {
+ // Thread.sleep(5);
+ //
+ // }
+ // // check the results, if everything worked as expected
+ // assertEquals("The cpm didn't finish correctly! Abort was called.", false,
+ // listener.isAborted());
+ // assertEquals("The cpm didn't should down correctly", true,
+ // listener.isFinished());
+ // assertEquals("The cpm crashed.", false, manuallyAborted);
+ // assertEquals("No Exception should be thrown!", 0,
+ // FunctionErrorStore.getCount());
+ // // that's it.
+ // }
- @AfterEach
- public void tearDown() throws Exception {
- FunctionErrorStore.resetCount();
-// System.gc();
-// System.gc();
- }
+ @AfterEach
+ public void tearDown() throws Exception {
+ FunctionErrorStore.resetCount();
+ // System.gc();
+ // System.gc();
+ }
- private void checkForOutOfMemoryError(
- CollectionReaderStatusCallbackListener listener) {
- assertEquals("The indication failed, that an error was thrown.", true,
- listener.isAborted());
- assertEquals(
- "No Error was thrown (and no Exception) - expected was an OutOfMemoryError.",
- true, listener.hasError());
+ private void checkForOutOfMemoryError(CollectionReaderStatusCallbackListener listener) {
+ assertEquals("The indication failed, that an error was thrown.", true, listener.isAborted());
+ assertEquals("No Error was thrown (and no Exception) - expected was an OutOfMemoryError.", true,
+ listener.hasError());
- // the last CAS is maybe not the error CAS, since it is possible that the
- // status listener gets another CAS after the error occurred.
- // This checking is done in the Status listener
- // assertEquals("The expected null for the failed cas is missing.", true,
- // (listener.getLastCas() == null));
- assertEquals("There are not as much exceptions as expected! ", 1,
+ // the last CAS is maybe not the error CAS, since it is possible that the
+ // status listener gets another CAS after the error occurred.
+ // This checking is done in the Status listener
+ // assertEquals("The expected null for the failed cas is missing.", true,
+ // (listener.getLastCas() == null));
+ assertEquals("There are not as much exceptions as expected! ", 1,
FunctionErrorStore.getCount());
- assertEquals(
+ assertEquals(
"The cpm called the listener, that the cpm has finished - which normally could not be.",
false, listener.isFinished());
- }
+ }
- /**
- * setup the CPM with base functionality.
- *
- * @param documentCount
- * how many documents should be processed
- * @param exceptionName
- * the exception to be thrown
- * @param exceptionSequence
- * the iteration rate of the exceptions
- * @param functionName
- * the name of the function/method that throws the exception
- *
- * @return CollectionProcessingEngine - initialized cpe
- */
- private CollectionProcessingEngine setupCpm(int documentCount,
- String exceptionName, int exceptionSequence, String functionName) {
- CpeDescription cpeDesc = null;
- CollectionProcessingEngine cpe = null;
+ /**
+ * setup the CPM with base functionality.
+ *
+ * @param documentCount
+ * how many documents should be processed
+ * @param exceptionName
+ * the exception to be thrown
+ * @param exceptionSequence
+ * the iteration rate of the exceptions
+ * @param functionName
+ * the name of the function/method that throws the exception
+ *
+ * @return CollectionProcessingEngine - initialized cpe
+ */
+ private CollectionProcessingEngine setupCpm(int documentCount, String exceptionName,
+ int exceptionSequence, String functionName) {
+ CpeDescription cpeDesc = null;
+ CollectionProcessingEngine cpe = null;
- try {
- String colReaderBase = JUnitExtension.getFile(
- "CpmTests" + FS + "ErrorTestCollectionReader.xml")
- .getAbsolutePath();
- String taeBase = JUnitExtension.getFile(
- "CpmTests" + FS + "ErrorTestAnnotator.xml").getAbsolutePath();
- String casConsumerBase = JUnitExtension.getFile(
- "CpmTests" + FS + "ErrorTestCasConsumer.xml").getAbsolutePath();
+ try {
+ String colReaderBase = JUnitExtension
+ .getFile("CpmTests" + FS + "ErrorTestCollectionReader.xml").getAbsolutePath();
+ String taeBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestAnnotator.xml")
+ .getAbsolutePath();
+ String casConsumerBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestCasConsumer.xml")
+ .getAbsolutePath();
- // first, prepare all descriptors as needed
- String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(
- colReaderBase, true, functionName, exceptionSequence,
- exceptionName, documentCount);
- String taeDesc = DescriptorMakeUtil.makeAnalysisEngine(taeBase);
- String casConsumerDesc = DescriptorMakeUtil
- .makeCasConsumer(casConsumerBase);
+ // first, prepare all descriptors as needed
+ String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, true,
+ functionName, exceptionSequence, exceptionName, documentCount);
+ String taeDesc = DescriptorMakeUtil.makeAnalysisEngine(taeBase);
+ String casConsumerDesc = DescriptorMakeUtil.makeCasConsumer(casConsumerBase);
- // secondly, create the cpm based on the descriptors
- cpeDesc = CpeDescriptorFactory.produceDescriptor();
+ // secondly, create the cpm based on the descriptors
+ cpeDesc = CpeDescriptorFactory.produceDescriptor();
- // managing the default behaviour of this client
- CpeIntegratedCasProcessor integratedProcessor = CpeDescriptorFactory
- .produceCasProcessor("ErrorTestAnnotator");
- integratedProcessor.setDescriptor(taeDesc);
+ // managing the default behaviour of this client
+ CpeIntegratedCasProcessor integratedProcessor = CpeDescriptorFactory
+ .produceCasProcessor("ErrorTestAnnotator");
+ integratedProcessor.setDescriptor(taeDesc);
- CpeIntegratedCasProcessor casConsumer = CpeDescriptorFactory
- .produceCasProcessor("ErrorTest CasConsumer");
- casConsumer.setDescriptor(casConsumerDesc);
+ CpeIntegratedCasProcessor casConsumer = CpeDescriptorFactory
+ .produceCasProcessor("ErrorTest CasConsumer");
+ casConsumer.setDescriptor(casConsumerDesc);
- // - add all descriptors
- cpeDesc.addCollectionReader(colReaderDesc);
- cpeDesc.addCasProcessor(integratedProcessor);
- cpeDesc.addCasProcessor(casConsumer);
- cpeDesc.setInputQueueSize(2);
- cpeDesc.setOutputQueueSize(2);
- cpeDesc.setProcessingUnitThreadCount(1);
- // - Create a new CPE
- cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc, null,
- null);
- } catch (Exception e) {
- e.printStackTrace();
+ // - add all descriptors
+ cpeDesc.addCollectionReader(colReaderDesc);
+ cpeDesc.addCasProcessor(integratedProcessor);
+ cpeDesc.addCasProcessor(casConsumer);
+ cpeDesc.setInputQueueSize(2);
+ cpeDesc.setOutputQueueSize(2);
+ cpeDesc.setProcessingUnitThreadCount(1);
+ // - Create a new CPE
+ cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc, null, null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return cpe;
+ }
+
+ class CollectionReaderStatusCallbackListener extends TestStatusCallbackListener {
+ protected CollectionProcessingEngine cpe = null;
+
+ private boolean errorThrown = false; // indicates, if the
+
+ // OutOfMemoryError is thrown
+
+ public CollectionReaderStatusCallbackListener(CollectionProcessingEngine cpe) {
+ this.cpe = cpe;
+ }
+
+ /**
+ * @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#aborted()
+ */
+ @Override
+ public void aborted() {
+ super.aborted();
+ // System.out.println("abort was called.");
+ this.cpe.stop();
+ }
+
+ /**
+ * This method is modified, to react on OutOfMemoryErrors in the correct way.
+ *
+ * @see org.apache.uima.collection.StatusCallbackListener#entityProcessComplete(org.apache.uima.cas.CAS,
+ * org.apache.uima.collection.EntityProcessStatus)
+ */
+ @Override
+ public void entityProcessComplete(CAS aCas, EntityProcessStatus aStatus) {
+ super.entityProcessComplete(aCas, aStatus);
+ // check for a failure in processing...
+ if (aStatus.getStatusMessage().equals("failed")) {
+ Iterator iter = aStatus.getExceptions().iterator();
+ while (iter.hasNext()) {
+ // if there is an error ... call the cpm to kill and check for a
+ // null CAS
+ if (iter.next() instanceof java.lang.Error) {
+ this.cpe.kill();
+ this.errorThrown = true;
+ assertEquals("The cas is not null, as expected.", null, aCas);
+ }
+ }
}
- return cpe;
- }
+ }
- class CollectionReaderStatusCallbackListener extends
- TestStatusCallbackListener {
- protected CollectionProcessingEngine cpe = null;
-
- private boolean errorThrown = false; // indicates, if the
-
- // OutOfMemoryError is thrown
-
- public CollectionReaderStatusCallbackListener(
- CollectionProcessingEngine cpe) {
- this.cpe = cpe;
- }
-
- /**
- * @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#aborted()
- */
- @Override
- public void aborted() {
- super.aborted();
- // System.out.println("abort was called.");
- this.cpe.stop();
- }
-
- /**
- * This method is modified, to react on OutOfMemoryErrors in the correct
- * way.
- *
- * @see org.apache.uima.collection.StatusCallbackListener#entityProcessComplete(org.apache.uima.cas.CAS,
- * org.apache.uima.collection.EntityProcessStatus)
- */
- @Override
- public void entityProcessComplete(CAS aCas, EntityProcessStatus aStatus) {
- super.entityProcessComplete(aCas, aStatus);
- // check for a failure in processing...
- if (aStatus.getStatusMessage().equals("failed")) {
- Iterator iter = aStatus.getExceptions().iterator();
- while (iter.hasNext()) {
- // if there is an error ... call the cpm to kill and check for a
- // null CAS
- if (iter.next() instanceof java.lang.Error) {
- this.cpe.kill();
- this.errorThrown = true;
- assertEquals("The cas is not null, as expected.", null, aCas);
- }
- }
- }
- }
-
- public boolean hasError() {
- return this.errorThrown;
- }
- }
+ public boolean hasError() {
+ return this.errorThrown;
+ }
+ }
}
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmInitTest.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmInitTest.java
index 201a2c8..2fad41c 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmInitTest.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmInitTest.java
@@ -34,13 +34,13 @@
public class CpmInitTest {
private static final String separator = System.getProperties().getProperty("file.separator");
- @AfterEach
- public void tearDown() throws Exception {
+ @AfterEach
+ public void tearDown() throws Exception {
FunctionErrorStore.resetCount();
}
- @Test
- public void testInitSingleThreadCPMMode() throws Exception {
+ @Test
+ public void testInitSingleThreadCPMMode() throws Exception {
int documentCount = 10000000;
int threadCount = 1;
@@ -72,8 +72,8 @@
}
}
- @Test
- public void testInitMultiThreadCPMMode() throws Exception {
+ @Test
+ public void testInitMultiThreadCPMMode() throws Exception {
int documentCount = 10000000; // hopefully enough that we won't finish before we abort
int threadCount = 1;
@@ -104,8 +104,8 @@
}
}
- @Test
- public void testInitMultiThreadCPM() throws Exception {
+ @Test
+ public void testInitMultiThreadCPM() throws Exception {
int documentCount = 10000000;
int threadCount = 3;
@@ -122,8 +122,8 @@
while (!listener.isInitialized()) {
Thread.sleep(10);
}
- System.out.println("testInitMultiThreadCPM()-Initialize was called: "
- + listener.isInitialized());
+ System.out
+ .println("testInitMultiThreadCPM()-Initialize was called: " + listener.isInitialized());
// Let the CPM process some docs, before calling stop
Thread.sleep(300);
@@ -152,11 +152,12 @@
CollectionProcessingEngine cpe = null;
try {
- String colReaderBase = JUnitExtension.getFile("CpmTests" + separator
- + "ErrorTestCollectionReader.xml").getAbsolutePath();
- String taeBase = JUnitExtension.getFile("CpmTests" + separator + "ErrorTestAnnotator.xml").getAbsolutePath();
- String casConsumerBase = JUnitExtension.getFile("CpmTests" + separator
- + "ErrorTestCasConsumer.xml").getAbsolutePath();
+ String colReaderBase = JUnitExtension
+ .getFile("CpmTests" + separator + "ErrorTestCollectionReader.xml").getAbsolutePath();
+ String taeBase = JUnitExtension.getFile("CpmTests" + separator + "ErrorTestAnnotator.xml")
+ .getAbsolutePath();
+ String casConsumerBase = JUnitExtension
+ .getFile("CpmTests" + separator + "ErrorTestCasConsumer.xml").getAbsolutePath();
// created needed descriptors
String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, documentCount);
@@ -183,8 +184,8 @@
if (useSlowAnnotator) {
CpeIntegratedCasProcessor slowProcessor = CpeDescriptorFactory
.produceCasProcessor("SlowAnnotator");
- slowProcessor.setDescriptor(JUnitExtension.getFile("CpmTests" + separator
- + "SlowAnnotator.xml").getAbsolutePath());
+ slowProcessor.setDescriptor(JUnitExtension
+ .getFile("CpmTests" + separator + "SlowAnnotator.xml").getAbsolutePath());
cpeDesc.addCasProcessor(slowProcessor);
}
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmProcessingTest.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmProcessingTest.java
index d02771a..0db825a 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmProcessingTest.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmProcessingTest.java
@@ -45,25 +45,26 @@
/**
* @see junit.framework.TestCase#setUp()
*/
- @BeforeEach
- public void setUp() throws Exception {
+ @BeforeEach
+ public void setUp() throws Exception {
// disable schema validation -- this test uses descriptors
// that don't validate, for some reason
UIMAFramework.getXMLParser().enableSchemaValidation(false);
}
- @AfterEach
- public void tearDown() throws Exception {
+ @AfterEach
+ public void tearDown() throws Exception {
FunctionErrorStore.resetCount();
}
/**
* Create a single processor which have to work on only on document
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testCasConsumerProcessingSingleThreadSingleDocument() throws Exception {
+ @Test
+ public void testCasConsumerProcessingSingleThreadSingleDocument() throws Exception {
// process only a single document and a single thread
int documentCount = 1;
int threadCount = 1;
@@ -84,24 +85,25 @@
}
// check if CasConsumer was called
- Assert.assertEquals("StatusCallbackListener", documentCount, listener
- .getEntityProcessCompleteCount());
- Assert.assertEquals("CasConsumer process Count", documentCount, FunctionErrorStore
- .getCasConsumerProcessCount());
- Assert.assertEquals("Annotator process count", documentCount, FunctionErrorStore
- .getAnnotatorProcessCount());
- Assert.assertEquals("Collection reader getNext count", documentCount, FunctionErrorStore
- .getCollectionReaderGetNextCount());
+ Assert.assertEquals("StatusCallbackListener", documentCount,
+ listener.getEntityProcessCompleteCount());
+ Assert.assertEquals("CasConsumer process Count", documentCount,
+ FunctionErrorStore.getCasConsumerProcessCount());
+ Assert.assertEquals("Annotator process count", documentCount,
+ FunctionErrorStore.getAnnotatorProcessCount());
+ Assert.assertEquals("Collection reader getNext count", documentCount,
+ FunctionErrorStore.getCollectionReaderGetNextCount());
Assert.assertEquals("number of annoators", threadCount, FunctionErrorStore.getAnnotatorCount());
}
/**
* Create a single processor which have to process multiple documents
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testCasConsumerProcessingSingleThreadMultipleDocuments() throws Exception {
+ @Test
+ public void testCasConsumerProcessingSingleThreadMultipleDocuments() throws Exception {
// process 100 documents and a single thread
int documentCount = 100;
int threadCount = 1;
@@ -122,24 +124,25 @@
}
// check if CasConsumer was called
- Assert.assertEquals("StatusCallbackListener", documentCount, listener
- .getEntityProcessCompleteCount());
- Assert.assertEquals("CasConsumer process Count", documentCount, FunctionErrorStore
- .getCasConsumerProcessCount());
- Assert.assertEquals("Annotator process count", documentCount, FunctionErrorStore
- .getAnnotatorProcessCount());
- Assert.assertEquals("Collection reader getNext count", documentCount, FunctionErrorStore
- .getCollectionReaderGetNextCount());
+ Assert.assertEquals("StatusCallbackListener", documentCount,
+ listener.getEntityProcessCompleteCount());
+ Assert.assertEquals("CasConsumer process Count", documentCount,
+ FunctionErrorStore.getCasConsumerProcessCount());
+ Assert.assertEquals("Annotator process count", documentCount,
+ FunctionErrorStore.getAnnotatorProcessCount());
+ Assert.assertEquals("Collection reader getNext count", documentCount,
+ FunctionErrorStore.getCollectionReaderGetNextCount());
Assert.assertEquals("number of annoators", threadCount, FunctionErrorStore.getAnnotatorCount());
}
/**
* Create multiple processors which have to process only one single document!
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testCasConsumerProcessingMultipleThreadsSingleDocument() throws Exception {
+ @Test
+ public void testCasConsumerProcessingMultipleThreadsSingleDocument() throws Exception {
// process only a single document and multiple threads
int documentCount = 1;
int threadCount = 5;
@@ -160,24 +163,25 @@
}
// check if CasConsumer was called
- Assert.assertEquals("StatusCallbackListener", documentCount, listener
- .getEntityProcessCompleteCount());
- Assert.assertEquals("CasConsumer process Count", documentCount, FunctionErrorStore
- .getCasConsumerProcessCount());
- Assert.assertEquals("Annotator process count", documentCount, FunctionErrorStore
- .getAnnotatorProcessCount());
- Assert.assertEquals("Collection reader getNext count", documentCount, FunctionErrorStore
- .getCollectionReaderGetNextCount());
+ Assert.assertEquals("StatusCallbackListener", documentCount,
+ listener.getEntityProcessCompleteCount());
+ Assert.assertEquals("CasConsumer process Count", documentCount,
+ FunctionErrorStore.getCasConsumerProcessCount());
+ Assert.assertEquals("Annotator process count", documentCount,
+ FunctionErrorStore.getAnnotatorProcessCount());
+ Assert.assertEquals("Collection reader getNext count", documentCount,
+ FunctionErrorStore.getCollectionReaderGetNextCount());
Assert.assertEquals("number of annoators", threadCount, FunctionErrorStore.getAnnotatorCount());
}
/**
* Create multiple processors which have to process multiple documents
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testCasConsumerProcessingMultipleThreadsMultipleDocuments() throws Exception {
+ @Test
+ public void testCasConsumerProcessingMultipleThreadsMultipleDocuments() throws Exception {
// process 100 documents and multiple threads
int documentCount = 100;
int threadCount = 5;
@@ -198,14 +202,14 @@
}
// check if CasConsumer was called
- Assert.assertEquals("StatusCallbackListener", documentCount, listener
- .getEntityProcessCompleteCount());
- Assert.assertEquals("CasConsumer process Count", documentCount, FunctionErrorStore
- .getCasConsumerProcessCount());
- Assert.assertEquals("Annotator process count", documentCount, FunctionErrorStore
- .getAnnotatorProcessCount());
- Assert.assertEquals("Collection reader getNext count", documentCount, FunctionErrorStore
- .getCollectionReaderGetNextCount());
+ Assert.assertEquals("StatusCallbackListener", documentCount,
+ listener.getEntityProcessCompleteCount());
+ Assert.assertEquals("CasConsumer process Count", documentCount,
+ FunctionErrorStore.getCasConsumerProcessCount());
+ Assert.assertEquals("Annotator process count", documentCount,
+ FunctionErrorStore.getAnnotatorProcessCount());
+ Assert.assertEquals("Collection reader getNext count", documentCount,
+ FunctionErrorStore.getCollectionReaderGetNextCount());
Assert.assertEquals("number of annoators", threadCount, FunctionErrorStore.getAnnotatorCount());
}
@@ -224,11 +228,12 @@
CollectionProcessingEngine cpe = null;
try {
- String colReaderBase = JUnitExtension.getFile("CpmTests" + separator
- + "ErrorTestCollectionReader.xml").getAbsolutePath();
- String taeBase = JUnitExtension.getFile("CpmTests" + separator + "ErrorTestAnnotator.xml").getAbsolutePath();
- String casConsumerBase = JUnitExtension.getFile("CpmTests" + separator
- + "ErrorTestCasConsumer.xml").getAbsolutePath();
+ String colReaderBase = JUnitExtension
+ .getFile("CpmTests" + separator + "ErrorTestCollectionReader.xml").getAbsolutePath();
+ String taeBase = JUnitExtension.getFile("CpmTests" + separator + "ErrorTestAnnotator.xml")
+ .getAbsolutePath();
+ String casConsumerBase = JUnitExtension
+ .getFile("CpmTests" + separator + "ErrorTestCasConsumer.xml").getAbsolutePath();
// created needed descriptors
String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, documentCount);
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmStopTest.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmStopTest.java
index fcd28f6..668ab1d 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmStopTest.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmStopTest.java
@@ -34,13 +34,13 @@
public class CpmStopTest {
private static final String separator = System.getProperties().getProperty("file.separator");
- @AfterEach
- public void tearDown() throws Exception {
+ @AfterEach
+ public void tearDown() throws Exception {
FunctionErrorStore.resetCount();
}
- @Test
- public void testCpmStopSingleThread() throws Exception {
+ @Test
+ public void testCpmStopSingleThread() throws Exception {
int documentCount = 100000; // hopefully enough that we won't finish before we abort
int threadCount = 1;
@@ -66,8 +66,8 @@
}
}
- @Test
- public void testCpmStopMultipleThreads() throws Exception {
+ @Test
+ public void testCpmStopMultipleThreads() throws Exception {
int documentCount = 100000; // hopefully enough that we won't finish before we abort
int threadCount = 5;
@@ -93,8 +93,8 @@
}
}
- @Test
- public void testCpmStopSlowAnnotator() throws Exception {
+ @Test
+ public void testCpmStopSlowAnnotator() throws Exception {
int documentCount = 1000; // hopefully enough that we won't finish before we abort
int threadCount = 1;
@@ -120,8 +120,8 @@
}
}
- @Test
- public void testCpmStopImmediate() throws Exception {
+ @Test
+ public void testCpmStopImmediate() throws Exception {
int documentCount = 100000; // hopefully enough that we won't finish before we abort
int threadCount = 1;
@@ -159,11 +159,12 @@
CpeDescription cpeDesc = null;
CollectionProcessingEngine cpe = null;
- String colReaderBase = JUnitExtension.getFile("CpmTests" + separator
- + "ErrorTestCollectionReader.xml").getAbsolutePath();
- String taeBase = JUnitExtension.getFile("CpmTests" + separator + "ErrorTestAnnotator.xml").getAbsolutePath();
- String casConsumerBase = JUnitExtension.getFile("CpmTests" + separator
- + "ErrorTestCasConsumer.xml").getAbsolutePath();
+ String colReaderBase = JUnitExtension
+ .getFile("CpmTests" + separator + "ErrorTestCollectionReader.xml").getAbsolutePath();
+ String taeBase = JUnitExtension.getFile("CpmTests" + separator + "ErrorTestAnnotator.xml")
+ .getAbsolutePath();
+ String casConsumerBase = JUnitExtension
+ .getFile("CpmTests" + separator + "ErrorTestCasConsumer.xml").getAbsolutePath();
// created needed descriptors
String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, documentCount);
@@ -186,7 +187,8 @@
if (useSlowAnnotator) {
CpeIntegratedCasProcessor slowProcessor = CpeDescriptorFactory
.produceCasProcessor("SlowAnnotator");
- slowProcessor.setDescriptor(JUnitExtension.getFile("CpmTests" + separator + "SlowAnnotator.xml").getAbsolutePath());
+ slowProcessor.setDescriptor(JUnitExtension
+ .getFile("CpmTests" + separator + "SlowAnnotator.xml").getAbsolutePath());
cpeDesc.addCasProcessor(slowProcessor);
}
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/PearCasPoolTest.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/PearCasPoolTest.java
index 86f6c14..27ce052 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/PearCasPoolTest.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/PearCasPoolTest.java
@@ -47,60 +47,57 @@
/**
* This test insures that Pear compoents run in a cas pool switch classloaders properly
*
- * It installs a pear every time it runs, to insure the test works on Linux and Windows
- * Note: install handles converting classpath separator characters, etc.
+ * It installs a pear every time it runs, to insure the test works on Linux and Windows Note:
+ * install handles converting classpath separator characters, etc.
*
*/
public class PearCasPoolTest {
private static final String separator = System.getProperties().getProperty("file.separator");
-
+
// Temporary working directory, used to install the pear package
private File pearInstallDir = null;
private final String PEAR_INSTALL_DIR = "target/pearInCPM_install_dir";
private PackageBrowser installedPear;
-
- @BeforeEach
- public void setUp() throws Exception {
+ @BeforeEach
+ public void setUp() throws Exception {
// disable schema validation -- this test uses descriptors
// that don't validate, for some reason
UIMAFramework.getXMLParser().enableSchemaValidation(false);
-
+
// create pear install directory in the target
pearInstallDir = new File(PEAR_INSTALL_DIR);
pearInstallDir.mkdirs();
}
- @AfterEach
- public void tearDown() throws Exception {
+ @AfterEach
+ public void tearDown() throws Exception {
FunctionErrorStore.resetCount();
}
-
/**
* Create multiple processors which have to process multiple documents
*
- * @throws Exception -
+ * @throws Exception
+ * -
*/
- @Test
- public void testCasPool() throws Exception {
+ @Test
+ public void testCasPool() throws Exception {
ResourceManager rm = UIMAFramework.newDefaultResourceManager();
-
+
// check temporary working directory
if (this.pearInstallDir == null)
throw new FileNotFoundException("PEAR install directory not found");
-
- // get pear files to install
+
+ // get pear files to install
// relative resolved using class loader
File pearFile = JUnitExtension.getFile("pearTests/pearForCPMtest.pear");
Assert.assertNotNull(pearFile);
-
+
// Install PEAR packages
installedPear = PackageInstaller.installPackage(this.pearInstallDir, pearFile, false);
Assert.assertNotNull(installedPear);
-
-
core(10, 2, 3, null);
core(10, 2, 2, null);
core(10, 3, 3, null);
@@ -115,17 +112,19 @@
core(10, 3, 5, rm);
core(10, 4, 4, rm);
core(10, 4, 5, rm);
- System.out.println(""); //final new line
+ System.out.println(""); // final new line
}
- private void core(int documentCount, int threadCount, int poolSize,
- ResourceManager resourceManager) throws Exception {
- // setup CPM to process documents
- CollectionProcessingEngine cpe = setupCpm(documentCount, threadCount, poolSize, resourceManager);
+ private void core(int documentCount, int threadCount, int poolSize,
+ ResourceManager resourceManager) throws Exception {
+ // setup CPM to process documents
+ CollectionProcessingEngine cpe = setupCpm(documentCount, threadCount, poolSize,
+ resourceManager);
// create and register a status callback listener
TestStatusCallbackListener listener = new TestStatusCallbackListener() {
TypeSystem sts = null;
+
@Override
public void entityProcessComplete(CAS aCas, EntityProcessStatus aStatus) {
super.entityProcessComplete(aCas, aStatus);
@@ -134,7 +133,7 @@
} else {
Assert.assertTrue(sts == aCas.getTypeSystem());
}
- }
+ }
};
cpe.addStatusCallbackListener(listener);
@@ -146,6 +145,7 @@
Thread.sleep(5);
}
}
+
/**
* setup the CPM with base functionality.
*
@@ -157,20 +157,22 @@
* @return CollectionProcessingEngine - initialized cpe
*/
private CollectionProcessingEngine setupCpm(int documentCount, int threadCount, int poolSize,
- ResourceManager resourceManager) throws Exception {
+ ResourceManager resourceManager) throws Exception {
CpeDescription cpeDesc = null;
CollectionProcessingEngine cpe = null;
try {
- String colReaderBase = JUnitExtension.getFile("CpmTests" + separator
- + "ErrorTestCollectionReader.xml").getAbsolutePath();
- String taeBase = JUnitExtension.getFile("CpmTests" + separator + "aggrContainingPearSpecifier.xml").getAbsolutePath();
- String casConsumerBase = JUnitExtension.getFile("CpmTests" + separator
- + "ErrorTestCasConsumer.xml").getAbsolutePath();
+ String colReaderBase = JUnitExtension
+ .getFile("CpmTests" + separator + "ErrorTestCollectionReader.xml").getAbsolutePath();
+ String taeBase = JUnitExtension
+ .getFile("CpmTests" + separator + "aggrContainingPearSpecifier.xml")
+ .getAbsolutePath();
+ String casConsumerBase = JUnitExtension
+ .getFile("CpmTests" + separator + "ErrorTestCasConsumer.xml").getAbsolutePath();
// created needed descriptors
String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, documentCount);
-// String taeDesc = DescriptorMakeUtil.makeAnalysisEngine(taeBase);
+ // String taeDesc = DescriptorMakeUtil.makeAnalysisEngine(taeBase);
String taeDesc = taeBase;
String casConsumerDesc = DescriptorMakeUtil.makeCasConsumer(casConsumerBase);
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/SofaCPE_SofaUnawareCC_Test.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/SofaCPE_SofaUnawareCC_Test.java
index 1d910c5..1236e63 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/SofaCPE_SofaUnawareCC_Test.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/SofaCPE_SofaUnawareCC_Test.java
@@ -53,12 +53,13 @@
Throwable firstFailure;
- @BeforeEach
- public void setUp() throws Exception {
+ @BeforeEach
+ public void setUp() throws Exception {
UIMAFramework.getXMLParser().enableSchemaValidation(true);
cpeSpecifierFile = JUnitExtension.getFile("CpeSofaTest/SofaCPE_SofaUnawareCC.xml");
// Use the specifier file to determine where the specifiers live.
- System.setProperty("CPM_HOME", cpeSpecifierFile.getParentFile().getParentFile().getAbsolutePath());
+ System.setProperty("CPM_HOME",
+ cpeSpecifierFile.getParentFile().getParentFile().getAbsolutePath());
cpeDesc = UIMAFramework.getXMLParser()
.parseCpeDescription(new XMLInputSource(cpeSpecifierFile));
// instantiate a cpe
@@ -69,17 +70,17 @@
firstFailure = null;
}
- @AfterEach
- public void tearDown() throws Exception {
+ @AfterEach
+ public void tearDown() throws Exception {
cpeDesc = null;
cpe = null;
cpeSpecifierFile = null;
-// System.gc();
-// System.gc();
+ // System.gc();
+ // System.gc();
}
- @Test
- public void testProcess() throws Throwable {
+ @Test
+ public void testProcess() throws Throwable {
// System.out.println("method testProcess");
try {
cpe.process();
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/SofaCPE_Test.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/SofaCPE_Test.java
index 9892cde..09086c2 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/SofaCPE_Test.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/SofaCPE_Test.java
@@ -53,12 +53,13 @@
Throwable firstFailure;
- @BeforeEach
- public void setUp() throws Exception {
+ @BeforeEach
+ public void setUp() throws Exception {
UIMAFramework.getXMLParser().enableSchemaValidation(true);
cpeSpecifierFile = JUnitExtension.getFile("CpeSofaTest/SofaCPE.xml");
// Use the specifier file to determine where the specifiers live.
- System.setProperty("CPM_HOME", cpeSpecifierFile.getParentFile().getParentFile().getAbsolutePath());
+ System.setProperty("CPM_HOME",
+ cpeSpecifierFile.getParentFile().getParentFile().getAbsolutePath());
cpeDesc = UIMAFramework.getXMLParser()
.parseCpeDescription(new XMLInputSource(cpeSpecifierFile));
// instantiate a cpe
@@ -69,17 +70,17 @@
firstFailure = null;
}
- @AfterEach
- public void tearDown() throws Exception {
+ @AfterEach
+ public void tearDown() throws Exception {
cpeDesc = null;
cpe = null;
cpeSpecifierFile = null;
-// System.gc();
-// System.gc();
+ // System.gc();
+ // System.gc();
}
- @Test
- public void testProcess() throws Throwable {
+ @Test
+ public void testProcess() throws Throwable {
// System.out.println("method testProcess");
try {
cpe.process();
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/SofaMixedCPE_Test.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/SofaMixedCPE_Test.java
index e73f688..223aef5 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/SofaMixedCPE_Test.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/SofaMixedCPE_Test.java
@@ -51,12 +51,13 @@
Throwable firstFailure;
- @BeforeEach
- public void setUp() throws Exception {
+ @BeforeEach
+ public void setUp() throws Exception {
UIMAFramework.getXMLParser().enableSchemaValidation(true);
cpeSpecifierFile = JUnitExtension.getFile("CpeSofaTest/SofaMixedCPE.xml");
// Use the specifier file to determine where the specifiers live.
- System.setProperty("CPM_HOME", cpeSpecifierFile.getParentFile().getParentFile().getAbsolutePath());
+ System.setProperty("CPM_HOME",
+ cpeSpecifierFile.getParentFile().getParentFile().getAbsolutePath());
cpeDesc = UIMAFramework.getXMLParser()
.parseCpeDescription(new XMLInputSource(cpeSpecifierFile));
// instantiate a cpe
@@ -67,8 +68,8 @@
firstFailure = null;
}
- @AfterEach
- public void tearDown() throws Exception {
+ @AfterEach
+ public void tearDown() throws Exception {
cpeDesc = null;
cpe = null;
cpeSpecifierFile = null;
@@ -76,11 +77,11 @@
System.gc();
}
- @Test
- public void testProcess() throws Throwable {
+ @Test
+ public void testProcess() throws Throwable {
try {
cpe.process();
- while ( cpe.isProcessing() ) {
+ while (cpe.isProcessing()) {
// wait till cpe finishes
synchronized (statCbL1) {
statCbL1.wait(100);
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/DescriptorMakeUtil.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/DescriptorMakeUtil.java
index f8df10c..5c328ab 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/DescriptorMakeUtil.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/DescriptorMakeUtil.java
@@ -31,7 +31,6 @@
import org.apache.uima.test.junit_extension.JUnitExtension;
import org.apache.uima.util.XMLInputSource;
-
public class DescriptorMakeUtil {
private static final String FS = System.getProperties().getProperty("file.separator");
@@ -81,12 +80,12 @@
CasConsumerDescription ccd = UIMAFramework.getXMLParser().parseCasConsumerDescription(in);
// set the function to crash, if desired
if (shouldCrash) {
- ccd.getCasConsumerMetaData().getConfigurationParameterSettings().setParameterValue(
- "ErrorFunction", functionName);
- ccd.getCasConsumerMetaData().getConfigurationParameterSettings().setParameterValue(
- "ErrorCount", errorCount);
- ccd.getCasConsumerMetaData().getConfigurationParameterSettings().setParameterValue(
- "ErrorException", exceptionName);
+ ccd.getCasConsumerMetaData().getConfigurationParameterSettings()
+ .setParameterValue("ErrorFunction", functionName);
+ ccd.getCasConsumerMetaData().getConfigurationParameterSettings()
+ .setParameterValue("ErrorCount", errorCount);
+ ccd.getCasConsumerMetaData().getConfigurationParameterSettings()
+ .setParameterValue("ErrorException", exceptionName);
}
File baseDir = JUnitExtension.getFile("CpmTests" + FS + "CpeDesc");
@@ -115,16 +114,16 @@
XMLInputSource in = new XMLInputSource(descFileName);
CollectionReaderDescription crd = UIMAFramework.getXMLParser()
.parseCollectionReaderDescription(in);
- crd.getCollectionReaderMetaData().getConfigurationParameterSettings().setParameterValue(
- "DocumentCount", documentCount);
+ crd.getCollectionReaderMetaData().getConfigurationParameterSettings()
+ .setParameterValue("DocumentCount", documentCount);
// set the function to crash, if desired
if (shouldCrash) {
- crd.getCollectionReaderMetaData().getConfigurationParameterSettings().setParameterValue(
- "ErrorFunction", functionName);
- crd.getCollectionReaderMetaData().getConfigurationParameterSettings().setParameterValue(
- "ErrorCount", errorCount);
- crd.getCollectionReaderMetaData().getConfigurationParameterSettings().setParameterValue(
- "ErrorException", exceptionName);
+ crd.getCollectionReaderMetaData().getConfigurationParameterSettings()
+ .setParameterValue("ErrorFunction", functionName);
+ crd.getCollectionReaderMetaData().getConfigurationParameterSettings()
+ .setParameterValue("ErrorCount", errorCount);
+ crd.getCollectionReaderMetaData().getConfigurationParameterSettings()
+ .setParameterValue("ErrorException", exceptionName);
}
File baseDir = JUnitExtension.getFile("CpmTests" + FS + "CpeDesc");
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/ErrorTestAnnotator.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/ErrorTestAnnotator.java
index ef08c70..3fb0c61 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/ErrorTestAnnotator.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/ErrorTestAnnotator.java
@@ -32,7 +32,6 @@
import org.apache.uima.util.Level;
import org.apache.uima.util.Logger;
-
public class ErrorTestAnnotator extends JTextAnnotator_ImplBase {
// Parameter fields in the xml
@@ -65,11 +64,13 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.analysis_engine.annotator.JTextAnnotator#process(org.apache.uima.jcas.impl.JCas,
- * org.apache.uima.analysis_engine.ResultSpecification)
+ * @see
+ * org.apache.uima.analysis_engine.annotator.JTextAnnotator#process(org.apache.uima.jcas.impl.
+ * JCas, org.apache.uima.analysis_engine.ResultSpecification)
*/
@Override
- public void process(JCas aJCas, ResultSpecification aResultSpec) throws AnnotatorProcessException {
+ public void process(JCas aJCas, ResultSpecification aResultSpec)
+ throws AnnotatorProcessException {
// count the calls...
FunctionErrorStore.increaseAnnotatorProcessCount();
logger.log(LOG_LEVEL, "process was called");
@@ -81,11 +82,12 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.analysis_engine.annotator.BaseAnnotator#initialize(org.apache.uima.analysis_engine.annotator.AnnotatorContext)
+ * @see org.apache.uima.analysis_engine.annotator.BaseAnnotator#initialize(org.apache.uima.
+ * analysis_engine.annotator.AnnotatorContext)
*/
@Override
- public void initialize(AnnotatorContext aContext) throws AnnotatorInitializationException,
- AnnotatorConfigurationException {
+ public void initialize(AnnotatorContext aContext)
+ throws AnnotatorInitializationException, AnnotatorConfigurationException {
super.initialize(aContext);
try {
// set logger
@@ -127,8 +129,8 @@
* @see org.apache.uima.analysis_engine.annotator.BaseAnnotator#reconfigure()
*/
@Override
- public void reconfigure() throws AnnotatorConfigurationException,
- AnnotatorInitializationException {
+ public void reconfigure()
+ throws AnnotatorConfigurationException, AnnotatorInitializationException {
super.reconfigure();
logger.log(LOG_LEVEL, "reconfigure was called");
if (errorConfig.containsKey(FUNC_RECONFIGURE_KEY)) {
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/ErrorTestCasConsumer.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/ErrorTestCasConsumer.java
index c899be6..e899c03 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/ErrorTestCasConsumer.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/ErrorTestCasConsumer.java
@@ -28,7 +28,6 @@
import org.apache.uima.util.Level;
import org.apache.uima.util.Logger;
-
public class ErrorTestCasConsumer extends CasConsumer_ImplBase {
// Parameter fields in the xml
@@ -59,7 +58,8 @@
/*
* (non-Javadoc)
*
- * @see org.apache.uima.analysis_engine.annotator.BaseAnnotator#initialize(org.apache.uima.analysis_engine.annotator.AnnotatorContext)
+ * @see org.apache.uima.analysis_engine.annotator.BaseAnnotator#initialize(org.apache.uima.
+ * analysis_engine.annotator.AnnotatorContext)
*/
@Override
public void initialize() throws ResourceInitializationException {
@@ -79,8 +79,8 @@
errorExceptionName = errorException;
}
// add the error object to the corresponding HashMap Entry
- addError(errorFunction, new FunctionErrorStore(errorExceptionName, errorCountName,
- errorFunction));
+ addError(errorFunction,
+ new FunctionErrorStore(errorExceptionName, errorCountName, errorFunction));
}
logger.log(LOG_LEVEL, "initialize() was called");
if (errorConfig.containsKey(FUNC_INITIALIZE_KEY)) {
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/ErrorTestCollectionReader.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/ErrorTestCollectionReader.java
index e27e6fc..0617f7d 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/ErrorTestCollectionReader.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/ErrorTestCollectionReader.java
@@ -115,8 +115,8 @@
}
System.out.println("adding error!");
// add the error object to the corresponding HashMap Entry
- addError(errorFunction, new FunctionErrorStore(errorExceptionName, errorCountName,
- errorFunction));
+ addError(errorFunction,
+ new FunctionErrorStore(errorExceptionName, errorCountName, errorFunction));
}
logger.log(LOG_LEVEL, "initialize() was called");
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/FunctionErrorStore.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/FunctionErrorStore.java
index 7eaef39..3612c2f 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/FunctionErrorStore.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/FunctionErrorStore.java
@@ -31,7 +31,6 @@
import org.apache.uima.util.Level;
import org.apache.uima.util.Logger;
-
public class FunctionErrorStore {
private static final String LS = System.getProperties().getProperty("line.separator");
@@ -87,8 +86,8 @@
}
// exceptions from JTextAnnotator_ImplBase.initialize and JTextAnnotator_ImplBase.reconfigure
- public synchronized void methodeCalled2() throws AnnotatorConfigurationException,
- AnnotatorInitializationException {
+ public synchronized void methodeCalled2()
+ throws AnnotatorConfigurationException, AnnotatorInitializationException {
functionCounted++;
if (functionCounted >= functionCounter) {
@@ -329,9 +328,8 @@
StringBuffer sb = new StringBuffer();
sb.append("All counted Exceptions: " + allCountedExceptions + LS);
sb.append("CollectionReader instances: " + collectionReaderCount + LS);
- sb
- .append("CollectionReader 'getNext'-methode call count: "
- + collectionReaderGetNextCount + LS);
+ sb.append(
+ "CollectionReader 'getNext'-methode call count: " + collectionReaderGetNextCount + LS);
sb.append("Annotator instances: " + annotatorCount + LS);
sb.append("Annotator 'process'-methode call count: " + annotatorProcessCount + LS);
sb.append("CasConsumer instances: " + casConsumerCount + LS);
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/SlowAnnotator.java b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/SlowAnnotator.java
index f2a1ed6..863970a 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/SlowAnnotator.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/SlowAnnotator.java
@@ -24,17 +24,18 @@
import org.apache.uima.analysis_engine.annotator.JTextAnnotator_ImplBase;
import org.apache.uima.jcas.JCas;
-
public class SlowAnnotator extends JTextAnnotator_ImplBase {
/*
* (non-Javadoc)
*
- * @see org.apache.uima.analysis_engine.annotator.JTextAnnotator#process(org.apache.uima.jcas.impl.JCas,
- * org.apache.uima.analysis_engine.ResultSpecification)
+ * @see
+ * org.apache.uima.analysis_engine.annotator.JTextAnnotator#process(org.apache.uima.jcas.impl.
+ * JCas, org.apache.uima.analysis_engine.ResultSpecification)
*/
@Override
- public void process(JCas aJCas, ResultSpecification aResultSpec) throws AnnotatorProcessException {
+ public void process(JCas aJCas, ResultSpecification aResultSpec)
+ throws AnnotatorProcessException {
// waste some time
fibonacci(35);
}
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/examples/cpm/sofa/CpmTestDriver.java b/uimaj-cpe/src/test/java/org/apache/uima/examples/cpm/sofa/CpmTestDriver.java
index 48f523a..fdad5b1 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/examples/cpm/sofa/CpmTestDriver.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/examples/cpm/sofa/CpmTestDriver.java
@@ -42,8 +42,8 @@
public static void main(String[] args) {
try {
// read in the cpe descriptor
- CpeDescription cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(
- new XMLInputSource("CpeSofaTest/SofaCPE.xml"));
+ CpeDescription cpeDesc = UIMAFramework.getXMLParser()
+ .parseCpeDescription(new XMLInputSource("CpeSofaTest/SofaCPE.xml"));
// instantiate a cpe
CollectionProcessingEngine cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc,
null);
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/examples/cpm/sofa/SofaCollectionReader.java b/uimaj-cpe/src/test/java/org/apache/uima/examples/cpm/sofa/SofaCollectionReader.java
index d526652..1db799c 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/examples/cpm/sofa/SofaCollectionReader.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/examples/cpm/sofa/SofaCollectionReader.java
@@ -36,7 +36,7 @@
*/
/**
- * Creates a Text SofA in the cas.
+ * Creates a Text SofA in the cas.
*/
public class SofaCollectionReader extends CollectionReader_ImplBase {
boolean hasMore = true;
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/pear/util/ComponentCategoryTest.java b/uimaj-cpe/src/test/java/org/apache/uima/pear/util/ComponentCategoryTest.java
index 08d23c3..81397ec 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/pear/util/ComponentCategoryTest.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/pear/util/ComponentCategoryTest.java
@@ -42,12 +42,12 @@
/**
* Runs test case for CPE descriptor.
*/
- @Test
- public void testCpeDescriptor() throws Exception {
+ @Test
+ public void testCpeDescriptor() throws Exception {
File cpeDescFile = JUnitExtension.getFile(TEST_FOLDER + "/" + CPE_DESC_NAME);
if (!cpeDescFile.isFile())
throw new FileNotFoundException("CPE descriptor not found");
- Assert.assertTrue(UIMAUtil.CPE_CONFIGURATION_CTG.equals(UIMAUtil
- .identifyUimaComponentCategory(cpeDescFile)));
+ Assert.assertTrue(UIMAUtil.CPE_CONFIGURATION_CTG
+ .equals(UIMAUtil.identifyUimaComponentCategory(cpeDescFile)));
}
}
diff --git a/uimaj-cpe/src/test/java/org/apache/uima/resource/impl/TestResourceInterface_impl.java b/uimaj-cpe/src/test/java/org/apache/uima/resource/impl/TestResourceInterface_impl.java
index b4bf47c..eea3a69 100644
--- a/uimaj-cpe/src/test/java/org/apache/uima/resource/impl/TestResourceInterface_impl.java
+++ b/uimaj-cpe/src/test/java/org/apache/uima/resource/impl/TestResourceInterface_impl.java
@@ -34,9 +34,8 @@
import org.apache.uima.resource.metadata.NameValuePair;
import org.apache.uima.resource.metadata.ResourceMetaData;
-
-public class TestResourceInterface_impl extends Resource_ImplBase implements SharedResourceObject,
- TestResourceInterface {
+public class TestResourceInterface_impl extends Resource_ImplBase
+ implements SharedResourceObject, TestResourceInterface {
private String mString;
/**
@@ -54,15 +53,15 @@
} catch (IOException e) {
throw new ResourceInitializationException(e);
} finally {
- if ( inStr != null ) {
+ if (inStr != null) {
try {
inStr.close();
- } catch( Exception e) {
+ } catch (Exception e) {
System.out.println("CPE.load() - Unable to close Input Stream");
}
}
}
-
+
}
/**