uima-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r707732 - in /incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae: UimaSerializer.java handler/input/ProcessRequestHandler_impl.java
Date Fri, 24 Oct 2008 20:25:15 GMT
Author: eae
Date: Fri Oct 24 13:25:15 2008
New Revision: 707732

URL: http://svn.apache.org/viewvc?rev=707732&view=rev
Log:
UIMA-1214

Modified:
    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/handler/input/ProcessRequestHandler_impl.java

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=707732&r1=707731&r2=707732&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
Fri Oct 24 13:25:15 2008
@@ -259,6 +259,28 @@
       }
     }
   }
+
+  public byte[] serializeCasToBinary(CAS aCAS, Marker aMark) throws Exception
+  {
+    ByteArrayOutputStream fos = null;
+    try
+    {
+      fos = new ByteArrayOutputStream();
+      Serialization.serializeCAS(aCAS, fos, aMark);
+      return fos.toByteArray();
+    }
+    catch( Exception e)
+    {
+      throw e;
+    }
+    finally
+    {
+      if ( fos != null)
+      {
+        fos.close();
+      }
+    }
+  }
   
   public void reset() {
     xmlReaderMap.clear();

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=707732&r1=707731&r2=707732&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
Fri Oct 24 13:25:15 2008
@@ -175,22 +175,6 @@
 	    deserSharedData = new XmiSerializationSharedData();
 //      UimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
       uimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
-	    // *************************************************************************
-	    // Check and set up for Delta CAS reply
-	    // *************************************************************************
-	    boolean acceptsDeltaCas = false;
-	    Marker marker = null;
-	    if (aMessageContext.propertyExists(AsynchAEMessage.AcceptsDeltaCas)) {
-	        acceptsDeltaCas = aMessageContext.getMessageBooleanProperty(AsynchAEMessage.AcceptsDeltaCas);
-	        if (acceptsDeltaCas ) {
-	         marker = cas.createMarker();
-	        }
-	    }
-	    // ************************************************************************* 
-	    //  Register the CAS with a local cache
-	    // ************************************************************************* 
-	    //CacheEntry entry = getController().getInProcessCache().register(cas, aMessageContext,
deserSharedData, casReferenceId);
-	    entry = getController().getInProcessCache().register(cas, aMessageContext, deserSharedData,
casReferenceId, marker, acceptsDeltaCas);
 	  }
 	  else if ( serializationStrategy.equals("binary"))
 	  {
@@ -201,9 +185,26 @@
 	    byte[] binarySource = aMessageContext.getByteMessage();
 //      UimaSerializer.deserializeCasFromBinary(binarySource, cas);
       uimaSerializer.deserializeCasFromBinary(binarySource, cas);
-	    entry = getController().getInProcessCache().register(cas, aMessageContext, deserSharedData,
casReferenceId );
 	  }
-		long timeToDeserializeCAS = getController().getCpuTime() - t1;
+
+    // *************************************************************************
+    // Check and set up for Delta CAS reply
+    // *************************************************************************
+    boolean acceptsDeltaCas = false;
+    Marker marker = null;
+    if (aMessageContext.propertyExists(AsynchAEMessage.AcceptsDeltaCas)) {
+        acceptsDeltaCas = aMessageContext.getMessageBooleanProperty(AsynchAEMessage.AcceptsDeltaCas);
+        if (acceptsDeltaCas ) {
+         marker = cas.createMarker();
+        }
+    }
+    // ************************************************************************* 
+    //  Register the CAS with a local cache
+    // ************************************************************************* 
+    //CacheEntry entry = getController().getInProcessCache().register(cas, aMessageContext,
deserSharedData, casReferenceId);
+    entry = getController().getInProcessCache().register(cas, aMessageContext, deserSharedData,
casReferenceId, marker, acceptsDeltaCas);
+
+    long timeToDeserializeCAS = getController().getCpuTime() - t1;
 		getController().incrementDeserializationTime(timeToDeserializeCAS);
 		LongNumericStatistic statistic;
 		if ( (statistic = getController().getMonitor().getLongNumericStatistic("",Monitor.TotalDeserializeTime))
!= null )



Mime
View raw message