com.phenix.pct
Class PCT

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.phenix.pct.PCT
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
PCTBgRun, PCTBinaryDump, PCTBinaryLoad, PCTBroker, PCTCreateBase, PCTLibrary, PCTProxygen, PCTRun, PCTXCode, ProgressVersion

public abstract class PCT
extends org.apache.tools.ant.Task

Base class for creating tasks involving Progress. It does basic work on guessing where various bin/java/etc are located.

Version:
$Revision$
Author:
Gilles QUERRET

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
PCT()
           
 
Method Summary
 void addEnv(org.apache.tools.ant.types.Environment.Variable var)
          Add an environment variable to the launched process.
protected  void checkDlcHome()
           
protected static void deleteDirectory(File directory)
          Deletes a directory recursively.
protected static String escapeString(String str)
          Escapes a string so it does not accidentally contain Progress escape characters
abstract  void execute()
          This method has to be overridden
protected  File extractPL()
          Deprecated. PCT 0.11 Use extractPL(File) instead
protected  boolean extractPL(File f)
          Extracts pct.pl from PCT.jar into a file, and returns true if the operation was OK Automatically extract v9 or v10 PL
protected  File getDlcBin()
          Returns Progress executables directory
protected  File getDlcHome()
          Returns Progress installation directory
protected  String getDLCMaintenanceVersion()
          Returns maintenance version
protected  int getDLCMajorVersion()
          Returns major version number
protected  int getDLCMinorVersion()
          Returns minor version number
protected  String getDLCPatchLevel()
          Returns patch level string
protected  String getDLCRevision()
          Deprecated. Use getDLCMaintenanceVersion() instead
protected  org.apache.tools.ant.types.Environment getEnvironment()
           
protected  File getExecPath(String exec)
          Returns a Progress executable path
protected  String getFullVersion()
          Returns full version string
protected  boolean getIncludedPL()
          Use default pct.pl included in JAR file into PROPATH
protected  org.apache.tools.ant.types.FileSet getJavaFileset()
          Deprecated. Since 0.11, use getJavaFileset(Project) instead
protected  org.apache.tools.ant.types.FileSet getJavaFileset(org.apache.tools.ant.Project p)
          Returns a fileset containing every JAR/ZIP files needed for proxygen task
protected  ProgressProcedures getProgressProcedures()
          Returns an instance of ProgressProcedure
protected  long getRCodeVersion()
          Returns r-code version
protected  String getReducedVersion()
          Returns reduced version
protected  boolean isSourceCodeUsed()
           
protected static int nextRandomInt()
           
 void setDlcBin(File dlcBin)
          Progress binary directory
 void setDlcHome(File dlcHome)
          Progress installation directory
 void setDlcJava(File dlcJava)
          Progress java directory
 void setIncludedPL(boolean inc)
          Add default pct.pl included in JAR file into PROPATH.
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PCT

public PCT()
Method Detail

setDlcHome

public final void setDlcHome(File dlcHome)
Progress installation directory

Parameters:
dlcHome - File

setDlcBin

public final void setDlcBin(File dlcBin)
Progress binary directory

Parameters:
dlcBin - File
Since:
0.3

setDlcJava

public final void setDlcJava(File dlcJava)
Progress java directory

Parameters:
dlcJava - File
Since:
0.3

setIncludedPL

public final void setIncludedPL(boolean inc)
Add default pct.pl included in JAR file into PROPATH. Default value is true.

Parameters:
inc -
Since:
0.10

addEnv

public final void addEnv(org.apache.tools.ant.types.Environment.Variable var)
Add an environment variable to the launched process.

Parameters:
var - new environment variable.

getEnvironment

protected final org.apache.tools.ant.types.Environment getEnvironment()

getIncludedPL

protected final boolean getIncludedPL()
Use default pct.pl included in JAR file into PROPATH

Returns:
boolean
Since:
0.10

getDlcHome

protected final File getDlcHome()
Returns Progress installation directory

Returns:
File

getDlcBin

protected final File getDlcBin()
Returns Progress executables directory

Returns:
File
Since:
0.3b

getExecPath

protected final File getExecPath(String exec)
Returns a Progress executable path

Parameters:
exec - String
Returns:
File

getJavaFileset

protected org.apache.tools.ant.types.FileSet getJavaFileset()
Deprecated. Since 0.11, use getJavaFileset(Project) instead

Returns a fileset containing every JAR/ZIP files needed for proxygen task

Returns:
FileSet
Since:
0.8

getJavaFileset

protected org.apache.tools.ant.types.FileSet getJavaFileset(org.apache.tools.ant.Project p)
Returns a fileset containing every JAR/ZIP files needed for proxygen task

Parameters:
p - Project
Returns:
FileSet
Since:
0.11

getProgressProcedures

protected ProgressProcedures getProgressProcedures()
Returns an instance of ProgressProcedure

Since:
0.12

execute

public abstract void execute()
                      throws org.apache.tools.ant.BuildException
This method has to be overridden

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException

checkDlcHome

protected void checkDlcHome()

extractPL

protected File extractPL()
                  throws IOException
Deprecated. PCT 0.11 Use extractPL(File) instead

Extracts pct.pl from PCT.jar into a temporary file, and returns a handle on the file. Automatically extract v9 or v10 PL

Returns:
Handle on pct.pl (File)
Throws:
IOException
Since:
PCT 0.10

isSourceCodeUsed

protected boolean isSourceCodeUsed()

extractPL

protected boolean extractPL(File f)
                     throws IOException
Extracts pct.pl from PCT.jar into a file, and returns true if the operation was OK Automatically extract v9 or v10 PL

Parameters:
f - File or directory (must not be present)
Returns:
Boolean
Throws:
IOException
Since:
PCT 0.10

getDLCMajorVersion

protected int getDLCMajorVersion()
Returns major version number

Returns:
10.0B02 returns 10

getDLCMinorVersion

protected int getDLCMinorVersion()
Returns minor version number

Returns:
10.0B02 returns 0

getDLCRevision

protected String getDLCRevision()
Deprecated. Use getDLCMaintenanceVersion() instead


getDLCMaintenanceVersion

protected String getDLCMaintenanceVersion()
Returns maintenance version

Returns:
10.0B02 returns B
Since:
PCT 0.17

getDLCPatchLevel

protected String getDLCPatchLevel()
Returns patch level string

Returns:
10.0B02 returns 02

getFullVersion

protected String getFullVersion()
Returns full version string

Returns:
10.0B02 as of Dec 12 1998

getReducedVersion

protected String getReducedVersion()
Returns reduced version

Returns:
10.0B02 for example

getRCodeVersion

protected long getRCodeVersion()
Returns r-code version

Returns:
Long (1005 for 10.1B 32 bits for example)

escapeString

protected static String escapeString(String str)
Escapes a string so it does not accidentally contain Progress escape characters

Parameters:
str - the input string
Returns:
the escaped string

nextRandomInt

protected static final int nextRandomInt()

deleteDirectory

protected static void deleteDirectory(File directory)
                               throws IOException
Deletes a directory recursively.

Parameters:
directory - directory to delete
Throws:
IOException - in case deletion is unsuccessful


Copyright © 2003-2011 Gilles QUERRET. All Rights Reserved.