uima-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r703879 - in /incubator/uima/sandbox/trunk/uima-as: uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/ uimaj-as-core/src/main/java/org/apache/uima/aae/ uimaj-as-core/src/main/java/org/apache/uima/aae/controller/ uimaj-as-...
Date Sun, 12 Oct 2008 21:20:04 GMT
Author: schor
Date: Sun Oct 12 14:20:03 2008
New Revision: 703879

URL: http://svn.apache.org/viewvc?rev=703879&view=rev
Log:
[UIMA-1200] apply patches - avoid creating new XMLReader with every deserialization

Modified:
    incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java
    incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaSerializer.java
    incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
    incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/HandlerBase.java
    incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java
    incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java
    incubator/uima/sandbox/trunk/uima-as/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java?rev=703879&r1=703878&r2=703879&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java
(original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java
Sun Oct 12 14:20:03 2008
@@ -96,6 +96,7 @@
 	private Destination freeCASTempQueue;
 
   private String hostIP = null;
+  private UimaSerializer uimaSerializer = new UimaSerializer();
 
   public JmsOutputChannel()
   {
@@ -205,10 +206,10 @@
 			{
 				serSharedData = cacheEntry.getDeserSharedData();
 				if (cacheEntry.acceptsDeltaCas())  {
-			      serializedCas = UimaSerializer.serializeCasToXmi(aCAS, serSharedData, cacheEntry.getMarker());
+          serializedCas = uimaSerializer.serializeCasToXmi(aCAS, serSharedData, cacheEntry.getMarker());
 			      cacheEntry.setSentDeltaCas(true);
 				} else {
-				  serializedCas = UimaSerializer.serializeCasToXmi(aCAS, serSharedData);
+          serializedCas = uimaSerializer.serializeCasToXmi(aCAS, serSharedData);
 				  cacheEntry.setSentDeltaCas(false);
 				}
 			}
@@ -219,7 +220,7 @@
 					serSharedData = new XmiSerializationSharedData();
 					cacheEntry.setXmiSerializationData(serSharedData);
 				}
-			    serializedCas = UimaSerializer.serializeCasToXmi(aCAS, serSharedData);
+        serializedCas = uimaSerializer.serializeCasToXmi(aCAS, serSharedData);
 			    int maxOutgoingXmiId = serSharedData.getMaxXmiId();				
 				//	Save High Water Mark in case a merge is needed
 			    getAnalysisEngineController().
@@ -235,7 +236,7 @@
 			ByteArrayOutputStream bos = new ByteArrayOutputStream();
 			try
 			{
-				UimaSerializer.serializeToXCAS(bos, aCAS, null, null, null);
+        uimaSerializer.serializeToXCAS(bos, aCAS, null, null, null);
 				serializedCas = bos.toString();
 			}
 			catch ( Exception e)
@@ -1030,7 +1031,7 @@
         //  Serialize CAS for remote Delegates
         String serializer = anEndpoint.getSerializer();
         if ( serializer.equals("binary")) {
-          serializedCAS = UimaSerializer.serializeCasToBinary(cas);
+          serializedCAS = uimaSerializer.serializeCasToBinary(cas);
         } else {
           UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
                   "getBinaryCas", JmsConstants.JMS_LOG_RESOURCE_BUNDLE, "UIMAJMS_invalid_serializer__WARNING",
@@ -1109,7 +1110,7 @@
       ServicePerformance casStats = getAnalysisEngineController().getCasStatistics(aCasReferenceId);
         CacheEntry entry = getAnalysisEngineController().getInProcessCache().getCacheEntryForCAS(aCasReferenceId);
         long t1 = getAnalysisEngineController().getCpuTime();
-        serializedCAS = UimaSerializer.serializeCasToBinary(cas);
+        serializedCAS = uimaSerializer.serializeCasToBinary(cas);
         long timeToSerializeCas = getAnalysisEngineController().getCpuTime()-t1;
         
         getAnalysisEngineController().incrementSerializationTime(timeToSerializeCas);

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaSerializer.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaSerializer.java?rev=703879&r1=703878&r2=703879&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaSerializer.java
(original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaSerializer.java
Sun Oct 12 14:20:03 2008
@@ -27,6 +27,7 @@
 import java.io.StringReader;
 import java.io.StringWriter;
 import java.io.Writer;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.xml.parsers.FactoryConfigurationError;
 import javax.xml.parsers.ParserConfigurationException;
@@ -54,6 +55,9 @@
 
 public class UimaSerializer
 {
+  
+  private ConcurrentHashMap xmlReaderMap = new ConcurrentHashMap();
+  private Object mux = new Object();
 	/**
 	 * Serializes XCas into CAS
 	 * 
@@ -61,7 +65,7 @@
 	 * @param aCas
 	 * @throws Exception
 	 */
-	public static OutOfTypeSystemData deSerialiazeFromXCAS(String anXcas, CAS aCas) throws Exception
+	public OutOfTypeSystemData deSerialiazeFromXCAS(String anXcas, CAS aCas) throws Exception
 	{
 		OutOfTypeSystemData otsd = new OutOfTypeSystemData();
 		TypeSystem typesToLoad2 = aCas.getTypeSystem();
@@ -88,7 +92,7 @@
 	 * @throws IOException
 	 * @throws SAXException
 	 */
-	public static void serializeToXCAS(OutputStream stream, CAS aCAS, String encoding, TypeSystem
typeSystem, OutOfTypeSystemData otsd) throws IOException, SAXException
+	public void serializeToXCAS(OutputStream stream, CAS aCAS, String encoding, TypeSystem typeSystem,
OutOfTypeSystemData otsd) throws IOException, SAXException
 	{
 
 		if (typeSystem == null)
@@ -110,7 +114,7 @@
 	 * @throws IOException
 	 * @throws SAXException
 	 */
-	public static void serializeToXMI(OutputStream stream, CAS aCAS, String encoding, TypeSystem
typeSystem, OutOfTypeSystemData otsd) throws IOException, SAXException
+	public void serializeToXMI(OutputStream stream, CAS aCAS, String encoding, TypeSystem typeSystem,
OutOfTypeSystemData otsd) throws IOException, SAXException
 	{
 
 		if (typeSystem == null)
@@ -129,7 +133,7 @@
 	/**
 	 * Utility method for serializing a CAS to an XMI String
 	 */
-	public static String serializeCasToXmi(CAS aCAS, XmiSerializationSharedData serSharedData)
throws Exception
+	public String serializeCasToXmi(CAS aCAS, XmiSerializationSharedData serSharedData) throws
Exception
 	{
 		Writer writer = new StringWriter();
 		try
@@ -149,7 +153,7 @@
 		}
 	}
 	
-	public static String serializeCasToXmi(CAS aCAS, XmiSerializationSharedData serSharedData,
Marker aMarker) throws Exception
+	public String serializeCasToXmi(CAS aCAS, XmiSerializationSharedData serSharedData, Marker
aMarker) throws Exception
 	{
 		Writer writer = new StringWriter();
 		try
@@ -170,34 +174,50 @@
 	}
 	
 	/** Utility method for deserializing a CAS from an XMI String */
-	public static void deserializeCasFromXmi(String anXmlStr, CAS aCAS, XmiSerializationSharedData
aSharedData, 
+	public 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();
+    XMLReader xmlReader = null;
+    //  Create a new instance of a XMLReader if one doesnt exist in the
+    //  global map. Each thread reuses its own instance.
+    synchronized( mux ) {
+      if ( !xmlReaderMap.containsKey(Thread.currentThread().getId())) {
+        xmlReader = XMLReaderFactory.createXMLReader();
+        xmlReaderMap.put(Thread.currentThread().getId(), xmlReader);
+      } else {
+        xmlReader = (XMLReader) xmlReaderMap.get(Thread.currentThread().getId());
+      }
+    }
+    Reader reader = new StringReader(anXmlStr);
     XmiCasDeserializer deser = new XmiCasDeserializer(aCAS.getTypeSystem());
-	    ContentHandler handler = deser.getXmiCasHandler(aCAS, aLenient, aSharedData, aMergePoint);
-	    xmlReader.setContentHandler(handler);
-	    xmlReader.parse(new InputSource(reader));
-
+    ContentHandler handler = deser.getXmiCasHandler(aCAS, aLenient, aSharedData, aMergePoint);
+    xmlReader.setContentHandler(handler);
+    xmlReader.parse(new InputSource(reader));
 	}
 
-	public static void deserializeCasFromXmi(String anXmlStr, CAS aCAS, XmiSerializationSharedData
aSharedData, 
+	public void deserializeCasFromXmi(String anXmlStr, CAS aCAS, XmiSerializationSharedData
aSharedData, 
 			boolean aLenient, int aMergePoint, AllowPreexistingFS allow) 
 	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,
allow);
-	    xmlReader.setContentHandler(handler); 
-	    xmlReader.parse(new InputSource(reader));
+    XMLReader xmlReader = null;
+    synchronized( mux ) {
+      if ( !xmlReaderMap.containsKey(Thread.currentThread().getId())) {
+        xmlReader = XMLReaderFactory.createXMLReader();
+        xmlReaderMap.put(Thread.currentThread().getId(), xmlReader);
+      } else {
+        xmlReader = (XMLReader) xmlReaderMap.get(Thread.currentThread().getId());
+      }
+    }
+    Reader reader = new StringReader(anXmlStr);
+    XmiCasDeserializer deser = new XmiCasDeserializer(aCAS.getTypeSystem());
+    ContentHandler handler = deser.getXmiCasHandler(aCAS, aLenient, aSharedData, aMergePoint,
allow);
+    xmlReader.setContentHandler(handler); 
+    xmlReader.parse(new InputSource(reader));
 	}
   /** Utility method for deserializing a CAS from a binary */
-  public static void deserializeCasFromBinary(byte[] binarySource, CAS aCAS) throws Exception
+  public void deserializeCasFromBinary(byte[] binarySource, CAS aCAS) throws Exception
   {
     ByteArrayInputStream fis = null;
     try
@@ -218,7 +238,7 @@
     }
   }
 
-  public static byte[] serializeCasToBinary(CAS aCAS) throws Exception
+  public byte[] serializeCasToBinary(CAS aCAS) throws Exception
   {
     ByteArrayOutputStream fos = null;
     try
@@ -239,7 +259,9 @@
       }
     }
   }
-
-
-	
+  
+  public void reset() {
+    xmlReaderMap.clear();
+  }
 }	
+

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java?rev=703879&r1=703878&r2=703879&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
(original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
Sun Oct 12 14:20:03 2008
@@ -304,23 +304,6 @@
 			// Checkout an instance of AE from the pool
 			ae = aeInstancePool.checkout();
 			
-			if ( ae == null )
-			{
-				//	This block just logs the CAS that cannot be processed 
-				try
-				{
-				  XmiSerializationSharedData serSharedData = new XmiSerializationSharedData();
-				  String  serializedCas = UimaSerializer.serializeCasToXmi(aCAS, serSharedData);
-				  UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINEST, getClass().getName(), "process",
UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_dump_cas__FINEST", new Object[] { serializedCas
});
-		        }
-				catch( Exception e )
-				{
-					//	ignore exceptions. This block just logs the CAS
-				}
-				  UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(), "process",
UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_dropping_cas_dueto_no_ae__WARNING", new
Object[] { getComponentName(), aCasReferenceId});
-				
-				return;
-			}
 			//	Get input CAS entry from the InProcess cache
 			CacheEntry inputCASEntry = getInProcessCache().getCacheEntryForCAS(aCasReferenceId);
 

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/HandlerBase.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/HandlerBase.java?rev=703879&r1=703878&r2=703879&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/HandlerBase.java
(original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/HandlerBase.java
Sun Oct 12 14:20:03 2008
@@ -375,11 +375,5 @@
 				aggregateDelegateStats( aMessageContext, aCasReferenceId );
 			}			
 	}
-  protected void deserialize( byte[] data, CAS cas ) 
-  throws Exception
-  {
-    UimaSerializer.deserializeCasFromBinary(data, cas);
-  }
-
 
 }

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java?rev=703879&r1=703878&r2=703879&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java
(original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java
Sun Oct 12 14:20:03 2008
@@ -48,7 +48,8 @@
 {
 	private static final Class CLASS_NAME = ProcessRequestHandler_impl.class;
 	private Object mux = new Object();
-	
+  private UimaSerializer uimaSerializer = new UimaSerializer();
+
 	public ProcessRequestHandler_impl(String aName)
 	{
 		super(aName);
@@ -163,7 +164,8 @@
 	    //  Fetch serialized CAS from the message
 	    String xmi = aMessageContext.getStringMessage();
 	    deserSharedData = new XmiSerializationSharedData();
-	    UimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
+//      UimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
+      uimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
 	    // *************************************************************************
 	    // Check and set up for Delta CAS reply
 	    // *************************************************************************
@@ -188,7 +190,8 @@
 	    // ************************************************************************* 
 	    //CacheEntry entry = getController().getInProcessCache().register(cas, aMessageContext,
deserSharedData, casReferenceId);
 	    byte[] binarySource = aMessageContext.getByteMessage();
-	    UimaSerializer.deserializeCasFromBinary(binarySource, cas);
+//      UimaSerializer.deserializeCasFromBinary(binarySource, cas);
+      uimaSerializer.deserializeCasFromBinary(binarySource, cas);
 	    entry = getController().getInProcessCache().register(cas, aMessageContext, deserSharedData,
casReferenceId );
 	  }
 		long timeToDeserializeCAS = getController().getCpuTime() - t1;
@@ -659,7 +662,8 @@
 		                new Object[] { aMessageContext.getEndpoint().getEndpoint() });
 
 				XmiSerializationSharedData deserSharedData = new XmiSerializationSharedData();
-				UimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
+//        UimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
+        uimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
 				
 				if (casReferenceId == null)
 				{

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java?rev=703879&r1=703878&r2=703879&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java
(original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java
Sun Oct 12 14:20:03 2008
@@ -55,7 +55,8 @@
 	private static final Class CLASS_NAME = ProcessResponseHandler.class;
 
 	private Object monitor = new Object();
-
+  private UimaSerializer uimaSerializer = new UimaSerializer();
+  
 	public ProcessResponseHandler(String aName)
 	{
 		super(aName);
@@ -253,7 +254,8 @@
 			  String serializationStrategy = endpointWithTimer.getSerializer();
 			  if ( serializationStrategy.equals("binary")) {
 			   byte[] binaryData = aMessageContext.getByteMessage();
-			   UimaSerializer.deserializeCasFromBinary(binaryData, cas);
+//         UimaSerializer.deserializeCasFromBinary(binaryData, cas);
+         uimaSerializer.deserializeCasFromBinary(binaryData, cas);
 			  }  else {
 	        //  Processing a reply from a standard, non-parallel delegate
 	        if (aMessageContext.getMessageBooleanProperty(AsynchAEMessage.SentDeltaCas)) {
@@ -321,7 +323,8 @@
 	{
 		XmiSerializationSharedData deserSharedData;
 		deserSharedData = getController().getInProcessCache().getCacheEntryForCAS(casReferenceId).getDeserSharedData();
-		UimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, highWaterMark, allow);
+//    UimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, highWaterMark,
allow);
+    uimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, highWaterMark,
allow);
 	}
 	/**
 	private void deserialize( String xmi, CAS cas, String casReferenceId, int highWaterMark
) throws Exception
@@ -341,7 +344,8 @@
 			deserSharedData = new XmiSerializationSharedData();
 			entry.setXmiSerializationData(deserSharedData);
 		}
-		UimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
+//    UimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
+    uimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
 	}
 	
 	

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java?rev=703879&r1=703878&r2=703879&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java
(original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java
Sun Oct 12 14:20:03 2008
@@ -160,6 +160,8 @@
 	protected UimaASClientInfoMBean clientSideJmxStats =
 		new UimaASClientInfo();
 	
+  private UimaSerializer uimaSerializer = new UimaSerializer();
+
 	protected List pendingMessageList = new ArrayList();
 	protected volatile boolean producerInitialized;
 	abstract public String getEndPointName() throws Exception;
@@ -198,14 +200,14 @@
 	 */
 	protected String serializeCAS(CAS aCAS,  XmiSerializationSharedData serSharedData) throws
Exception
 	{
-		return UimaSerializer.serializeCasToXmi(aCAS, serSharedData);
+		return uimaSerializer.serializeCasToXmi(aCAS, serSharedData);
 
 	}
 	
 	protected String serializeCAS(CAS aCAS) throws Exception
 	{
 		XmiSerializationSharedData serSharedData  = new XmiSerializationSharedData();
-		return UimaSerializer.serializeCasToXmi(aCAS, serSharedData);
+		return uimaSerializer.serializeCasToXmi(aCAS, serSharedData);
 	}
 
 	public void removeStatusCallbackListener(UimaASStatusCallbackListener aListener)
@@ -299,7 +301,7 @@
 		}
 
 		running = false;
-		
+		uimaSerializer.reset();
 		try
 		{
 			//	Unblock threads
@@ -555,7 +557,7 @@
 	        requestToCache.setXmiSerializationSharedData(serSharedData);
 	      }
 			} else {
-        byte[] serializedCAS = UimaSerializer.serializeCasToBinary(aCAS);
+        byte[] serializedCAS = uimaSerializer.serializeCasToBinary(aCAS);
         msg.put( AsynchAEMessage.CAS, serializedCAS);
         if (remoteService)
         {
@@ -1148,16 +1150,16 @@
 	private CAS deserialize(String aSerializedCAS, CAS aCAS ) throws Exception
 	{
 		XmiSerializationSharedData deserSharedData = new XmiSerializationSharedData();
-		UimaSerializer.deserializeCasFromXmi(aSerializedCAS, aCAS, deserSharedData, true, -1);
+    uimaSerializer.deserializeCasFromXmi(aSerializedCAS, aCAS, deserSharedData, true, -1);
 		return aCAS;
 	}
 	
 	private CAS deserialize(String aSerializedCAS, CAS aCAS, XmiSerializationSharedData deserSharedData,
boolean deltaCas ) throws Exception
 	{
 		if (deltaCas) {
-		  UimaSerializer.deserializeCasFromXmi(aSerializedCAS, aCAS, deserSharedData, true, deserSharedData.getMaxXmiId(),
AllowPreexistingFS.allow);
+      uimaSerializer.deserializeCasFromXmi(aSerializedCAS, aCAS, deserSharedData, true, deserSharedData.getMaxXmiId(),
AllowPreexistingFS.allow);
 		} else {
-		  UimaSerializer.deserializeCasFromXmi(aSerializedCAS, aCAS, deserSharedData, true, -1);
+      uimaSerializer.deserializeCasFromXmi(aSerializedCAS, aCAS, deserSharedData, true, -1);
 		}
 		return aCAS;
 	}
@@ -1165,7 +1167,7 @@
   private CAS deserialize(byte[] binaryData, ClientRequest cachedRequest) throws Exception
   {
     CAS cas = cachedRequest.getCAS();
-    UimaSerializer.deserializeCasFromBinary(binaryData, cas);
+    uimaSerializer.deserializeCasFromBinary(binaryData, cas);
     return cas;
   }
 	
@@ -1178,13 +1180,13 @@
   protected CAS deserializeCAS(byte[] aSerializedCAS, ClientRequest cachedRequest) throws
Exception
   {
     CAS cas = cachedRequest.getCAS();
-    UimaSerializer.deserializeCasFromBinary(aSerializedCAS, cas);
+    uimaSerializer.deserializeCasFromBinary(aSerializedCAS, cas);
     return cas;
   }
 
   protected CAS deserializeCAS(byte[] aSerializedCAS, CAS aCas) throws Exception
   {
-    UimaSerializer.deserializeCasFromBinary(aSerializedCAS, aCas);
+    uimaSerializer.deserializeCasFromBinary(aSerializedCAS, aCas);
     return aCas;
   }
 
@@ -1201,7 +1203,7 @@
   protected CAS deserializeCAS(byte[] aSerializedCAS, String aCasPoolName ) throws Exception
   {
     CAS cas = asynchManager.getNewCas(aCasPoolName);
-    UimaSerializer.deserializeCasFromBinary(aSerializedCAS, cas);
+    uimaSerializer.deserializeCasFromBinary(aSerializedCAS, cas);
     return cas;
   }
 



Mime
View raw message