org.apache.uima.tools.pear.merger
Class PMController

java.lang.Object
  extended by org.apache.uima.tools.pear.merger.PMController

public class PMController
extends java.lang.Object

The PMController class allows to merge several input PEAR files in one PEAR file and generate an aggregate analysis engine from the components encapsulated in the input PEARs.

See Also:
PMControllerHelper, PMUimaAgent

Constructor Summary
PMController(java.io.File[] inpPearFiles, java.lang.String outCompName, java.io.File outPearFile)
          Constructor that takes a given array of input PEAR files, a given output component name (ID) and a given output PEAR file.
 
Method Summary
 void cleanUp()
          Deletes all temporary directories and files after the merging operation is completed.
static java.util.logging.Logger getLogger()
          Returns the instance of the class-specific Logger object.
static void logErrorMessage(java.lang.String message)
          Logs a given error message to the log file and prints it to the standard error console stream.
static void logInfoMessage(java.lang.String message)
          Logs a given info message to the log file and prints it to the standard output console stream.
static void logWarningMessage(java.lang.String message)
          Logs a given warning message to the log file and prints it to the standard error console stream.
static void main(java.lang.String[] args)
          The command line application entry point.
 boolean mergePears()
          Merges specified input PEARs into one PEAR, which encapsulates aggregate AE that refers to input components, as delegates.
static void setLogFileEnabled(boolean enable)
          Enables/disables PM log file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PMController

public PMController(java.io.File[] inpPearFiles,
                    java.lang.String outCompName,
                    java.io.File outPearFile)
             throws java.io.IOException
Constructor that takes a given array of input PEAR files, a given output component name (ID) and a given output PEAR file.

Parameters:
inpPearFiles - The given array of input PEAR files.
outCompName - The given output component name (ID).
outPearFile - The given output PEAR file.
Throws:
java.io.IOException - If any I/O exception occurred during initialization.
Method Detail

main

public static void main(java.lang.String[] args)
The command line application entry point. This method expects the following command line arguments:

Parameters:
args - pear_file_1 ... pear_file_n -n agg_name [-f agg_pear_file]

getLogger

public static java.util.logging.Logger getLogger()
Returns the instance of the class-specific Logger object.

Returns:
The instance of the class-specific Logger object.

logErrorMessage

public static void logErrorMessage(java.lang.String message)
Logs a given error message to the log file and prints it to the standard error console stream.

Parameters:
message - The given error message.

logInfoMessage

public static void logInfoMessage(java.lang.String message)
Logs a given info message to the log file and prints it to the standard output console stream.

Parameters:
message - The given info message.

logWarningMessage

public static void logWarningMessage(java.lang.String message)
Logs a given warning message to the log file and prints it to the standard error console stream.

Parameters:
message - The given warning message.

setLogFileEnabled

public static void setLogFileEnabled(boolean enable)
Enables/disables PM log file. By default, the log file is disabled.

Parameters:
enable - if true, the log file is enabled, otherwise it is disabled.

cleanUp

public void cleanUp()
             throws java.io.IOException
Deletes all temporary directories and files after the merging operation is completed.

Throws:
java.io.IOException - If an I/O exception occurred.

mergePears

public boolean mergePears()
                   throws java.io.IOException
Merges specified input PEARs into one PEAR, which encapsulates aggregate AE that refers to input components, as delegates. Returns true, if the merging operation completed successfully, false otherwise.

Returns:
true, if the merge operation completed successfully, false otherwise.
Throws:
java.io.IOException - If an I/O exception occurred during the merging operation.


Copyright © 2011. All Rights Reserved.