Hi Folks,

The following tasks (and supporting files) add the needed scripting and
administration features for iPlanet Application Server 6.0 The following
tasks allow for:
* J2EE application deployment and undeploy (ear, jar and war, resource).
* Control of the application server process (local and remote). Kill, stop,
start and restart, with appropriate pausing feature (need to give
application server time to breath between commands).

Cheers,
Martin Gee



Submitted files
**************************************************
iPlanetTasks.htm (Good docos)

org.apache.tools.ant.taskdefs.optional.iplanet.Controllable.java
org.apache.tools.ant.taskdefs.optional.iplanet.Deployable.java
org.apache.tools.ant.taskdefs.optional.iplanet.IASControlTask.java
org.apache.tools.ant.taskdefs.optional.iplanet.IASDeployTask.java
org.apache.tools.ant.taskdefs.optional.iplanet.IASInstance.java
org.apache.tools.ant.taskdefs.optional.iplanet.IASInstanceAble.java
org.apache.tools.ant.taskdefs.optional.iplanet.IASUnDeployTask.java

Attachment: Deployable.java
Description: Binary data

Attachment: Controllable.java
Description: Binary data

Attachment: IASControlTask.java
Description: Binary data

Attachment: IASDeployTask.java
Description: Binary data

Attachment: IASInstance.java
Description: Binary data

Attachment: IASInstanceAble.java
Description: Binary data

Attachment: IASUnDeployTask.java
Description: Binary data

Title: ias_deploy

ias_deploy

Description

Wraps the iasdeploy command-line tool. Makes it nice and easy to deploydifferent types
of deployable units to local or remote iAS instances. NOTE: this task is dependent upon
iAS 6.0 SP2. 

Parameters

 

Element

Description

Required

ias_home

The application you wish to undeploy from an iAS instance.

No

Elements

 

Element

Description

Required

resource

A resource you wish to deploy. E.g. a JDBC datasource

No

application

An ear file you wish to deploy.

No

 

module

A war or jar (EJB) your wish to deploy

No

 

instance

The iAS instance you with to deploy any or all of the above. When not
specified the deploy task will deploy to the localhost.

No

 

Instance

 

Element

Description

Required

name

The name of the iAS instance locally registered with your iAS.

Yes or

user

The user for the iAS instance to which you wish to deploy

Yes

password

The password for the iAS instance to which you wish to deploy

Yes

host

defaults to localhost

No

port

defaults to 10817

No

Example

1) When you don't specify an iAS instance to deploy to, thedeploy task will
    deploy to the localhost.

<ias_deploy>
  <resource name="database/sampleDS.xml" />
  <application name="${builddir}/${name}.ear" />
  <module name="${builddir}/${name}EJB.jar" />
</ias_deploy>

2) Deploying an application, module and a resource to the iAS instanceon host 'moby'.

<ias_deploy>
  <instance user="admin" password="hoser" host="moby" port="10817" />
  <resource name="database/sampleDS.xml" />
  <application name="${builddir}/${name}.ear" />
  <module name="${builddir}/${name}EJB.jar" />
</ias_deploy>

3) Notice that a resource, module and application can have a specific instance to deploy to. In this
    example the application and module will deploy toinstance "myIAS1" and the resource will deploy
    to the host 'moby'.

<ias_deploy>
  <instance name="myIAS1" />
  <resource name="database/sampleDS.xml" />
      <instance user="admin" password="hoser" host="moby" port="10817" />
  <resource />
  <application name="${builddir}/${name}.ear" />
  <module name="${builddir}/${name}EJB.jar" />
</ias_deploy>

ias_undeploy

Descritpion

Wraps the iasdeploy command-line tool. Makes it nice and easy to undeploy different types
of deployable units from local or remote iAS instances. NOTE: this task is dependent upon
iAS 6.0 SP2 

Parameters

 

Element

Description

Required

ias_home

The application you wish to undeploy from an iAS instance.

No

Elements

 

Element

Description

Required

application

The application you wish to undeploy from an iAS instance.

No

module

The module you wish to undeploy from an iAS instance.

No

instance

The iAS instance you wish to deploy any or all of the above. When not
specified the deploy task will deploy to the localhost.

No

Instance

 

Element

Description

Required

name

The name of the iAS instance locally registered with your iAS (iASAT).

Yes

user

The user for the iAS instance to which you wish to deploy (same user as iASAT). 

Yes

password

The password for the iAS instance to which you wish to deploy (same password as iASAT). 

Yes

host

defaults to localhost

No

port

defaults to 10817

No

Example

This example will undeploy the supplied war module and ear application
from the local host. NOTE: please seen deploy for more examples. The
syntax for this task is identical from the deploy task.

<ias_undeploy>
   <module name="${builddir}/${name}.war" />
   <application name="${builddir}/${name}.ear" />
</ias_undeploy>

ias_control

Descritpion

Wraps the iascontrol command-line tool. Makes it nice and easy to locally or remotely control
an iAS instrance. Typical actions restarting, starting or stopping an iAS instance. NOTE: this task is 
dependent upon iAS 6.0 SP2 

Parameters

 

Element

Description

Required

ias_home

The application you wish to undeploy from an iAS instance.

No

Elements

The following elements correspond to actions (commands)  performed by the iascontrol command-line tool. 
All commands will be executed on the local iAS instance (local machine) where this task is executed unless 
the instance element is specified. Please see the following examples for reference. Please run iasconrol
commanline tool see ramifacations (local or remote capabilites) of each command. 
NOTE: please be aware these commands require some knowledge and experience with  the iascontrol executable.

 

Element

Description

Required

restart

Restarts a local or remote iAS instance. NOTE: this is not a iascontrol command.
This will execute stop and start actions with a pause between commands. (defualt
15 seconds).

No

start

Starts a local or remote iAS instance.

No

stop

Stops a local or remote iAS instance.

No

kill

Kills only a local iAS instance.

No

Controllable Parameters

 

Element

Description

Required

pause

This will create a pause or sleep for N amount of seconds after the appropriate command has been executed. This is necessary in situations where you may be executing in succession start and stop. The iascontrol tasks returns before all the sub processes in the instance have been started, stopped or killed (kxs, kjs, ...). So, the pause gives the iAS instance time to get into state before executing the next command. NOTE: at least 15 seconds is appropriate for between successive commands on my PIII 650 laptop. You will need to experiment with good timings.

No

Instance

 

Element

Description

Required

name

The name of the iAS instance locally registered with your iAS (iASAT).

Yes

user

The user for the iAS instance to which you wish to deploy (same user as iASAT). 

Yes

password

The password for the iAS instance to which you wish to deploy (same password as iASAT). 

Yes

host

defaults to localhost

No

port

defaults to 10817

No

Example

This example will undeploy the supplied war module and ear application
from the local host. NOTE: please seen deploy for more examples. The
syntax for this task is identical from the deploy task.

1) Kills the local iAS instance (including the kas process)

<ias_control>
   <kill />
</ias_control>

2) Restarts a named iAS instance which has been registered under iASAT (administration tool). Note
this could be either local or remote. Restart will pause for 20 seconds after stopping the instance, before starting the instance again.

<ias_control>
   <restart pause="20">
      <instance user="admin" password="hoser" host="moby" port="10817" />
   </restart>
</ias_control>

3) Starts a local iAS instance, pauses for 10 seconds and then stops the instance. NOTE: this leaves the
kas process running.

<ias_control>
   <start pause="10"/>
   <stop/>
</ias_control>

 

Reply via email to