Methods Summary |
---|
public void | deploy(javax.enterprise.deploy.spi.TargetModuleID targetModuleID)Deploy a given module
// get the server deploydir
String deployDir = getDeploydir();
FileOutputStream outs = null;
FileInputStream ins = null;
try
{
File deployableFile = new File(targetModuleID.getModuleID());
File targetFile = new File(deployDir + "/" + deployableFile.getName());
log.info("Writing deployableFile: " + deployableFile.getAbsolutePath() + " to: " + targetFile.getAbsolutePath());
outs = new FileOutputStream(targetFile);
ins = new FileInputStream(deployableFile);
JarUtils.copyStream(outs, ins);
log.info("Waiting 10 seconds for deploy to finish...");
Thread.sleep(10000);
}
finally
{
try
{
if (outs != null)
{
outs.close();
}
if (ins != null)
{
ins.close();
}
}
catch (IOException e)
{
// ignore this one
}
}
|
public javax.enterprise.deploy.spi.TargetModuleID[] | getAvailableModules(javax.enterprise.deploy.shared.ModuleType moduleType)Retrieve the list of all J2EE application modules running or not running on the identified targets.
return null;
|
private java.lang.String | getDeploydir()Get the server deploydir
//[todo] replace this System property lookup
String deployDir = System.getProperty("jboss.deploy.dir");
if (deployDir == null)
{
String j2eeHome = System.getProperty("J2EE_HOME");
if (j2eeHome == null)
throw new RuntimeException("Cannot obtain system property: jboss.deploy.dir or J2EE_HOME");
deployDir = j2eeHome + "/server/cts/deploy";
}
log.info("Using deploy dir: " + deployDir);
return deployDir;
|
public java.lang.String | getDescription()Get the target's description
return "JBoss localhost deployment target";
|
public java.lang.String | getHostName()Get the target's host name
try
{
return InetAddress.getLocalHost().getHostName();
}
catch (UnknownHostException e)
{
log.error("Cannot obtain localhost", e);
return null;
}
|
public java.lang.String | getName()Get the target's name
return "localhost";
|
public void | start(javax.enterprise.deploy.spi.TargetModuleID targetModuleID)Start a given module
|
public void | stop(javax.enterprise.deploy.spi.TargetModuleID targetModuleID)Stop a given module
|
public void | undeploy(javax.enterprise.deploy.spi.TargetModuleID targetModuleID)Undeploy a given module
// get the server deploydir
String deployDir = getDeploydir();
File file = new File(deployDir + "/" + targetModuleID.getModuleID());
file.delete();
|