You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by al...@apache.org on 2007/03/14 19:04:27 UTC

svn commit: r518249 - in /incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/collection/metadata: CpeCasProcessor.java CpeComponentDescriptor.java

Author: alally
Date: Wed Mar 14 11:04:26 2007
New Revision: 518249

URL: http://svn.apache.org/viewvc?view=rev&rev=518249
Log:
Add CPE Descriptor support for <import>.
UIMA-341: http://issues.apache.org/jira/browse/UIMA-341


Modified:
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/collection/metadata/CpeCasProcessor.java
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/collection/metadata/CpeComponentDescriptor.java

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/collection/metadata/CpeCasProcessor.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/collection/metadata/CpeCasProcessor.java?view=diff&rev=518249&r1=518248&r2=518249
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/collection/metadata/CpeCasProcessor.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/collection/metadata/CpeCasProcessor.java Wed Mar 14 11:04:26 2007
@@ -55,6 +55,7 @@
    * @param aDescriptor -
    *          descriptor path
    * @throws CpeDescriptorException
+   * @deprecated Doesn't support the new import syntax.  Use setCpeComponentDescriptor() instead.
    */
   public void setDescriptor(String aDescriptor) throws CpeDescriptorException;
 
@@ -62,10 +63,26 @@
    * Returns CasProcessor descriptor.
    * 
    * @return descriptor
+   * @deprecated Doesn't support the new import syntax.  Use getCpeComponentDescriptor().findAbsoluteUrl() instead.
    */
   public String getDescriptor();
 
-  // public CpeComponentDescriptor getCpeComponentDescriptor();
+  /**
+   * Returns the {@link CpeComponentDescriptor} instance associated with this Cas Processor. That
+   * object contains a path to the component descriptor.
+   * 
+   * @return {@link CpeComponentDescriptor} instance
+   */
+  public CpeComponentDescriptor getCpeComponentDescriptor();
+
+  /**
+   * Sets the {@link CpeComponentDescriptor} instance associated with this Cas Processor. That
+   * object contains a path to the component descriptor.
+   * 
+   * @param aDescriptor {@link CpeComponentDescriptor} instance
+   * @throws CpeDescriptorException 
+   */ 
+  public void setCpeComponentDescriptor(CpeComponentDescriptor aDescriptor) throws CpeDescriptorException;
 
   /**
    * Returns CasProcessor deployment type. Three types are currently supported:

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/collection/metadata/CpeComponentDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/collection/metadata/CpeComponentDescriptor.java?view=diff&rev=518249&r1=518248&r2=518249
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/collection/metadata/CpeComponentDescriptor.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/collection/metadata/CpeComponentDescriptor.java Wed Mar 14 11:04:26 2007
@@ -19,6 +19,11 @@
 
 package org.apache.uima.collection.metadata;
 
+import java.net.URL;
+
+import org.apache.uima.resource.ResourceConfigurationException;
+import org.apache.uima.resource.ResourceManager;
+import org.apache.uima.resource.metadata.Import;
 import org.apache.uima.resource.metadata.MetaDataObject;
 
 /**
@@ -42,4 +47,38 @@
    * @return {@link org.apache.uima.collection.metadata.CpeInclude}
    */
   public CpeInclude getInclude();
+  
+  /** 
+   * Gets the Import object that declares where the component descriptor is located.
+   * Import objects support locating the component descriptor either using a
+   * path that's relative to the CPE descriptor's location ("import by location")
+   * or using the classpath/datapath ("import by name").
+   * 
+   * @return the import, null if none
+   */
+  public Import getImport();
+  
+  /** 
+   * Sets the Import object that declares where the component descriptor is located.
+   * Import objects support locating the component descriptor either using a
+   * path that's relative to the CPE descriptor's location ("import by location")
+   * or using the classpath/datapath ("import by name").
+   * 
+   * @param aImport the import, null if none
+   */
+  public void setImport(Import aImport);
+  
+  /**
+   * Returns the absolute URL where the component descriptor is located.  This will use either the
+   * include or import property, whichever is specified.
+   * 
+   * @param aResourceManager
+   *          resource manager to use to do import-by-name lookups
+   * 
+   * @return the absolute URL of the component descriptor
+   * 
+   * @throws ResourceConfiguration
+   *           if an import could not be resolved
+   */
+  public URL findAbsoluteUrl(ResourceManager aResourceManager) throws ResourceConfigurationException;  
 }