org.ow2.petals.jbi.management.task.deployment.deploy
Class DeploySUToComponentTask

java.lang.Object
  extended by org.ow2.petals.jbi.management.task.AbstractLoggableTask
      extended by org.ow2.petals.jbi.management.task.deployment.deploy.DeploySUToComponentTask
All Implemented Interfaces:
Task

public class DeploySUToComponentTask
extends AbstractLoggableTask

This task deploys service unit to the targeted component.

This task MUST be executed with a Context containing:

and returns following data in the Context:

The task has got a non-robust approach : it stops at the first subtask failed and have the undo capability.

Author:
Frederic Gardes - eBM Websourcing, ofabre - EBM Websourcing

Field Summary
protected  AdminService adminService
          JBI Container :: JMX Agent Admin
 
Fields inherited from class org.ow2.petals.jbi.management.task.AbstractLoggableTask
log
 
Constructor Summary
DeploySUToComponentTask(org.ow2.petals.util.LoggingUtil log, AdminService adminService)
           
 
Method Summary
protected  java.lang.String deploySUtoComponent(java.net.URL installUrl, org.ow2.petals.jbi.descriptor.original.generated.ServiceUnit serviceUnit)
          Deploy the given service unit to the targeted component.
 void execute(Context context)
          Launch the task with the given context.
 void undo(Context context)
          Reverse the task in order to retrieve the environ state before execution of this task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

adminService

protected AdminService adminService
JBI Container :: JMX Agent Admin

Constructor Detail

DeploySUToComponentTask

public DeploySUToComponentTask(org.ow2.petals.util.LoggingUtil log,
                               AdminService adminService)
Method Detail

execute

public void execute(Context context)
             throws java.lang.Exception
Description copied from interface: Task
Launch the task with the given context. Task can modify information included in this context during execution.

Parameters:
context - the execution context handling input and output information
Throws:
java.lang.Exception - if an error occurs during Task processing

deploySUtoComponent

protected java.lang.String deploySUtoComponent(java.net.URL installUrl,
                                               org.ow2.petals.jbi.descriptor.original.generated.ServiceUnit serviceUnit)
                                        throws java.lang.Exception
Deploy the given service unit to the targeted component. The component must be in the STARTED state to allow deployment of service units.

Parameters:
installationRoot - the SU installation URL
serviceUnit - the service unit production element
Returns:
a String xml result of the service unit deployment on the targeted component (see section 6.9 of the JSR 208)
Throws:
ManagementException - if component and related object are missing, if the call of the service unit manager method "deploy" fails or if the component isn't in the STARTED state
java.lang.Exception

undo

public void undo(Context context)
          throws java.lang.Exception
Description copied from interface: Task
Reverse the task in order to retrieve the environ state before execution of this task.

Parameters:
context - the execution context handling input and output information
Throws:
java.lang.Exception - if an error occurs during Task unprocessing


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.