com.sun.faban.harness.util
Class DeployUtil

java.lang.Object
  extended by com.sun.faban.harness.util.DeployUtil

public class DeployUtil
extends Object

Benchmark deployment utility used to check/generate the deployment descriptors, check proper deployment of all benchmarks or individual benchmarks, and deploy them if appropriate.

Author:
Akara Sucharitakul

Field Summary
static File BENCHMARKDIR
          The benchmark directory.
static File SERVICEDIR
          The service directory.
 
Constructor Summary
DeployUtil()
           
 
Method Summary
static boolean canDeployBenchmark(String benchName)
          Checks if benchmark can be deployed.
static boolean canDeployService(String serviceName)
          Checks if service can be deployed.
static void checkDeploy()
          Check for any jar files dropped in here.
static void checkDeployBenchmark(File jarFile, String benchName)
          Checks for benchmark deployment.
static void checkDeployService(File jarFile, String serviceName)
          Checks for service deployment.
static void clearConfig(String benchName)
          Clears benchmark's configuration.
static void deployBenchmark(File jarFile, String benchName)
          Deploys a benchmark.
static void deployService(File jarFile, String serviceBundleName)
          Deploys a service.
static void generateDD(String dir)
          This method is responsible for generation the deployment descriptor.
static void generateXform(String dir)
          This method is responsible for generating xform.
static void processUploadedJar(File jarFile, String deployName)
          Processes an uploaded jar file.
static void unjar(File jarFile, String deployName)
          Unjars the content a deployable jar file into the deploy directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BENCHMARKDIR

public static final File BENCHMARKDIR
The benchmark directory.


SERVICEDIR

public static final File SERVICEDIR
The service directory.

Constructor Detail

DeployUtil

public DeployUtil()
Method Detail

unjar

public static void unjar(File jarFile,
                         String deployName)
                  throws IOException
Unjars the content a deployable jar file into the deploy directory.

Parameters:
jarFile - The deployable jar file
deployName - The name of the deployable unit
Throws:
IOException - Error unjaring the jar file.

processUploadedJar

public static void processUploadedJar(File jarFile,
                                      String deployName)
                               throws Exception
Processes an uploaded jar file.

Parameters:
jarFile - The benchmark or service jar file
deployName - The name of the benchmark or service
Throws:
Exception - Error processing the file

generateDD

public static void generateDD(String dir)
                       throws DeployException
This method is responsible for generation the deployment descriptor.

Parameters:
dir - The deployment directory
Throws:
DeployException

generateXform

public static void generateXform(String dir)
                          throws Exception
This method is responsible for generating xform.

Parameters:
dir -
Throws:
Exception

canDeployBenchmark

public static boolean canDeployBenchmark(String benchName)
Checks if benchmark can be deployed.

Parameters:
benchName -
Returns:
boolean

canDeployService

public static boolean canDeployService(String serviceName)
Checks if service can be deployed.

Parameters:
serviceName -
Returns:
boolean

checkDeploy

public static void checkDeploy()
Check for any jar files dropped in here. Deploys if needed.


checkDeployService

public static void checkDeployService(File jarFile,
                                      String serviceName)
Checks for service deployment.

Parameters:
jarFile - The service jar file
serviceName - The service name

checkDeployBenchmark

public static void checkDeployBenchmark(File jarFile,
                                        String benchName)
Checks for benchmark deployment.

Parameters:
jarFile - The benchmark jar file
benchName - The benchmark name

deployBenchmark

public static void deployBenchmark(File jarFile,
                                   String benchName)
Deploys a benchmark.

Parameters:
jarFile - The benchmark jar file
benchName - The benchmark name

deployService

public static void deployService(File jarFile,
                                 String serviceBundleName)
Deploys a service.

Parameters:
jarFile - The service jar file
serviceBundleName - The service bundle name

clearConfig

public static void clearConfig(String benchName)
Clears benchmark's configuration.

Parameters:
benchName - The banchmark name