You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2008/01/08 15:38:51 UTC
svn commit: r610003 [1/7] - in
/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src: ./ main/
main/java/ main/java/org/ main/java/org/apache/ main/java/org/apache/uima/
main/java/org/apache/uima/aae/ main/java/org/apache/uima/aae/client/
main/java/o...
Author: schor
Date: Tue Jan 8 06:38:38 2008
New Revision: 610003
URL: http://svn.apache.org/viewvc?rev=610003&view=rev
Log:
[UIMA-689] initial import under software grant to ASF.
Added:
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/AsynchAECasManager.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/AsynchAECasManager_impl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/Channel.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/EECasManager_impl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InProcessCache.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InProcessCacheMBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InputChannel.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/MessageMap.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/OutputChannel.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/ParallelStep.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UIDGenerator.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UIMAEE_Constants.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaClassFactory.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaEEAdminContext.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaEEShutdownHook.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaSerializer.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UniqueIdGenerator.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/client/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/client/UimaAsynchronousEngine.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/client/UimaEEProcessStatusImpl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/client/UimaEEStatusCallbackListener.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_implMBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/AnalysisEngineController.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/AnalysisEngineInstancePool.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/AnalysisEngineInstancePoolWithThreadAffinity.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineControllerMBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/ControllerCallbackListener.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/ControllerLatch.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/ControllerLifecycle.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/CpCListener.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/DelegateManager.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/Endpoint.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/Endpoint_impl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/EventSubscriber.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/FlowControllerImpl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_implMBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceController.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceManagement.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceManagementMBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/deploymentDescriptor/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/deploymentDescriptor/XsltGUIDgenerator.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/deploymentDescriptor/XsltImportByName.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/AsynchAEException.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/EndpointThresholds.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ErrorContext.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ErrorHandler.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ErrorHandlerBase.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ErrorHandlerChain.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ErrorHandlerListener.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ErrorHandlerListenerBase.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ErrorResult.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ErrorResultBaseImpl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ErrorResultComponentPath.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ErrorResultComponentPathImpl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ErrorResultTDs.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ErrorResultTDsImpl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ExpiredMessageException.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/InvalidMessageException.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/MessageTimeoutException.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/ServiceShutdownException.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/Threshold.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/UimaEECollectionProcessCompleteTimeout.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/UimaEEMetaRequestTimeout.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/UimaEEProcessCasTimeout.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/UimaEEServiceException.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/UimaEETimeoutException.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/UnknownDestinationException.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/handler/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/handler/AnalysisEngineProcessExceptionHandler.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/handler/AsynchAEExceptionHandler.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/handler/CpcErrorHandler.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/handler/DefaultDelegateErrorHandler.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/handler/DefaultExpiredMessageHandler.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/handler/DefaultHandler.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/handler/DefaultTimeoutHandler.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/handler/GetMetaErrorHandler.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/handler/ProcessCasErrorHandler.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/error/handler/UnknownDestinationHandler.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/handler/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/handler/Handler.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/handler/HandlerBase.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/handler/input/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/handler/input/MetadataRequestHandler_impl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/handler/input/MetadataResponseHandler_impl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/AggregateServiceInfo.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/AggregateServiceInfoMBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/JmxManagement.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/JmxManager.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/ManagedObjectBase.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/PrimitiveServiceInfo.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/PrimitiveServiceInfoMBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/ServiceErrors.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/ServiceErrorsMBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/ServiceInfo.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/ServiceInfoMBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/ServicePerformance.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/jmx/ServicePerformanceMBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/message/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/message/AsynchAEMessage.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/message/MessageContext.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/message/UIMAMessage.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/message/UimaEEShutdownTriggerEvent.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/BaseMonitor.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/Monitor.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/MonitorBaseImpl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/BaseStatistic.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/ComponentStatistics.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/ComponentStatisticsMBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/DelegateStats.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/IntNumericStatistic.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/LongNumericStatistic.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/LongNumericStatisticMBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/NumericStatistic.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/NumericStatisticBaseImpl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/NumericStatisticBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/SimpleSwitch.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/SimpleSwitchMBean.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/Statistic.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/StatisticBase.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/Statistics.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/StringStatistic.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/StringStatisticImpl.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/TimerStats.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/monitor/statistics/UIMAStatistic.java
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/resources/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/resources/uimaee_messages.properties
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/test/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/test/java/
incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/test/resources/
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/AsynchAECasManager.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/AsynchAECasManager.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/AsynchAECasManager.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/AsynchAECasManager.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,32 @@
+package org.apache.uima.aae;
+
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.uima.cas.CAS;
+import org.apache.uima.resource.CasManager;
+import org.apache.uima.resource.ResourceInitializationException;
+import org.apache.uima.resource.ResourceManager;
+import org.apache.uima.resource.metadata.ProcessingResourceMetaData;
+
+public interface AsynchAECasManager
+{
+ public void addMetadata(ProcessingResourceMetaData meta);
+ public ProcessingResourceMetaData getMetadata() throws ResourceInitializationException;
+ public Map getMetadataAsMap() throws ResourceInitializationException;
+ public void setMetadata(ProcessingResourceMetaData meta);
+ public void initialize( int aCasPoolSize, String aContext) throws Exception;
+ public void initialize( String aContext) throws Exception;
+ public void initialize(int aCasPoolSize, String aContextName, Properties aPerformanceTuningSettings) throws Exception;
+ public CAS getNewCas();
+ public CAS getNewCas(String aContext);
+ public CasManager getInternalCasManager();
+ public boolean isInitialized();
+ public void setInitialized(boolean initialized);
+ public String getCasManagerContext();
+ public ResourceManager getResourceManager();
+ public void setInitialFsHeapSize( long aSizeInBytes);
+ public long getInitialFsHeapSize();
+
+ static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/AsynchAECasManager_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/AsynchAECasManager_impl.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/AsynchAECasManager_impl.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/AsynchAECasManager_impl.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,192 @@
+package org.apache.uima.aae;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.uima.UIMAFramework;
+import org.apache.uima.analysis_engine.AnalysisEngineDescription;
+import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData;
+import org.apache.uima.cas.CAS;
+import org.apache.uima.resource.CasDefinition;
+import org.apache.uima.resource.CasManager;
+import org.apache.uima.resource.ResourceInitializationException;
+import org.apache.uima.resource.ResourceManager;
+import org.apache.uima.resource.metadata.FsIndexCollection;
+import org.apache.uima.resource.metadata.ProcessingResourceMetaData;
+import org.apache.uima.util.Level;
+import org.apache.uima.util.XMLInputSource;
+
+public class AsynchAECasManager_impl
+ implements AsynchAECasManager
+{
+ private static final Class CLASS_NAME = AsynchAECasManager_impl.class;
+ private String contextName;
+
+ private CasManager casManager;
+
+ private int casPoolSize = 1;
+
+ private boolean initialized;
+
+ private Map descriptorMap;
+
+ private Map processingResourceMap = new HashMap();
+
+ private ResourceManager resourceManager;
+
+ private long initialHeapSize = 0;//2000000; // Default
+
+ public AsynchAECasManager_impl(ResourceManager aResourceManager, Map aDescriptorMap)
+ {
+ this( aResourceManager );
+ descriptorMap = aDescriptorMap;
+ }
+ public AsynchAECasManager_impl(ResourceManager aResourceManager)
+ {
+ casManager = new EECasManager_impl(aResourceManager);
+ aResourceManager.setCasManager(casManager);
+ resourceManager = aResourceManager;
+ }
+
+ public ResourceManager getResourceManager()
+ {
+ return resourceManager;
+ }
+ public void initialize(String aContextName) throws Exception
+ {
+
+ initialize(getCasPoolSize(), aContextName);
+ }
+
+ public void initialize(int aCasPoolSize, String aContextName) throws Exception
+ {
+ Properties performanceTuningSettings = new Properties();
+ if ( initialHeapSize > 0 )
+ {
+ performanceTuningSettings.setProperty(UIMAFramework.CAS_INITIAL_HEAP_SIZE,
+ new Integer((int)initialHeapSize).toString() );
+ }
+ initialize( aCasPoolSize, aContextName, performanceTuningSettings);
+ }
+
+ public void initialize(int aCasPoolSize, String aContextName, Properties aPerformanceTuningSettings) throws Exception
+ {
+ UIMAFramework.getLogger(CLASS_NAME).logrb(Level.CONFIG, CLASS_NAME.getName(),
+ "getEndpointConnection", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_primary_cas_pool_init__CONFIG",
+ new Object[] { aCasPoolSize, aContextName });
+ // Create CAS Pool for incoming messages
+ casManager.defineCasPool(aContextName, aCasPoolSize, aPerformanceTuningSettings);
+ contextName = aContextName;
+ setInitialized(true);
+ if ( aPerformanceTuningSettings != null )
+ {
+ System.out.println("CasManager Iniatialized Cas Pool:"+aContextName+". Cas Pool Size:"+aCasPoolSize+
+ " Initial Cas Heap Size:"+aPerformanceTuningSettings.get(UIMAFramework.CAS_INITIAL_HEAP_SIZE)+" cells" );
+ }
+ }
+
+ public int getCasPoolSize()
+ {
+ return casPoolSize;
+ }
+
+ public void setCasPoolSize(int casPoolSize)
+ {
+ this.casPoolSize = casPoolSize;
+ setInitialized(true);
+ }
+
+ public String getCasManagerContext()
+ {
+ return contextName;
+ }
+ public CasManager getInternalCasManager()
+ {
+ return casManager;
+ }
+ public boolean isInitialized()
+ {
+ return initialized;
+ }
+
+ public void setInitialized(boolean initialized)
+ {
+ this.initialized = initialized;
+ }
+
+ public void addMetadata(ProcessingResourceMetaData meta)
+ {
+ casManager.addMetaData(meta);
+ }
+
+ public void setMetadata(ProcessingResourceMetaData meta)
+ {
+ addMetadata(meta);
+ }
+
+ /**
+ * Constructs and returns a <code>ProcessingResourceMetaData</code> object
+ * that contains the type system, indexes, and type priorities definitions
+ * for the CAS.
+ *
+ * @return processing resource metadata object containing the relevant parts
+ * of the CAS definition
+ */
+ public ProcessingResourceMetaData getMetadata() throws ResourceInitializationException
+ {
+ CasDefinition casDefinition = casManager.getCasDefinition();
+ ProcessingResourceMetaData md = UIMAFramework.getResourceSpecifierFactory().createProcessingResourceMetaData();
+ md.setTypeSystem(casDefinition.getTypeSystemDescription());
+ md.setTypePriorities(casDefinition.getTypePriorities());
+ FsIndexCollection indColl = UIMAFramework.getResourceSpecifierFactory().createFsIndexCollection();
+ indColl.setFsIndexes(casDefinition.getFsIndexDescriptions());
+ md.setFsIndexCollection(indColl);
+ return md;
+ }
+ public Map getMetadataAsMap() throws ResourceInitializationException
+ {
+ return processingResourceMap;
+ }
+
+ public void setMetadata( String aDescriptorName ) throws Exception
+ {
+ AnalysisEngineDescription specifier =
+ UIMAFramework.getXMLParser().parseAnalysisEngineDescription(new XMLInputSource(new File(aDescriptorName )));
+
+ AnalysisEngineMetaData meta = specifier.getAnalysisEngineMetaData();
+ addMetadata(meta);
+ }
+ private void addProcessingResourceMetadata(String mapkey, String aDescriptorName ) throws Exception
+ {
+ AnalysisEngineDescription specifier =
+ UIMAFramework.getXMLParser().parseAnalysisEngineDescription(new XMLInputSource(new File(aDescriptorName )));
+
+ AnalysisEngineMetaData meta = specifier.getAnalysisEngineMetaData();
+ addMetadata(meta);
+ processingResourceMap.put(mapkey,meta );
+ }
+ public CAS getNewCas()
+ {
+ return casManager.getCas(contextName);
+ }
+ public CAS getNewCas(String aContext)
+ {
+ return casManager.getCas(aContext);
+ }
+
+ public void setInitialFsHeapSize( long aSizeInBytes)
+ {
+ // Heap size is defined in terms of bytes. Uima core expects number of cells.
+ // Each cell is 4 bytes. Divide heapSize expressed in bytes by 4.
+ initialHeapSize = aSizeInBytes/4;
+ }
+ public long getInitialFsHeapSize()
+ {
+ return initialHeapSize;
+ }
+
+private static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/Channel.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/Channel.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/Channel.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/Channel.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,9 @@
+package org.apache.uima.aae;
+
+public interface Channel
+{
+ public void stop() throws Exception;
+ public String getName();
+
+ static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/EECasManager_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/EECasManager_impl.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/EECasManager_impl.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/EECasManager_impl.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,64 @@
+package org.apache.uima.aae;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.uima.UIMAFramework;
+import org.apache.uima.resource.ResourceInitializationException;
+import org.apache.uima.resource.ResourceManager;
+import org.apache.uima.resource.impl.CasManager_impl;
+
+public class EECasManager_impl extends CasManager_impl
+{
+ Map casPoolMap = new HashMap();
+ protected long initialCasHeapSize = 0;
+
+ public EECasManager_impl(ResourceManager aResourceManager)
+ {
+ super(aResourceManager);
+ }
+ public void setInitialCasHeapSize( long anInitialCasHeapSize )
+ {
+ // Heap size is defined in terms of bytes. Uima core expects number of cells.
+ // Each cell is 4 bytes. Divide heapSize expressed in bytes by 4.
+ initialCasHeapSize = anInitialCasHeapSize/4;
+ }
+ public void defineCasPool(String aRequestorContextName, int aMinimumSize, Properties aPerformanceTuningSettings)
+ throws ResourceInitializationException
+ {
+ if ( aPerformanceTuningSettings == null && initialCasHeapSize > 0 )
+ {
+ Properties performanceTuningSettings = new Properties();
+ performanceTuningSettings.setProperty(UIMAFramework.CAS_INITIAL_HEAP_SIZE,
+ new Integer((int)initialCasHeapSize).toString() );
+ super.defineCasPool(aRequestorContextName, aMinimumSize, performanceTuningSettings);
+ }
+ else
+ {
+ super.defineCasPool(aRequestorContextName, aMinimumSize, aPerformanceTuningSettings);
+ }
+ }
+ public void setPoolSize(String aRequestorContextName, int aSize )
+ {
+ casPoolMap.put(aRequestorContextName, aSize);
+
+ }
+ public int getCasPoolSize(String aRequestorContextName, int aMinimumSize)
+ {
+ int theSize = aMinimumSize;
+ if ( casPoolMap.containsKey(aRequestorContextName) )
+ {
+ theSize += ((Integer)casPoolMap.get(aRequestorContextName)).intValue() - 1;
+ }
+ return theSize;
+ }
+protected void finalize() throws Throwable
+{
+ super.finalize();
+ getCasToCasPoolMap().clear();
+ casPoolMap.clear();
+}
+
+private static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InProcessCache.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InProcessCache.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InProcessCache.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InProcessCache.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,764 @@
+package org.apache.uima.aae;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.uima.UIMAFramework;
+import org.apache.uima.aae.controller.ControllerLifecycle;
+import org.apache.uima.aae.controller.Endpoint;
+import org.apache.uima.aae.controller.EventSubscriber;
+import org.apache.uima.aae.error.AsynchAEException;
+import org.apache.uima.aae.message.MessageContext;
+import org.apache.uima.aae.monitor.statistics.DelegateStats;
+import org.apache.uima.cas.CAS;
+import org.apache.uima.cas.impl.OutOfTypeSystemData;
+import org.apache.uima.cas.impl.XmiSerializationSharedData;
+import org.apache.uima.flow.Step;
+import org.apache.uima.util.Level;
+
+public class InProcessCache implements InProcessCacheMBean
+{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private static final Class CLASS_NAME = InProcessCache.class;
+
+ private transient UIDGenerator idGenerator = new UIDGenerator();
+// private Map cache = new HashMap();
+ private ConcurrentHashMap cache = new ConcurrentHashMap();
+
+ private String name = "InProcessCache";
+ private List callbackListeners = new ArrayList();
+
+ int size = 0;
+
+ public void registerCallbackWhenCacheEmpty(EventSubscriber aController )
+ {
+ if ( !callbackListeners.isEmpty() )
+ {
+ Iterator it = callbackListeners.iterator();
+ while( it.hasNext() )
+ {
+ EventSubscriber es = (EventSubscriber)it.next();
+ if ( es == aController )
+ {
+ return;
+ }
+ }
+ }
+ callbackListeners.add(aController);
+ }
+ public void destroy()
+ {
+ callbackListeners.clear();
+ Set set = cache.entrySet();
+ for( Iterator it = set.iterator(); it.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)it.next();
+ CacheEntry cacheEntry = (CacheEntry)entry.getValue();
+ if ( cacheEntry != null && cacheEntry.getCas() != null )
+ {
+ try
+ {
+ cacheEntry.getCas().release();
+ }
+ catch( Exception e){}
+ }
+ }
+
+ cache.clear();
+ }
+
+ public void releaseCASesProducedFromInputCAS( String anInputCASReferenceId )
+ {
+ if ( anInputCASReferenceId == null )
+ {
+ return;
+ }
+ Iterator it = cache.keySet().iterator();
+ while( it.hasNext())
+ {
+ String key = (String) it.next();
+ CacheEntry entry = (CacheEntry) cache.get(key);
+ if ( entry != null && (anInputCASReferenceId.equals( key ) || anInputCASReferenceId.equals( entry.getInputCasReferenceId())))
+ {
+ if ( entry.getCas() != null )
+ {
+ entry.getCas().release();
+ }
+ remove(key);
+ }
+ }
+
+ }
+ public void releaseAllCASes()
+ {
+ Iterator it = cache.keySet().iterator();
+ while( it.hasNext())
+ {
+ String key = (String) it.next();
+ CacheEntry entry = (CacheEntry) cache.get(key);
+ if ( entry != null && entry.getCas() != null )
+ {
+ entry.getCas().release();
+ }
+ cache.remove(key);
+ }
+
+ }
+ public void setName( String aName )
+ {
+ name = aName;
+ }
+ public String getName()
+ {
+ return name;
+ }
+ public void cancelTimers()
+ {
+ Iterator it = cache.keySet().iterator();
+ String key;
+ while( it.hasNext() )
+ {
+ key = (String)it.next();
+ CacheEntry entry = (CacheEntry)cache.get(key);
+ if ( entry != null )
+ {
+ Map em = entry.getEndpointMap();
+ if ( em != null )
+ {
+ Iterator it2 = em.keySet().iterator();
+ String endpointKey ="";
+
+ while( it2.hasNext())
+ {
+ endpointKey = (String)it2.next();
+ Endpoint end = (Endpoint)em.get(endpointKey);
+ }
+ }
+ }
+ }
+ }
+ public boolean isEmpty()
+ {
+ return (cache.size() == 0);
+ }
+ public void reset()
+ {
+ size = 0;
+ }
+ public int getSize()
+ {
+ return cache.size();
+ }
+
+ public void setSize( int i)
+ {
+ size = i;
+ }
+ public synchronized void dumpContents()
+ {
+ if ( UIMAFramework.getLogger().isLoggable(Level.FINEST) )
+ {
+ int count=0;
+ Iterator it = cache.keySet().iterator();
+
+ StringBuffer sb = new StringBuffer("\n");
+ while( it.hasNext() )
+ {
+ String key = (String) it.next();
+ CacheEntry entry = (CacheEntry)cache.get(key);
+ count++;
+ sb.append(key+"\n");
+ }
+ UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINEST, CLASS_NAME.getName(),
+ "dumpContents", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_show_cache_entry_key__FINEST",
+ new Object[] { count, sb.toString() });
+ sb.setLength(0);
+/*
+ UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINEST, CLASS_NAME.getName(),
+ "dumpContents", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_show_cache_size__FINEST",
+ new Object[] { count });
+*/
+ }
+ }
+ public synchronized void remove(String aCasReferenceId)
+ {
+ if (aCasReferenceId != null && cache.containsKey(aCasReferenceId))
+ {
+
+ UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINE, getClass().getName(), "remove", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_remove_cache_entry_for_cas__FINE", new Object[] { aCasReferenceId });
+ cache.remove(aCasReferenceId);
+ this.notifyAll();
+ }
+ else if ( aCasReferenceId == null )
+ {
+ UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINE, getClass().getName(), "remove", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_cas_is_null_remove_from_cache_failed__FINE");
+ }
+ else
+ {
+ UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINE, getClass().getName(), "remove", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_cas_is_invalid_remove_from_cache_failed__FINE", new Object[] { aCasReferenceId });
+ }
+ if ( isEmpty() && callbackListeners.size() > 0 )
+ {
+ for( int i=0; i < callbackListeners.size(); i++ )
+ {
+ ((EventSubscriber)callbackListeners.get(i)).onCacheEmpty();
+ }
+ }
+
+ }
+ public void removeCas(String aCasReferenceId)
+ {
+ if (!cache.containsKey(aCasReferenceId))
+ {
+ return;
+ }
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ casRefEntry.deleteCAS();
+ }
+
+ public CacheEntry[] getCacheEntriesForEndpoint(String anEndpointName )
+ {
+ CacheEntry[] entries;
+ ArrayList list = new ArrayList();
+ Iterator it = cache.keySet().iterator();
+ while( it.hasNext() )
+ {
+ String key = (String)it.next();
+ CacheEntry entry = (CacheEntry)cache.get(key);
+ if ( entry != null && entry.getEndpoint(anEndpointName) != null )
+ {
+ list.add(entry);
+ }
+ }
+ if (list.size() > 0 )
+ {
+ entries = new CacheEntry[list.size()];
+ list.toArray(entries);
+ return entries;
+ }
+ return null;
+ }
+ public void saveSerializedCAS(String aCasReferenceId, String anXCAS)
+ {
+ if (!cache.containsKey(aCasReferenceId))
+ {
+ return;
+ }
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ casRefEntry.setSerializedCas(anXCAS);
+ }
+
+ public String getSerializedCAS(String aCasReferenceId)
+ {
+ if (cache.containsKey(aCasReferenceId))
+ {
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ return casRefEntry.getSerializedCas();
+ }
+ return null;
+ }
+
+ public void setCasProducer( String aCasReferenceId, String aCasProducerKey)
+ {
+ if (cache.containsKey(aCasReferenceId))
+ {
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ casRefEntry.setCasProducerKey(aCasProducerKey);
+ }
+
+ }
+
+ public String getCasProducer( String aCasReferenceId)
+ {
+ if (cache.containsKey(aCasReferenceId))
+ {
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ return casRefEntry.getCasProducerKey();
+ }
+ return null;
+ }
+
+ public synchronized CAS getCasByReference(String aCasReferenceId)
+ {
+ if (!cache.containsKey(aCasReferenceId))
+ {
+ return null;
+ }
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ return casRefEntry.getCas();
+ }
+
+ public MessageContext getMessageAccessorByReference(String aCasReferenceId)
+ {
+ if (!cache.containsKey(aCasReferenceId))
+ {
+ return null;
+ }
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ return casRefEntry.getMessageAccessor();
+ }
+
+ public OutOfTypeSystemData getOutOfTypeSystemData(String aCasReferenceId)
+ {
+ if (!cache.containsKey(aCasReferenceId))
+ {
+ return null;
+ }
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ return casRefEntry.getOtsd();
+ }
+ private CacheEntry getEntry(String aCasReferenceId)
+ {
+ return (CacheEntry) cache.get(aCasReferenceId);
+ }
+ public void addEndpoint( Endpoint anEndpoint, String aCasReferenceId)
+ {
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ casRefEntry.addEndpoint(anEndpoint);
+
+
+ }
+
+ public Endpoint getEndpoint(String anEndpointName, String aCasReferenceId)
+ {
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ if ( anEndpointName == null && casRefEntry != null)
+ {
+ return casRefEntry.getMessageOrigin();
+ }
+ if ( casRefEntry == null )
+ {
+ return null;
+ }
+ else
+ {
+ return casRefEntry.getEndpoint(anEndpointName);
+ }
+ }
+ public void removeEndpoint( String anEndpointName, String aCasReferenceId)
+ {
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ casRefEntry.deleteEndpoint( anEndpointName);
+ }
+
+ public long getStartTime(String aCasReferenceId)
+ {
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ return casRefEntry.getStartTime();
+ }
+ public synchronized String register(CAS aCAS, MessageContext aMessageContext, OutOfTypeSystemData otsd)
+ throws AsynchAEException
+ {
+ //System.out.println("Register");
+ String casReferenceId = idGenerator.nextId();
+ register(aCAS, aMessageContext, otsd, casReferenceId);
+ return casReferenceId;
+ }
+
+ public synchronized String register(CAS aCAS, MessageContext aMessageContext, XmiSerializationSharedData sharedData)
+ throws AsynchAEException
+ {
+ //System.out.println("Register");
+ String casReferenceId = idGenerator.nextId();
+ register(aCAS, aMessageContext, sharedData, casReferenceId);
+ return casReferenceId;
+ }
+ public boolean entryExists(String aCasReferenceId)
+ {
+ try
+ {
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ if ( casRefEntry == null )
+ {
+ return false;
+ }
+ }
+ catch( Exception e)
+ {
+ // ignore
+ }
+ return true;
+ }
+ public synchronized void register(CAS aCAS, MessageContext aMessageContext, OutOfTypeSystemData otsd, String aCasReferenceId)
+ throws AsynchAEException
+ {
+ cache.put(aCasReferenceId, new CacheEntry(aCAS, aMessageContext, otsd));
+ }
+
+
+ public synchronized void register(CAS aCAS, MessageContext aMessageContext, XmiSerializationSharedData sharedData, String aCasReferenceId)
+ throws AsynchAEException
+ {
+ cache.put(aCasReferenceId, new CacheEntry(aCAS, aCasReferenceId, aMessageContext, sharedData));
+ }
+ public void register(CAS aCAS, OutOfTypeSystemData otsd, String aCasReferenceId )
+ throws AsynchAEException
+ {
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ if ( casRefEntry == null )
+ {
+ throw new AsynchAEException("Cas Not Found In CasManager Cache. CasReferenceId::"+aCasReferenceId+" is Invalid");
+ }
+ casRefEntry.setCas(aCAS, otsd);
+ }
+ public void register(CAS aCAS, String aCasReferenceId )
+ throws AsynchAEException
+ {
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ if ( casRefEntry == null )
+ {
+ throw new AsynchAEException("Cas Not Found In CasManager Cache. CasReferenceId::"+aCasReferenceId+" is Invalid");
+ }
+ casRefEntry.setCas(aCAS);
+ }
+
+ public int getNumberOfParallelDelegates(String aCasReferenceId)
+ throws AsynchAEException
+ {
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ if ( casRefEntry == null )
+ {
+ throw new AsynchAEException("Cas Not Found In CasManager Cache. CasReferenceId::"+aCasReferenceId+" is Invalid");
+ }
+ return casRefEntry.getNumberOfParallelDelegates();
+ }
+
+ public void setNumberOfParallelDelegates(int aParallelDelegateCount, String aCasReferenceId)
+ throws AsynchAEException
+ {
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ if ( casRefEntry == null )
+ {
+ throw new AsynchAEException("Cas Not Found In CasManager Cache. CasReferenceId::"+aCasReferenceId+" is Invalid");
+ }
+ casRefEntry.setNumberOfParallelDelegates(aParallelDelegateCount);
+ }
+
+ public CacheEntry getCacheEntryForCAS( String aCasReferenceId )
+ throws AsynchAEException
+ {
+ CacheEntry casRefEntry = getEntry(aCasReferenceId);
+ if ( casRefEntry == null )
+ {
+ throw new AsynchAEException("Cas Not Found In CasManager Cache. CasReferenceId::"+aCasReferenceId+" is Invalid");
+ }
+ return casRefEntry;
+ }
+
+ public class CacheEntry
+ {
+ private CAS cas;
+
+ // the following is set to true if the CAS has been created by CAS Multiplier
+ // This flag is used to determine if the CAS should be output to client.
+ private boolean newCas;
+
+ private String casReferenceId;
+
+ // This is set if the CAS was produced by a Cas Multiplier
+ private String inputCasReferenceId;
+
+ // This is Cas Reference Id of the CAS produced by Remote CM
+ private String remoteCMCasReferenceId;
+
+ private DelegateStats stats;
+
+ private int numberOfParallelDelegates = 1;
+
+ private int howManyDelegatesResponded = 0;
+
+ private MessageContext messageAccessor;
+
+ private OutOfTypeSystemData otsd = null;
+
+ private String serializedCas;
+
+ private String casProducerKey;
+
+ private Map endpointMap = new HashMap();
+
+ private final long timeIn = System.nanoTime();
+
+ private Endpoint messageOrigin;
+
+ private Stack originStack = new Stack();
+
+ private int highWaterMark;
+
+ private XmiSerializationSharedData deserSharedData;
+
+ private String aggregateProducingTheCas;
+
+ private long timeWaitingForCAS = 0;
+
+ private long timeToDeserializeCAS = 0;
+
+ private long timeToSerializeCAS = 0;
+
+ private String casMultiplierKey;
+
+ private boolean sendRequestToFreeCas = true;
+
+ private boolean aborted = false;
+
+ protected CacheEntry(CAS aCas, MessageContext aMessageAccessor, OutOfTypeSystemData aotsd)
+ {
+ cas = aCas;
+ messageAccessor = aMessageAccessor;
+ otsd = aotsd;
+ if ( aMessageAccessor != null )
+ {
+ messageOrigin = aMessageAccessor.getEndpoint();
+
+ //originStack.push(aMessageAccessor.getEndpoint());
+
+ }
+ }
+ protected CacheEntry(CAS aCas, String aCasReferenceId, MessageContext aMessageAccessor, XmiSerializationSharedData sdata)
+ {
+ cas = aCas;
+ messageAccessor = aMessageAccessor;
+ deserSharedData = sdata;
+ if ( aMessageAccessor != null )
+ {
+ messageOrigin = aMessageAccessor.getEndpoint();
+ }
+ casReferenceId = aCasReferenceId;
+ }
+
+ public String getCasReferenceId()
+ {
+ return casReferenceId;
+ }
+
+ public Map getEndpointMap()
+ {
+ return endpointMap;
+ }
+ public String getInputCasReferenceId()
+ {
+ return inputCasReferenceId;
+ }
+
+ public void setInputCasReferenceId(String anInputCasReferenceId)
+ {
+ inputCasReferenceId = anInputCasReferenceId;
+ }
+
+ public void setStat( DelegateStats aStat)
+ {
+ stats = aStat;
+ }
+ public DelegateStats getStat()
+ {
+ return stats;
+ }
+ public void incrementTimeWaitingForCAS( long aTimeWaitingForCAS)
+ {
+ timeWaitingForCAS += aTimeWaitingForCAS;
+ }
+ public void incrementTimeToDeserializeCAS(long aTimeToDeserializeCAS)
+ {
+ timeToDeserializeCAS += aTimeToDeserializeCAS;
+ }
+
+ public void setCasMultiplierKey( String aKey )
+ {
+ casMultiplierKey = aKey;
+ }
+
+ public String getCasMultiplierKey()
+ {
+ return casMultiplierKey;
+ }
+ public void incrementTimeToSerializeCAS(long aTimeToSerializeCAS)
+ {
+ timeToSerializeCAS += aTimeToSerializeCAS;
+ }
+ public long getTimeWaitingForCAS()
+ {
+ return timeWaitingForCAS;
+ }
+ public long getTimeToDeserializeCAS()
+ {
+ return timeToDeserializeCAS;
+ }
+ public long getTimeToSerializeCAS()
+ {
+ return timeToSerializeCAS;
+ }
+
+ public synchronized void incrementHowManyDelegatesResponded()
+ {
+ howManyDelegatesResponded++;
+ }
+ public synchronized int howManyDelegatesResponded()
+ {
+ return howManyDelegatesResponded;
+ }
+
+ public synchronized void resetDelegateResponded()
+ {
+ howManyDelegatesResponded = 0;
+ }
+ public void setNumberOfParallelDelegates( int aNumberOfParallelDelegates )
+ {
+ numberOfParallelDelegates = aNumberOfParallelDelegates;
+ }
+
+ public int getNumberOfParallelDelegates()
+ {
+ return numberOfParallelDelegates;
+ }
+
+ public Endpoint getMessageOrigin()
+ {
+ //Endpoint ep = (Endpoint)originStack.pop();
+ return messageOrigin;
+ }
+ public void addOrigin( Endpoint anEndpoint)
+ {
+ originStack.push(anEndpoint);
+ }
+ protected long getStartTime()
+ {
+ return timeIn;
+ }
+ protected void addEndpoint( Endpoint anEndpoint )
+ {
+ endpointMap.put(anEndpoint.getEndpoint(), anEndpoint);
+ }
+
+ protected Endpoint getEndpoint(String anEndpointName )
+ {
+ return (Endpoint)endpointMap.get(anEndpointName);
+ }
+ protected void deleteEndpoint( String anEndpointName )
+ {
+ if ( endpointMap.containsKey(anEndpointName))
+ {
+ endpointMap.remove(anEndpointName);
+ }
+ else
+ {
+ //System.out.println("!!!!!!!!!!!!!! Unable to Remove Endpoint from cache. Endpoint Name::"+anEndpointName+" Not In Cache");
+ }
+ }
+ protected void deleteCAS()
+ {
+ cas = null;
+ otsd = null;
+ }
+ public CAS getCas()
+ {
+ return cas;
+ }
+ protected void setCas(CAS aCAS, OutOfTypeSystemData aotsd)
+ {
+ cas = aCAS;
+ otsd = aotsd;
+ }
+
+ protected void setCas(CAS aCAS)
+ {
+ cas = aCAS;
+ }
+ protected void setSerializedCas(String aSerializedCas)
+ {
+ serializedCas = aSerializedCas;
+ }
+
+ protected String getSerializedCas()
+ {
+ return serializedCas;
+ }
+
+ protected MessageContext getMessageAccessor()
+ {
+ return messageAccessor;
+ }
+
+ public OutOfTypeSystemData getOtsd()
+ {
+ return otsd;
+ }
+ public int getHighWaterMark()
+ {
+ return highWaterMark;
+ }
+ public void setHighWaterMark(int aHighWaterMark)
+ {
+ highWaterMark = aHighWaterMark;
+ }
+ public boolean isNewCas()
+ {
+ return newCas;
+ }
+ public void setNewCas(boolean newCas, String producedIn)
+ {
+ this.newCas = newCas;
+ aggregateProducingTheCas = producedIn;
+ }
+ public XmiSerializationSharedData getDeserSharedData()
+ {
+ return deserSharedData;
+ }
+
+ public void setXmiSerializationData( XmiSerializationSharedData anXmiSerializationData)
+ {
+ deserSharedData = anXmiSerializationData;
+ }
+
+ public String getCasProducerAggregateName()
+ {
+ return aggregateProducingTheCas;
+ }
+
+ public void setCasProducerKey( String aCasProducerKey )
+ {
+ casProducerKey = aCasProducerKey;
+ }
+
+ public String getCasProducerKey()
+ {
+ return casProducerKey;
+ }
+ public String getRemoteCMCasReferenceId()
+ {
+ return remoteCMCasReferenceId;
+ }
+ public void setRemoteCMCasReferenceId(String remoteCMCasReferenceId)
+ {
+ this.remoteCMCasReferenceId = remoteCMCasReferenceId;
+ }
+ public boolean shouldSendRequestToFreeCas()
+ {
+ return sendRequestToFreeCas;
+ }
+ public void setSendRequestToFreeCas(boolean sendRequestToFreeCas)
+ {
+ this.sendRequestToFreeCas = sendRequestToFreeCas;
+ }
+ public boolean isAborted()
+ {
+ return aborted;
+ }
+ public void setAborted(boolean aborted)
+ {
+ this.aborted = aborted;
+ }
+
+ }
+
+private static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InProcessCacheMBean.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InProcessCacheMBean.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InProcessCacheMBean.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InProcessCacheMBean.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,16 @@
+package org.apache.uima.aae;
+
+import java.io.Serializable;
+
+public interface InProcessCacheMBean extends Serializable
+{
+ public String getName();
+
+ public void setName( String aName );
+
+ public void reset();
+
+ public int getSize();
+
+ public void setSize( int i);
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InputChannel.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InputChannel.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InputChannel.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/InputChannel.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,17 @@
+package org.apache.uima.aae;
+
+import org.apache.uima.aae.jmx.ServiceInfo;
+import org.apache.uima.aae.message.MessageContext;
+
+public interface InputChannel extends Channel
+{
+ public int getSessionAckMode();
+ public void ackMessage( MessageContext aMessageContext );
+ public String getServerUri();
+ public void setServerUri(String aServerUri);
+ public String getInputQueueName();
+ public ServiceInfo getServiceInfo();
+// public void stop() throws Exception;
+ public boolean isStopped();
+ static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/MessageMap.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/MessageMap.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/MessageMap.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/MessageMap.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,10 @@
+package org.apache.uima.aae;
+
+import java.util.HashMap;
+
+public class MessageMap extends HashMap
+{
+
+
+private static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/OutputChannel.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/OutputChannel.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/OutputChannel.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/OutputChannel.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,42 @@
+package org.apache.uima.aae;
+
+import org.apache.uima.aae.controller.AnalysisEngineController;
+import org.apache.uima.aae.controller.Endpoint;
+import org.apache.uima.aae.error.AsynchAEException;
+import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData;
+import org.apache.uima.cas.CAS;
+import org.apache.uima.resource.metadata.ProcessingResourceMetaData;
+
+public interface OutputChannel extends Channel
+{
+ public void setController( AnalysisEngineController aContainer );
+
+ public void initialize() throws AsynchAEException;
+
+ public void sendRequest( String aCasReferenceId, Endpoint anEndpoint ) throws AsynchAEException;
+
+ public void sendRequest( String aCasReferenceId, Endpoint[] anEndpoint ) throws AsynchAEException;
+
+ public void sendRequest( int aCommand, Endpoint anEndpoint ) throws AsynchAEException;
+
+ public void sendRequest( int aCommand, String aCasReferenceId, Endpoint anEndpoint ) throws AsynchAEException;
+
+ public void sendReply( int aCommand, Endpoint anEndpoint ) throws AsynchAEException;
+
+ public void sendReply( CAS aCas, String anInputCasReferenceId, String aNewCasReferenceId, Endpoint anEndpoint, long sequence ) throws AsynchAEException;
+
+ public void sendReply( String aCasReferenceId, Endpoint anEndpoint ) throws AsynchAEException;
+
+// public void sendReply( AnalysisEngineMetaData anAnalysisEngineMetadata, Endpoint anEndpoint, boolean serialize ) throws AsynchAEException;
+ public void sendReply( ProcessingResourceMetaData aProcessingResourceMetadata, Endpoint anEndpoint, boolean serialize ) throws AsynchAEException;
+
+ public void sendReply(Throwable t, String aCasReferenceId, Endpoint anEndpoint, int aCommand) throws AsynchAEException;
+
+
+
+ public void setServerURI( String aServerURI );
+
+ public void stop();
+
+ static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/ParallelStep.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/ParallelStep.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/ParallelStep.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/ParallelStep.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,37 @@
+package org.apache.uima.aae;
+
+import org.apache.uima.flow.FlowControllerContext;
+import org.apache.uima.flow.Step;
+
+public class ParallelStep extends Step
+{
+ public ParallelStep(String[] aCasProcessorKeys) {
+ mKeys = aCasProcessorKeys;
+ }
+
+ /**
+ * Gets the key of the Analysis Engine to which the CAS should be routed.
+ *
+ * @return an AnalysisEngine key
+ */
+ public String[] getAnalysisEngineKeys() {
+ return mKeys;
+ }
+
+ /**
+ * Sets the key of the Analysis Engine to which the CAS should be routed. By using this method, a
+ * user's Flow implementation can (but is not required to) reuse the same SimpleStep object
+ * multiple times.
+ *
+ * @return an Analysis Engine key. This must be one of the keys in the FlowController's
+ * {@link FlowControllerContext#getAnalysisEngineMetaDataMap()}.
+ */
+ public void setAnalysisEngineKeys(String[] aKeys) {
+ mKeys = aKeys;
+ }
+
+ private String[] mKeys;
+
+
+private static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UIDGenerator.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UIDGenerator.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UIDGenerator.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UIDGenerator.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,14 @@
+package org.apache.uima.aae;
+
+import java.rmi.server.UID;
+
+public class UIDGenerator implements UniqueIdGenerator
+{
+ public String nextId()
+ {
+ return new UID().toString();
+ }
+
+
+private static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UIMAEE_Constants.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UIMAEE_Constants.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UIMAEE_Constants.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UIMAEE_Constants.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,10 @@
+package org.apache.uima.aae;
+
+public class UIMAEE_Constants
+{
+ public static final String JMS_LOG_RESOURCE_BUNDLE = "uimaee_messages";
+ public static final String Terminate = "terminate";
+
+
+private static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaClassFactory.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaClassFactory.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaClassFactory.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaClassFactory.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,197 @@
+package org.apache.uima.aae;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.apache.uima.UIMAFramework;
+import org.apache.uima.UimaContextAdmin;
+import org.apache.uima.aae.jmx.JmxManagement;
+import org.apache.uima.analysis_engine.AnalysisEngine;
+import org.apache.uima.analysis_engine.AnalysisEngineDescription;
+import org.apache.uima.analysis_engine.asb.impl.FlowControllerContainer;
+import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData;
+import org.apache.uima.analysis_engine.metadata.FlowControllerDeclaration;
+import org.apache.uima.analysis_engine.metadata.SofaMapping;
+import org.apache.uima.cas.CAS;
+import org.apache.uima.flow.FlowController;
+import org.apache.uima.flow.FlowControllerContext;
+import org.apache.uima.flow.FlowControllerDescription;
+import org.apache.uima.flow.impl.FlowControllerContext_impl;
+import org.apache.uima.resource.Resource;
+import org.apache.uima.resource.ResourceInitializationException;
+import org.apache.uima.resource.ResourceManager;
+import org.apache.uima.resource.ResourceSpecifier;
+import org.apache.uima.resource.metadata.Import;
+import org.apache.uima.resource.metadata.ProcessingResourceMetaData;
+import org.apache.uima.resource.metadata.impl.Import_impl;
+import org.apache.uima.util.InvalidXMLException;
+import org.apache.uima.util.XMLInputSource;
+
+public class UimaClassFactory
+{
+ public static final String IMPORT_BY_NAME_PREFIX = "*importByName:";
+
+ public static AnalysisEngine produceAnalysisEngine()
+ {
+ return null;
+ }
+
+
+ public static ResourceSpecifier produceResourceSpecifier( String aFileResource )
+ throws InvalidXMLException, ResourceInitializationException, IOException
+ {
+ XMLInputSource input = resolveImportByName(aFileResource, UIMAFramework.newDefaultResourceManager());
+ return UIMAFramework.getXMLParser().parseResourceSpecifier(input);
+
+ }
+
+ public static AnalysisEngine produceAnalysisEngine(String aDescriptor)
+ throws InvalidXMLException, ResourceInitializationException, IOException
+ {
+
+ ResourceSpecifier specifier =
+ UIMAFramework.getXMLParser().
+ parseAnalysisEngineDescription(new XMLInputSource(new File(aDescriptor)));
+
+
+
+ AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(specifier);
+ return ae;
+ }
+
+ public static ResourceManager produceResourceManager()
+ {
+ return UIMAFramework.newDefaultResourceManager();
+ }
+
+ public static ProcessingResourceMetaData produceProcessingResourceMetaData(AnalysisEngine analysisEngine)
+ {
+ return analysisEngine.getProcessingResourceMetaData();
+ }
+ private static XMLInputSource resolveImportByName( String aFileResource, ResourceManager aResourceManager ) throws InvalidXMLException,
+ ResourceInitializationException, IOException
+ {
+ XMLInputSource input;
+
+ if (aFileResource.startsWith(IMPORT_BY_NAME_PREFIX))
+ {
+ Import theImport = new Import_impl();
+ theImport.setName(aFileResource.substring(IMPORT_BY_NAME_PREFIX.length()));
+ input = new XMLInputSource(theImport.findAbsoluteUrl(aResourceManager));
+ }
+ else
+ {
+ input = new XMLInputSource(aFileResource);
+ }
+ return input;
+
+ }
+
+ public static FlowControllerContainer produceAggregateFlowControllerContainer(
+ AnalysisEngineDescription aeSpecifier, String aFlowControllerDescriptor,
+ Map anAggregateMergedTypeSystem, UimaContextAdmin aParentContext, SofaMapping[] aSofaMappings, JmxManagement aJmxManagementInterface ) throws InvalidXMLException,
+ ResourceInitializationException, IOException {
+ {
+
+ FlowControllerDeclaration fcd = aeSpecifier.getFlowControllerDeclaration();
+ String key = "_FlowController"; // default
+ if ( fcd != null && fcd.getKey() != null && fcd.getKey().trim().length() > 0)
+ {
+ key = fcd.getKey();
+ }
+
+ ResourceManager resourceManager = aParentContext.getRootContext().getResourceManager(); // NEW
+ XMLInputSource input = resolveImportByName(aFlowControllerDescriptor, resourceManager);
+
+ FlowControllerDescription specifier = (FlowControllerDescription) UIMAFramework.getXMLParser()
+ .parseResourceSpecifier(input);
+ AnalysisEngineMetaData anAggregateMetadata = aeSpecifier.getAnalysisEngineMetaData();
+
+ Map sofamap = new TreeMap();
+ if (aSofaMappings != null && aSofaMappings.length > 0) {
+ for (int s = 0; s < aSofaMappings.length; s++) {
+ // the mapping is for this analysis engine
+ if (aSofaMappings[s].getComponentKey().equals(key)) {
+ // if component sofa name is null, replace it with the default for TCAS sofa name
+ // This is to support old style TCAS
+ if (aSofaMappings[s].getComponentSofaName() == null)
+ aSofaMappings[s].setComponentSofaName(CAS.NAME_DEFAULT_SOFA);
+ sofamap.put(aSofaMappings[s].getComponentSofaName(), aSofaMappings[s]
+ .getAggregateSofaName());
+ }
+ }
+ }
+ Map flowControllerParams = new HashMap();
+ FlowControllerContext fctx = new FlowControllerContext_impl(aParentContext, key,
+ sofamap, anAggregateMergedTypeSystem, anAggregateMetadata);
+
+ flowControllerParams.put(Resource.PARAM_UIMA_CONTEXT, fctx);
+ flowControllerParams.put(Resource.PARAM_RESOURCE_MANAGER, resourceManager);
+ flowControllerParams.put(AnalysisEngine.PARAM_MBEAN_NAME_PREFIX, aJmxManagementInterface.getJmxDomain());
+ if( aJmxManagementInterface.getMBeanServer() != null )
+ {
+ flowControllerParams.put(AnalysisEngine.PARAM_MBEAN_SERVER, aJmxManagementInterface.getMBeanServer());
+ }
+ FlowControllerContainer flowControllerContainer = new FlowControllerContainer();
+ flowControllerContainer.initialize(specifier, flowControllerParams);
+ return flowControllerContainer;
+ }
+ }
+
+ public static UimaContextAdmin produceUimaContext()
+ {
+ UimaContextAdmin uctxt = UIMAFramework.newUimaContext(UIMAFramework.getLogger(),
+ UIMAFramework.newDefaultResourceManager(),
+ UIMAFramework.newConfigurationManager());
+
+
+ return uctxt;
+ }
+
+
+ public static FlowController produceFlowController( String aFlowControllerDescriptor ) throws Exception
+ {
+ FlowControllerDescription specifier = (FlowControllerDescription)
+ UIMAFramework.getXMLParser().parseResourceSpecifier(new XMLInputSource(new File(aFlowControllerDescriptor)));
+
+ String flowControllerClassName;
+ flowControllerClassName = specifier.getImplementationName();
+
+ if (flowControllerClassName == null || flowControllerClassName.length() == 0)
+ {
+ throw new ResourceInitializationException(ResourceInitializationException.MISSING_IMPLEMENTATION_CLASS_NAME, new Object[] { specifier.getSourceUrlString() });
+ }
+ // load FlowController class
+ Class flowControllerClass = null;
+ try
+ {
+ // use application ClassLoader to load the class
+ flowControllerClass = Class.forName(flowControllerClassName);
+ }
+ catch ( ClassNotFoundException e)
+ {
+ throw new ResourceInitializationException(ResourceInitializationException.CLASS_NOT_FOUND, new Object[] { flowControllerClassName, specifier.getSourceUrlString() }, e);
+ }
+
+ Object userObject;
+ try
+ {
+ userObject = flowControllerClass.newInstance();
+ }
+ catch ( Exception e)
+ {
+ throw new ResourceInitializationException(ResourceInitializationException.COULD_NOT_INSTANTIATE, new Object[] { flowControllerClassName, specifier.getSourceUrlString() }, e);
+ }
+ if (!(userObject instanceof FlowController))
+ {
+ throw new ResourceInitializationException(ResourceInitializationException.RESOURCE_DOES_NOT_IMPLEMENT_INTERFACE, new Object[] { flowControllerClassName, FlowController.class, specifier.getSourceUrlString() });
+ }
+ return (FlowController) userObject;
+ }
+
+
+private static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaEEAdminContext.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaEEAdminContext.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaEEAdminContext.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaEEAdminContext.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,9 @@
+package org.apache.uima.aae;
+
+public interface UimaEEAdminContext
+{
+ public void shutdown();
+ public void stopListener(String anEndpoint );
+
+ static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaEEShutdownHook.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaEEShutdownHook.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaEEShutdownHook.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaEEShutdownHook.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,35 @@
+package org.apache.uima.aae;
+
+import java.util.ArrayList;
+
+import org.apache.uima.aae.jmx.JmxManager;
+
+public class UimaEEShutdownHook extends Thread
+{
+ private JmxManager[] jmxMgrs;
+ private String serviceName;
+
+ public UimaEEShutdownHook( ArrayList jmxManagers, String aServiceName )
+ {
+ jmxMgrs = new JmxManager[jmxManagers.size()];
+ jmxManagers.toArray(jmxMgrs);
+ serviceName = aServiceName;
+ }
+ public void run()
+ {
+// try
+// {
+// for( int i=0; jmxMgrs!= null && i < jmxMgrs.length; i++ )
+// {
+// jmxMgrs[i].removeQueue();
+// }
+// }
+// catch( Exception e)
+// {
+// e.printStackTrace();
+// }
+ }
+
+
+private static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaSerializer.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaSerializer.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaSerializer.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UimaSerializer.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,177 @@
+package org.apache.uima.aae;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.OutputKeys;
+
+import org.apache.uima.cas.CAS;
+import org.apache.uima.cas.TypeSystem;
+import org.apache.uima.cas.impl.OutOfTypeSystemData;
+import org.apache.uima.cas.impl.XCASDeserializer;
+import org.apache.uima.cas.impl.XCASSerializer;
+import org.apache.uima.cas.impl.XmiCasDeserializer;
+import org.apache.uima.cas.impl.XmiCasSerializer;
+import org.apache.uima.cas.impl.XmiSerializationSharedData;
+import org.apache.uima.util.XMLSerializer;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+public class UimaSerializer
+{
+ /**
+ * Serializes XCas into CAS
+ *
+ * @param anXcas
+ * @param aCas
+ * @throws Exception
+ */
+ public static OutOfTypeSystemData deSerialiazeFromXCAS(String anXcas, CAS aCas) throws Exception
+ {
+ OutOfTypeSystemData otsd = new OutOfTypeSystemData();
+ TypeSystem typesToLoad2 = aCas.getTypeSystem();
+ ByteArrayInputStream bis = new ByteArrayInputStream(anXcas.getBytes());
+ XCASDeserializer deser2 = new XCASDeserializer(typesToLoad2);
+ ContentHandler deserHandler2 = deser2.getXCASHandler(aCas, otsd);
+
+ SAXParserFactory fact2 = SAXParserFactory.newInstance();
+ SAXParser parser2;
+ parser2 = fact2.newSAXParser();
+ XMLReader xmlReader2 = parser2.getXMLReader();
+ xmlReader2.setContentHandler(deserHandler2);
+ xmlReader2.parse(new InputSource(bis));
+ return otsd;
+ }
+
+ /**
+ * Serializes CAS into a given OutputStream
+ *
+ * @param stream
+ * @param aCAS
+ * @param encoding
+ * @param typeSystem
+ * @throws IOException
+ * @throws SAXException
+ */
+ public static void serializeToXCAS(OutputStream stream, CAS aCAS, String encoding, TypeSystem typeSystem, OutOfTypeSystemData otsd) throws IOException, SAXException
+ {
+
+ if (typeSystem == null)
+ typeSystem = aCAS.getTypeSystem();
+ XMLSerializer xmlSer = new XMLSerializer(stream, false);
+ if (encoding != null)
+ xmlSer.setOutputProperty(OutputKeys.ENCODING, encoding);
+ XCASSerializer ser = new XCASSerializer(typeSystem);
+ ser.serialize(aCAS, xmlSer.getContentHandler(), false, otsd);
+ }
+
+ /**
+ * Serializes CAS into a given OutputStream
+ *
+ * @param stream
+ * @param aCAS
+ * @param encoding
+ * @param typeSystem
+ * @throws IOException
+ * @throws SAXException
+ */
+ public static void serializeToXMI(OutputStream stream, CAS aCAS, String encoding, TypeSystem typeSystem, OutOfTypeSystemData otsd) throws IOException, SAXException
+ {
+
+ if (typeSystem == null)
+ typeSystem = aCAS.getTypeSystem();
+// XMLSerializer xmlSer = new XMLSerializer(writer, false);
+ XMLSerializer xmlSer = new XMLSerializer(stream, false);
+ if (encoding != null)
+ xmlSer.setOutputProperty(OutputKeys.ENCODING, encoding);
+
+ XmiCasSerializer ser = new XmiCasSerializer(typeSystem);
+
+ ser.serialize(aCAS, xmlSer.getContentHandler());
+ // ser.serialize(aCAS, xmlSer.getContentHandler(),false, otsd);
+ }
+
+ /**
+ * Utility method for serializing a CAS to an XMI String
+ */
+ public static String serializeCasToXmi(CAS aCAS, XmiSerializationSharedData serSharedData) throws Exception
+ {
+ Writer writer = new StringWriter();
+ try
+ {
+ XMLSerializer xmlSer = new XMLSerializer(writer, false);
+ XmiCasSerializer ser = new XmiCasSerializer(aCAS.getTypeSystem());
+ ser.serialize(aCAS, xmlSer.getContentHandler(), null, serSharedData);
+ return writer.toString();
+ }
+ catch( Exception e)
+ {
+ throw e;
+ }
+ finally
+ {
+ writer.close();
+ }
+ }
+/*
+ public static String serializeCasToXmi(CAS cas, XmiSerializationSharedData serSharedData) throws IOException, SAXException
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ XmiCasSerializer.serialize(cas, null, baos, false, serSharedData);
+
+ baos.close();
+ String xmiStr = new String(baos.toByteArray(), "UTF-8");
+ return xmiStr;
+ }
+*/
+
+ /** Utility method for deserializing a CAS from an XMI String */
+ public static void deserializeCasFromXmi(String anXmlStr, CAS aCAS, XmiSerializationSharedData aSharedData, boolean aLenient, int aMergePoint)
+ throws FactoryConfigurationError, ParserConfigurationException, SAXException, IOException
+ {
+
+ Reader reader = new StringReader(anXmlStr);
+ XMLReader xmlReader = XMLReaderFactory.createXMLReader();
+ XmiCasDeserializer deser = new XmiCasDeserializer(aCAS.getTypeSystem());
+ ContentHandler handler = deser.getXmiCasHandler(aCAS, aLenient, aSharedData, aMergePoint);
+ xmlReader.setContentHandler(handler);
+ xmlReader.parse(new InputSource(reader));
+
+
+
+
+
+ /*
+ byte[] bytes = xmlStr.getBytes("UTF-8"); // this assumes the encoding
+ // is UTF-8, which is the
+ // default output encoding
+ // of the XmiCasSerializer
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+ try
+ {
+ XmiCasDeserializer.deserialize(bais, cas, lenient, sharedData, mergePoint);
+ }
+ finally
+ {
+ bais.close();
+ }
+*/
+
+ }
+
+
+private static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UniqueIdGenerator.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UniqueIdGenerator.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UniqueIdGenerator.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/UniqueIdGenerator.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,8 @@
+package org.apache.uima.aae;
+
+public interface UniqueIdGenerator
+{
+ public String nextId();
+
+ static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/client/UimaAsynchronousEngine.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/client/UimaAsynchronousEngine.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/client/UimaAsynchronousEngine.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/client/UimaAsynchronousEngine.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,152 @@
+package org.apache.uima.aae.client;
+
+import java.util.Map;
+
+import org.apache.uima.cas.CAS;
+import org.apache.uima.collection.CollectionReader;
+import org.apache.uima.collection.StatusCallbackListener;
+import org.apache.uima.resource.ResourceInitializationException;
+import org.apache.uima.resource.ResourceProcessException;
+import org.apache.uima.resource.metadata.ProcessingResourceMetaData;
+
+public interface UimaAsynchronousEngine
+{
+ public final String ApplicationContext = "ApplicationContext";
+ public final String ServerUri = "ServerURI";
+ public final String Endpoint = "Endpoint";
+ public final String CasPoolSize = "CasPoolSize";
+ public static final String ReplyWindow = "ReplyWindow";
+ public static final String Timeout = "Timeout";
+ public static final String CpcTimeout = "CpcTimeout";
+ public static final String GetMetaTimeout = "GetMetaTimeout";
+ public static final String DD2SpringXsltFilePath = "DD2SpringXsltFilePath";
+ public static final String SaxonClasspath = "SaxonClasspath";
+ public static final String UimaEeDebug = "-uimaEeDebug";
+ /**
+ * Initializes and instantiates UIMA EE Client component from
+ * provided spring xml context configuration file(s).
+ *
+ * @param configFiles - spring xml context files
+ * @param anApplicationContext
+ *
+ * @throws ResourceInitializationException
+ */
+ public void initialize( String[] configFiles, Map anApplicationContext ) throws ResourceInitializationException;
+
+ /**
+ * Initializes asynchronous client using configuration parameters provided in a Map object. It creates a
+ * connection to a service queue managed by a Broker as specified in the parameters. A temporary reply
+ * queue is also created here with a jms listener attached to it. Once the connections are made and the
+ * listener is started the method sends getMeta request to the uima ee service and waits for a response.
+ * When the reply to getMeta is receives the uima ee client is fully initialized and notifies an
+ * application by calling initializationComplete() on the application listener.
+ *
+ * @param anApplicationContext - configuration containing UIMA EE Service Broker URI, service
+ * queue name, timeout value, reply window size, and Cas Pool size.
+ *
+ * @throws ResourceInitializationException
+ */
+ public void initialize( Map anApplicationContext ) throws ResourceInitializationException;
+
+ /**
+ * Plugs in a CollectionReader instance to use. The application calls process() method to
+ * begin analyzing the collection.
+ *
+ * @param aCollectionReader - instnace of a CollectionReader
+ */
+ public void setCollectionReader( CollectionReader aCollectionReader ) throws ResourceInitializationException;
+
+ /**
+ * Plugs-in application specific listener. Via this listener the
+ * application receives callbacks. More than one listener can be added.
+ *
+ *
+ * @param aListener - application listener object to add
+ */
+ public void addStatusCallbackListener(UimaEEStatusCallbackListener aListener);
+
+ /**
+ * Removes named application listener.
+ *
+ * @param aListener - application listener to remove
+ */
+ public void removeStatusCallbackListener(UimaEEStatusCallbackListener aListener);
+
+ /**
+ * Stops the asynchronous client. Cleans up resources, drops connection to UIMA EE
+ * service queue and stops listening on a response queue.
+ *
+ * @throws Exception
+ */
+ public void stop() throws Exception;
+
+ /**
+ * Not implemented
+ *
+ * @return null
+ */
+ public String getPerformanceReport();
+
+ /**
+ * Starts processing a collection. This method should be only called after an instance
+ * of a CollectionReader is provided via setCollectionReader(). The method will block
+ * until the CollectionReader finishes processing of the entire collection.
+ *
+ * @throws ResourceProcessException - when CollectionReader is not provided, or initialize()
+ * has not been called.
+ */
+ public void process() throws ResourceProcessException;
+ /**
+ * Sends a given CAS for analysis to UIMA EE Service. This method may block if
+ * the client is configured to use a reply window which prevents from sending too
+ * many CASes to the service. Assuming the window is large enough to send the CAS
+ * this method returns as soon as the CAS is sent. Before sending the CAS, a timer
+ * starts that will expire if a reply doesnt arrive in a given interval.
+ *
+ * @param aCAS - a CAS to analyze.
+ *
+ * @throws ResourceProcessException
+ */
+ public String sendCAS( CAS aCAS ) throws ResourceProcessException;
+
+ /**
+ * Requests a new CAS instance from a CAS pool. This method blocks
+ * until a free instance of CAS is available in a CAS pool.
+ *
+ * @return - CAS instance
+ * @throws Exception
+ */
+ public CAS getCAS() throws Exception;
+
+ /**
+ * Sends a Collection Processing Complete request to UIMA EE Analysis Service and
+ * blocks waiting for a reply. The method blocks until the service replies
+ * or a timeout occurs. Before returning, this method will notify the application
+ * of completing Collection Processing Complete request via a listener
+ *
+ * @throws ResourceProcessException
+ */
+ public void collectionProcessingComplete() throws ResourceProcessException;
+
+ /**
+ * Returns ProcessingResourceMetadata of the UIMA EE Analysis Service. The metadata is
+ * obtained from the service during initialization and cached .
+ *
+ * returns - instance of ProcessingResourceMetadata received from an asynchronous
+ * Analysis Engine service, or null if initialize() has not yet been called.
+ */
+ public ProcessingResourceMetaData getMetaData() throws ResourceInitializationException;
+
+ /**
+ * Send a CAS, wait for response, and deserialize into same CAS.
+ */
+ public void sendAndReceiveCAS(CAS aCAS) throws ResourceProcessException;
+
+ public String deploy( String aDeploymentDescriptor, Map anApplicationContext) throws Exception;
+
+ public String deploy( String[] aDeploymentDescriptorList, Map anApplicationContext ) throws Exception;
+
+ public void undeploy( String aSpringContainerId ) throws Exception;
+
+public static final String copyright = com.ibm.uima.copyright.Copyright.COPYRIGHT;
+}
Added: incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/client/UimaEEProcessStatusImpl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/client/UimaEEProcessStatusImpl.java?rev=610003&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/client/UimaEEProcessStatusImpl.java (added)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ee-core/src/main/java/org/apache/uima/aae/client/UimaEEProcessStatusImpl.java Tue Jan 8 06:38:38 2008
@@ -0,0 +1,117 @@
+package org.apache.uima.aae.client;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.uima.util.ProcessTrace;
+
+public class UimaEEProcessStatusImpl implements org.apache.uima.collection.EntityProcessStatus
+{
+
+ private static final long serialVersionUID = -5101356145458558249L;
+
+ ProcessTrace prT;
+
+ HashMap eventMap = new HashMap();
+
+ List exceptionList = new ArrayList();
+
+ List failedList = new ArrayList();
+
+ HashMap resultHM = new HashMap();
+
+ private boolean isSkipped = false;
+
+ public boolean isProcessed = true;
+
+ public UimaEEProcessStatusImpl(ProcessTrace p) {
+ prT = p;
+ }
+
+ public UimaEEProcessStatusImpl(ProcessTrace p, boolean aSkip) {
+ prT = p;
+ isSkipped = aSkip;
+ }
+
+ public boolean isException() {
+ if (failedList.size() > 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public String getStatusMessage() {
+ if (failedList.size() > 0)
+ return "failed";
+ return "success";
+ }
+
+ public List getExceptions() {
+ return exceptionList;
+ }
+
+ public List getFailedComponentNames() {
+
+ return failedList;
+ }
+
+ public void addEventStatus(String aEventName, String aResultS, Throwable aE) {
+ EventLog eL = new EventLog(aResultS, aE);
+ eventMap.put(aEventName, eL);
+ if (!aResultS.equalsIgnoreCase("success")) {
+ failedList.add(aEventName);
+ exceptionList.add(aE);
+
+ }
+ resultHM.put(aEventName, aE);
+ }
+
+ public ProcessTrace getProcessTrace() {
+ return prT;
+ }
+
+ public void printEventLog() {
+ Iterator iter = eventMap.entrySet().iterator();
+ while (iter.hasNext()) {
+ Object obj = iter.next();
+ String key = (String) ((Map.Entry) obj).getKey();
+ EventLog eL = (EventLog) ((Map.Entry) obj).getValue();
+ System.out.println(" EVENT " + key + " Result " + eL.status);
+ if (eL.exception != null) {
+ eL.exception.printStackTrace();
+ }
+
+ }
+ for (int j = 0; j < failedList.size(); j++) {
+
+ System.out.println(" failed component name " + failedList.get(j));
+ }
+ }
+
+ static class EventLog {
+ String status;
+
+ // Exception exception;
+ Throwable exception;
+
+ // public EventLog( String stats , Exception e ) {
+ public EventLog(String stats, Throwable e) {
+ status = stats;
+ exception = e;
+ }
+
+ }
+
+ /**
+ * Gets whether an entity has beed skipped during processing
+ *
+ * @return true if an entity was skipped, false otherwise
+ */
+ public boolean isEntitySkipped() {
+ return isSkipped;
+ }
+ }