You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2011/10/17 19:38:58 UTC

svn commit: r1185303 - /uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/resourceSpecifier/factory/DeploymentDescriptorFactory.java

Author: cwiklik
Date: Mon Oct 17 17:38:58 2011
New Revision: 1185303

URL: http://svn.apache.org/viewvc?rev=1185303&view=rev
Log:
UIMA-2250 removed main

Modified:
    uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/resourceSpecifier/factory/DeploymentDescriptorFactory.java

Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/resourceSpecifier/factory/DeploymentDescriptorFactory.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/resourceSpecifier/factory/DeploymentDescriptorFactory.java?rev=1185303&r1=1185302&r2=1185303&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/resourceSpecifier/factory/DeploymentDescriptorFactory.java (original)
+++ uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/resourceSpecifier/factory/DeploymentDescriptorFactory.java Mon Oct 17 17:38:58 2011
@@ -220,106 +220,5 @@ public static RemoteDelegateConfiguratio
   }
   
 
-  /**
-   * The main method.
-   *
-   * @param args the arguments
-   */
-  public static void main(String[] args) {
-  
-	  try {
-		  File file = new File(args[0]);
-		  UimaASDeploymentDescriptor primitiveDD =
-				  DeploymentDescriptorFactory.createDeploymentDescriptor(new FileInputStream(file));  
-		  System.out.println(primitiveDD.toXML());
-		  
-	  } catch( Exception e) {
-		  e.printStackTrace();
-	  }
-    
-	  try {
-		  File file = new File(args[0]);
-		  UimaASDeploymentDescriptor primitiveDD =
-				  DeploymentDescriptorFactory.createDeploymentDescriptor(file);  
-		  System.out.println(primitiveDD.toXML());
-		  
-	  } catch( Exception e) {
-		  e.printStackTrace();
-	  } 
-	  
-    ServiceContext context =
-      new ServiceContextImpl("Person Title", "Person Title Annotator", "../descriptors/analysis_engine/PersonTitleAnnotator.xml","PersonTitleQueue");
-    try {
-      context.setAsync(false);
-      
-      UimaASPrimitiveDeploymentDescriptor primitiveDD = 
-        DeploymentDescriptorFactory.createPrimitiveDeploymentDescriptor(context);
-      primitiveDD.setScaleup(5);
-      System.out.println(primitiveDD.toXML());
-    } catch( ResourceInitializationException e) {
-      e.printStackTrace();
-    }
-    
-    RemoteDelegateConfiguration remoteDelegate = 
-      DeploymentDescriptorFactory.createRemoteDelegateConfiguration("RoomNumber","tcp://localhost:61616","RoomNumberQueue",SerializationStrategy.xmi);
-    GetMetaErrorHandlingSettings getMetaErrorSettings = 
-      DeploymentDescriptorFactory.createGetMetaErrorHandlingSettings(3,300,Action.Terminate);
-    ProcessErrorHandlingSettings processErrorSettings = 
-      DeploymentDescriptorFactory.createProcessErrorHandlingSettings(5,5000,Action.Terminate,true,0,0);
-    CollectionProcessCompleteErrorHandlingSettings cpcErrorSettings = 
-      DeploymentDescriptorFactory.createCollectionProcessCompleteErrorHandlingSettings(1000,Action.Terminate);
-
-    remoteDelegate.setGetMetaErrorHandlingSettings(getMetaErrorSettings);
-    remoteDelegate.setProcessErrorHandlingSettings(processErrorSettings);
-    remoteDelegate.setCollectionProcessCompleteErrorHandlingSettings(cpcErrorSettings);
-    
-    RemoteDelegateConfiguration remoteDelegate2 = 
-      DeploymentDescriptorFactory.
-        createRemoteDelegateConfiguration("RemoteDateTime",
-                                          "tcp://localhost:61616",
-                                          "DateTimeQueue",
-                                          SerializationStrategy.xmi,
-                                          DeploymentDescriptorFactory.createGetMetaErrorHandlingSettings(1,100,Action.Terminate),
-                                          DeploymentDescriptorFactory.createProcessErrorHandlingSettings(2,10000,Action.Terminate,true,0,0));
-
-    DelegateConfiguration colocatedDelegateCM = 
-      DeploymentDescriptorFactory.
-          createPrimitiveDelegateConfiguration("Meeting",
-                                                DeploymentDescriptorFactory.createGetMetaErrorHandlingSettings(1,100,Action.Terminate),
-                                                DeploymentDescriptorFactory.createProcessErrorHandlingSettings(2,10000,Action.Terminate,true,0,0)        
-          );
-    colocatedDelegateCM.setCasMultiplier(true);
-    colocatedDelegateCM.setCasPoolSize(5);
 
-    DelegateConfiguration colocatedDelegate1 = 
-      DeploymentDescriptorFactory.createPrimitiveDelegateConfiguration("AnotherMeeting");
-    colocatedDelegate1.setCasMultiplier(true);
-    
-    DelegateConfiguration colocatedAggregate = 
-      DeploymentDescriptorFactory.createAggregateDelegateConfiguration("DateTimeAggregate", colocatedDelegate1, remoteDelegate);
-    
-    ServiceContext aggregateContext =
-      new ServiceContextImpl("Aggregate Annotator", 
-              "Aggregate Annotator that does nothing", 
-              "C:/uima/releases/apache-uima-as-2.4.0/examples/descriptors/tutorial/ex4/MeetingDetectorTAE.xml",
-              "AggregateQueue");
-    try {
-      UimaASAggregateDeploymentDescriptor dd = 
-        DeploymentDescriptorFactory.createAggregateDeploymentDescriptor(aggregateContext, colocatedDelegateCM, remoteDelegate2, colocatedAggregate);
-      System.out.println(dd.toXML());
-
-      List<DelegateAnalysisEngine> delegates = dd.getDelegates();
-      for( DelegateAnalysisEngine delegate : delegates ) {
-        if ( delegate.isRemote() ) {
-          System.out.println("Delegate:"+delegate.getKey()+" is REMOTE");
-        } else if ( delegate.isAggregate() ) {
-          System.out.println("Delegate:"+delegate.getKey()+" is AGGREGATE");
-        } else {
-          System.out.println("Delegate:"+delegate.getKey()+" is PRIMITIVE");
-        }
-      }
-    } catch( ResourceInitializationException e) {
-      e.printStackTrace();
-    }
-  }
 }