Fields Summary |
---|
protected static final String | DEFAULT_ORBDescription of the Field |
private static final String | JONAS_DEPLOY_CLASS_NAMEThe classname of the tool to run * |
private static final String[] | VALID_ACTIONSAll the valid actions that weblogic.deploy permits * |
private File | jonasrootDescription of the Field |
private String | orbDescription of the Field |
private String | davidHostDescription of the Field |
private int | davidPortDescription of the Field |
Methods Summary |
---|
public org.apache.tools.ant.types.Path | getClasspath()gets the classpath field.
Path aClassPath = super.getClasspath();
if (aClassPath == null) {
aClassPath = new Path(getTask().getProject());
}
if (orb != null) {
String aOrbJar = new File(jonasroot, "lib/" + orb + "_jonas.jar").toString();
String aConfigDir = new File(jonasroot, "config/").toString();
Path aJOnASOrbPath = new Path(aClassPath.getProject(),
aOrbJar + File.pathSeparator + aConfigDir);
aClassPath.append(aJOnASOrbPath);
}
return aClassPath;
|
protected boolean | isActionValid()Determines if the action supplied is valid.
Valid actions are contained in the static array
VALID_ACTIONS
boolean valid = false;
String action = getTask().getAction();
for (int i = 0; i < VALID_ACTIONS.length; i++) {
if (action.equals(VALID_ACTIONS[i])) {
valid = true;
break;
}
}
return valid;
|
public void | setDavidhost(java.lang.String inValue)Set the host for the David ORB; required if
ORB==david.
davidHost = inValue;
|
public void | setDavidport(int inValue)Set the port for the David ORB; required if
ORB==david.
davidPort = inValue;
|
public void | setJonasroot(java.io.File inValue)set the jonas root directory (-Dinstall.root=). This
element is required.
jonasroot = inValue;
|
public void | setOrb(java.lang.String inValue)Choose your ORB : RMI, JEREMIE, DAVID, ...; optional.
If omitted, it defaults
to the one present in classpath. The corresponding JOnAS JAR is
automatically added to the classpath. If your orb is DAVID (RMI/IIOP) you must
specify davidhost and davidport properties.
orb = inValue;
|
public void | validateAttributes()Validates the passed in attributes.
The rules are:
- If action is "deploy" or "update" the "application"
and "source" attributes must be supplied.
- If action is "delete" or "undeploy" the
"application" attribute must be supplied.
// super.validateAttributes(); // don't want to call this method
Java java = getJava();
String action = getTask().getAction();
if (action == null) {
throw new BuildException("The \"action\" attribute must be set");
}
if (!isActionValid()) {
throw new BuildException("Invalid action \"" + action + "\" passed");
}
if (getClassName() == null) {
setClassName(JONAS_DEPLOY_CLASS_NAME);
}
if (jonasroot == null || jonasroot.isDirectory()) {
java.createJvmarg().setValue("-Dinstall.root=" + jonasroot);
java.createJvmarg().setValue("-Djava.security.policy=" + jonasroot
+ "/config/java.policy");
if ("DAVID".equals(orb)) {
java.createJvmarg().setValue("-Dorg.omg.CORBA.ORBClass"
+ "=org.objectweb.david.libs.binding.orbs.iiop.IIOPORB");
java.createJvmarg().setValue("-Dorg.omg.CORBA.ORBSingletonClass="
+ "org.objectweb.david.libs.binding.orbs.ORBSingletonClass");
java.createJvmarg().setValue("-Djavax.rmi.CORBA.StubClass="
+ "org.objectweb.david.libs.stub_factories.rmi.StubDelegate");
java.createJvmarg().setValue("-Djavax.rmi.CORBA.PortableRemoteObjectClass="
+ "org.objectweb.david.libs.binding.rmi.ORBPortableRemoteObjectDelegate");
java.createJvmarg().setValue("-Djavax.rmi.CORBA.UtilClass="
+ "org.objectweb.david.libs.helpers.RMIUtilDelegate");
java.createJvmarg().setValue("-Ddavid.CosNaming.default_method=0");
java.createJvmarg().setValue("-Ddavid.rmi.ValueHandlerClass="
+ "com.sun.corba.se.internal.io.ValueHandlerImpl");
if (davidHost != null) {
java.createJvmarg().setValue("-Ddavid.CosNaming.default_host="
+ davidHost);
}
if (davidPort != 0) {
java.createJvmarg().setValue("-Ddavid.CosNaming.default_port="
+ davidPort);
}
}
}
if (getServer() != null) {
java.createArg().setLine("-n " + getServer());
}
if (action.equals(ACTION_DEPLOY)
|| action.equals(ACTION_UPDATE)
|| action.equals("redeploy")) {
java.createArg().setLine("-a " + getTask().getSource());
} else if (action.equals(ACTION_DELETE) || action.equals(ACTION_UNDEPLOY)) {
java.createArg().setLine("-r " + getTask().getSource());
} else if (action.equals(ACTION_LIST)) {
java.createArg().setValue("-l");
}
|