org.apache.tools.ant.taskdefs.optional.ejb

Class WLRun

public class WLRun extends Task

Starts a WebLogic server. A number of parameters are used to control the operation of the weblogic instance. Note that the task, and hence ant, will not complete until the weblogic instance is stopped.

Field Summary
protected static StringDEFAULT_PROPERTIES_FILE
protected static StringDEFAULT_WL51_POLICY_FILE
protected static StringDEFAULT_WL60_POLICY_FILE
Method Summary
PathcreateClasspath()
Add the classpath for the user classes
PathcreateWLClasspath()
Get the classpath to the weblogic classpaths
voidexecute()
Do the work.
voidsetArgs(String args)
Additional argument string passed to the Weblogic instance; optional.
voidsetBEAHome(File beaHome)
The location of the BEA Home; implicitly selects Weblogic 6.0; optional.
voidsetClasspath(Path classpath)
The classpath to be used with the Java Virtual Machine that runs the Weblogic Server; required.
voidsetDomain(String domain)
Set the Domain to run in; required for WL6.0
voidsetHome(File weblogicHome)
The location where weblogic lives.
voidsetJvmargs(String args)
Set the additional arguments to pass to the weblogic JVM
voidsetName(String serverName)
The name of the weblogic server within the weblogic home which is to be run.
voidsetPassword(String password)
Set the management password of the server; optional and only applicable to WL6.0.
voidsetPKPassword(String pkpassword)
Set the private key password so the server can decrypt the SSL private key file; optional and only applicable to WL6.0.
voidsetPolicy(String securityPolicy)
The name of the security policy file within the weblogic home directory that is to be used.
voidsetProperties(String propertiesFilename)
The name of the server's properties file within the weblogic home directory used to control the weblogic instance; required for WL4.5.1
voidsetUsername(String username)
Set the management username to run the server; optional and only applicable to WL6.0.
voidsetWeblogicMainClass(String c)
name of the main class for weblogic; optional.
voidsetWlclasspath(Path weblogicClasspath)
Set the weblogic classpath used by the Weblogic Server; optional, and only applicable to WL4.5.1 The weblogic classpath is used by weblogic to support dynamic class loading.

Field Detail

DEFAULT_PROPERTIES_FILE

protected static final String DEFAULT_PROPERTIES_FILE

DEFAULT_WL51_POLICY_FILE

protected static final String DEFAULT_WL51_POLICY_FILE

DEFAULT_WL60_POLICY_FILE

protected static final String DEFAULT_WL60_POLICY_FILE

Method Detail

createClasspath

public Path createClasspath()
Add the classpath for the user classes

Returns: a path to be configured

createWLClasspath

public Path createWLClasspath()
Get the classpath to the weblogic classpaths

Returns: a path to be configured

execute

public void execute()
Do the work. The work is actually done by creating a separate JVM to run a helper task. This approach allows the classpath of the helper task to be set. Since the weblogic tools require the class files of the project's home and remote interfaces to be available in the classpath, this also avoids having to start ant with the class path of the project it is building.

Throws: BuildException if someting goes wrong with the build

setArgs

public void setArgs(String args)
Additional argument string passed to the Weblogic instance; optional.

Parameters: args the argument string

setBEAHome

public void setBEAHome(File beaHome)
The location of the BEA Home; implicitly selects Weblogic 6.0; optional.

Parameters: beaHome the BEA Home directory.

setClasspath

public void setClasspath(Path classpath)
The classpath to be used with the Java Virtual Machine that runs the Weblogic Server; required. Prior to Weblogic 6.0, this is typically set to the Weblogic boot classpath. Under Weblogic 6.0 this should include all the weblogic jars

Parameters: classpath the classpath to use when executing the weblogic server.

setDomain

public void setDomain(String domain)
Set the Domain to run in; required for WL6.0

Parameters: domain the domain

setHome

public void setHome(File weblogicHome)
The location where weblogic lives. Required. This is the absolute location, not relative to BEA home.

Parameters: weblogicHome the home directory of weblogic.

setJvmargs

public void setJvmargs(String args)
Set the additional arguments to pass to the weblogic JVM

Parameters: args the arguments to be passed to the JVM

setName

public void setName(String serverName)
The name of the weblogic server within the weblogic home which is to be run. Optiona, defaults to "myserver"

Parameters: serverName the name of the server.

setPassword

public void setPassword(String password)
Set the management password of the server; optional and only applicable to WL6.0.

Parameters: password the management pasword of the server.

setPKPassword

public void setPKPassword(String pkpassword)
Set the private key password so the server can decrypt the SSL private key file; optional and only applicable to WL6.0.

Parameters: pkpassword the private key password,

setPolicy

public void setPolicy(String securityPolicy)
The name of the security policy file within the weblogic home directory that is to be used. If not specified, the default policy file weblogic.policy is used.

Parameters: securityPolicy the security policy to use.

setProperties

public void setProperties(String propertiesFilename)
The name of the server's properties file within the weblogic home directory used to control the weblogic instance; required for WL4.5.1

Parameters: propertiesFilename the properties file name

setUsername

public void setUsername(String username)
Set the management username to run the server; optional and only applicable to WL6.0.

Parameters: username the management username of the server.

setWeblogicMainClass

public void setWeblogicMainClass(String c)
name of the main class for weblogic; optional.

Parameters: c the name of the class

setWlclasspath

public void setWlclasspath(Path weblogicClasspath)
Set the weblogic classpath used by the Weblogic Server; optional, and only applicable to WL4.5.1 The weblogic classpath is used by weblogic to support dynamic class loading.

Parameters: weblogicClasspath the weblogic classpath