Class PMUimaAgent


  • public class PMUimaAgent
    extends java.lang.Object
    The PMUimaAgent class implements UIMA-based utility methods utilized by the PMController class. The class allows generating analysis engine descriptor for output aggregate AE based on the specified input descriptors.
    • Constructor Summary

      Constructors 
      Constructor Description
      PMUimaAgent()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static AnalysisEngineDescription createAggregateDescription​(java.lang.String aggCompName, java.io.File aggRootDir, InstallationDescriptor[] dlgInstDescs)
      Creates UIMA aggregate analysis engine description object, based on given aggregate component name (ID), aggregate root directory and array of delegate installation descriptors.
      private static Capability[] mergeCapabilities​(java.util.ArrayList allCapabilities, ResourceSpecifierFactory rsFactory)
      Merges source Capability objects specified in a given ArrayList, creating one Capability object that contains all non-duplicated inputs and outputs of the source Capability objects.
      private static ResourceSpecifier retrieveDelegateSpecifier​(java.io.File aggRootDir, InstallationDescriptor dlgInstDesc)
      Creates ResourceSpecifier object for a delegate component descriptor, specified by a given InstallationDescriptor object.
      (package private) static void saveAggregateDescription​(AnalysisEngineDescription aggDescription, java.io.File aggDescFile)
      Saves a given UIMA aggregate component desciption in a specified XML descriptor file.
      (package private) static java.lang.String toXmlString​(XMLizable content)
      Converts a given XMLizable object to String.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PMUimaAgent

        public PMUimaAgent()
    • Method Detail

      • createAggregateDescription

        static AnalysisEngineDescription createAggregateDescription​(java.lang.String aggCompName,
                                                                    java.io.File aggRootDir,
                                                                    InstallationDescriptor[] dlgInstDescs)
        Creates UIMA aggregate analysis engine description object, based on given aggregate component name (ID), aggregate root directory and array of delegate installation descriptors. Returns the UIMA aggregate analysis engine description object.
        Parameters:
        aggCompName - The given aggregate component name (ID).
        aggRootDir - The given aggregate root directory.
        dlgInstDescs - The given array of delegate installation descriptors.
        Returns:
        The UIMA aggregate analysis engine description object.
      • mergeCapabilities

        private static Capability[] mergeCapabilities​(java.util.ArrayList allCapabilities,
                                                      ResourceSpecifierFactory rsFactory)
        Merges source Capability objects specified in a given ArrayList, creating one Capability object that contains all non-duplicated inputs and outputs of the source Capability objects. Returns an array of Capability objects, containing the merged object.
        Parameters:
        allCapabilities - The given ArrayList of the source Capability objects.
        rsFactory - The ResourceSpecifierFactory object used to create new Capability object.
        Returns:
        Array of Capability objects, containing the merged object.
      • retrieveDelegateSpecifier

        private static ResourceSpecifier retrieveDelegateSpecifier​(java.io.File aggRootDir,
                                                                   InstallationDescriptor dlgInstDesc)
                                                            throws java.io.IOException,
                                                                   InvalidXMLException
        Creates ResourceSpecifier object for a delegate component descriptor, specified by a given InstallationDescriptor object. Returns the delegate component ResourceSpecifier object.
        Parameters:
        aggRootDir - The given aggregate root directory.
        dlgInstDesc - The given delegate InstallationDescriptor object.
        Returns:
        The given delegate component ResourceSpecifier object.
        Throws:
        java.io.IOException - If an I/O exception occurred while creating XML input source.
        InvalidXMLException - If ResourceSpecifier object cannot be created from the specified descriptor.
      • saveAggregateDescription

        static void saveAggregateDescription​(AnalysisEngineDescription aggDescription,
                                             java.io.File aggDescFile)
                                      throws java.io.IOException
        Saves a given UIMA aggregate component desciption in a specified XML descriptor file.
        Parameters:
        aggDescription - The given UIMA aggregate component desciption.
        aggDescFile - The given XML descriptor file.
        Throws:
        java.io.IOException - If an I/O exception occurrs.
      • toXmlString

        static java.lang.String toXmlString​(XMLizable content)
        Converts a given XMLizable object to String. This method is useful for debugging.
        Parameters:
        content - The given XMLizable object
        Returns:
        A String that represents the given XMLizable object.