|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.as400.util.AS400ClassPathOptimizer
This class is used to optimize an AS400 classpath using the CRTJVAPGM command. The original need was a software update/install procedure that needed to make sure all the classes in the classpath were optimized at the appropriate levels. We needed something that didn't recompile classes if they were already optimized, as our app was large (over 10MB) and it could take several hours and LOTS of cpu to optimize at level 40. We needed something that did "touch up" optimizations. Here is an example of how you can use it...
public static void main(String args[]) throws Exception { String classpath = "/home/toronto/DEV/:/home/toronto/DEV/server.jar:" + "/home/toronto/DEV/preprocessor.jar:/qibm/ProdData/HTTP/Public/jt400/lib/jt400.jar:" + "/qibm/proddata/java400/jt400ntv.jar:/home/toronto/DEV/collections.jar:" + "/home/toronto/DEV/antlr.jar:/home/toronto/DEV/crimson.jar:/home/toronto/DEV/xalan.jar:" + "/home/toronto/DEV/jaxp.jar:"; AS400 as400 = new AS400( "mysystem", "user", "password" ); AS400ClassPathOptimizer cpo = new AS400ClassPathOptimizer( as400, classpath ); cpo.setOptimizationLevel( cpo.LEVEL_40 ); cpo.setLicensedInternalCodeOptions( cpo.LICOPT_NOPRERESOLVEEXTREF ); // submit the optimizations and exit since this could take some time cpo.setOptimizeInParallel( true ); // so we can see the details of what it is doing... cpo.setOutputLog( System.out ); // submit the optimizations cpo.optimize(); System.exit( 0 ); }
Field Summary | |
---|---|
static int |
LEVEL_10
|
static int |
LEVEL_20
|
static int |
LEVEL_30
|
static int |
LEVEL_40
|
static String |
LICOPT_NOPRERESOLVEEXTREF
|
static int |
NO_OPTIMIZATION
|
Constructor Summary | |
---|---|
AS400ClassPathOptimizer()
|
|
AS400ClassPathOptimizer(AS400 as400)
|
|
AS400ClassPathOptimizer(AS400 as400,
String classpath)
|
Method Summary | |
---|---|
String |
getLicensedInternalCodeOptions()
|
boolean |
isOptimizeInParallel()
|
boolean |
isWaitForOptimizations()
|
void |
optimize()
|
void |
run()
|
void |
setAS400(AS400 as400)
|
void |
setClasspath(String classpath)
set the AS400 classpath to opimize. |
void |
setLicensedInternalCodeOptions(String s)
Sets the value to use on the CRTJVAPGM LICOPT parameter |
void |
setOptimizationLevel(int level)
Set the level to optimize classes to. |
void |
setOptimizeDirectories(boolean b)
|
void |
setOptimizeInParallel(boolean s)
if true run each CRTJVAPGM in a separate job. |
void |
setOutputLog(PrintStream out)
|
void |
setWaitForOptimizations(boolean s)
if true the optimize() method will wait for all CRTJVAPGM commands to end before it returns. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NO_OPTIMIZATION
public static final int LEVEL_10
public static final int LEVEL_20
public static final int LEVEL_30
public static final int LEVEL_40
public static final String LICOPT_NOPRERESOLVEEXTREF
Constructor Detail |
public AS400ClassPathOptimizer()
public AS400ClassPathOptimizer(AS400 as400)
public AS400ClassPathOptimizer(AS400 as400, String classpath)
Method Detail |
public void setClasspath(String classpath)
public void setAS400(AS400 as400)
public void setWaitForOptimizations(boolean s)
public boolean isWaitForOptimizations()
public void setOptimizeInParallel(boolean s)
public void setOptimizeDirectories(boolean b)
public boolean isOptimizeInParallel()
public String getLicensedInternalCodeOptions()
public void setLicensedInternalCodeOptions(String s)
public void setOptimizationLevel(int level)
public void setOutputLog(PrintStream out)
public void optimize() throws Exception
Exception
public void run() throws Exception
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |