org.ow2.jasmine.jadort.service.implementation
Class JMSSender

java.lang.Object
  extended by org.ow2.jasmine.jadort.service.implementation.JMSSender

public class JMSSender
extends java.lang.Object

Sends asynchronous JMS messages.

Author:
Arda Aydin, Malek Chahine, S. Ali Tokmen

Field Summary
protected static javax.jms.QueueConnection qc
           
protected static javax.jms.Queue queue
           
protected static javax.jms.QueueSession session
           
 
Constructor Summary
JMSSender()
           
 
Method Summary
static void connect()
          Connect to the JMS queue and create a session.
static void createVM(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress, java.lang.String vmName)
          Creates a VM.
static void deploy(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress, java.lang.String applicationName)
          Deploy an application on the server.
static void destroyVM(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress, java.lang.String vmName, boolean checkIfHostHalted)
          Destroys a VM.
static void disableApplications(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress)
          Disables all applications a server.
static void disconnect()
          Disconnect from the JMS queue.
static void enableApplications(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress)
          Enables all applications a server.
static void erase(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress, java.lang.String applicationName)
          Erases an application on the server.
static void setAsDefault(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress, java.lang.String applicationName)
          Set a given application as the default version.
static void startServer(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress, boolean useTarget)
          Starts a server.
static void startVM(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress, boolean useTarget, java.lang.String vmName)
          Starts a VM.
static void startWorker(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.WorkerProgressBean workerProgress)
          Starts a worker.
static void stopServer(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress, boolean useTarget)
          Stops a server.
static void stopVM(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress, boolean useTarget, java.lang.String vmName)
          Stop a VM.
static void stopWorker(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.WorkerProgressBean workerProgress)
          Stop a worker.
static void undeploy(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress, java.lang.String applicationName)
          Undeploy an application on the server.
static void upload(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation, org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress, org.ow2.jasmine.jadort.api.entities.deployment.ApplicationBean application)
          Upload an application on a server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

qc

protected static javax.jms.QueueConnection qc

session

protected static javax.jms.QueueSession session

queue

protected static javax.jms.Queue queue
Constructor Detail

JMSSender

public JMSSender()
Method Detail

connect

public static void connect()
                    throws javax.naming.NamingException,
                           javax.jms.JMSException
Connect to the JMS queue and create a session.

Throws:
javax.naming.NamingException - If queue not found.
javax.jms.JMSException - If creating a session fails.

disconnect

public static void disconnect()
                       throws javax.jms.JMSException
Disconnect from the JMS queue.

Throws:
javax.jms.JMSException - If connection close fails.

upload

public static void upload(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                          org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress,
                          org.ow2.jasmine.jadort.api.entities.deployment.ApplicationBean application)
                   throws javax.jms.JMSException
Upload an application on a server.

Parameters:
operation - Operation to work on.
serverProgress - Server on which the application will be uploaded.
application - the application to be uploaded.
Throws:
javax.jms.JMSException - If sending the JMS message fails.

deploy

public static void deploy(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                          org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress,
                          java.lang.String applicationName)
                   throws javax.jms.JMSException,
                          org.ow2.jasmine.jadort.api.JadortServiceException
Deploy an application on the server.

Parameters:
operation - Operation to work on.
serverProgress - Server on which the application will be deployed.
applicationName - The name (on the server side) of the application to be deployed.
Throws:
javax.jms.JMSException - If sending the JMS message fails.
org.ow2.jasmine.jadort.api.JadortServiceException

setAsDefault

public static void setAsDefault(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                                org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress,
                                java.lang.String applicationName)
                         throws javax.jms.JMSException,
                                org.ow2.jasmine.jadort.api.JadortServiceException
Set a given application as the default version.

Parameters:
operation - Operation to work on.
serverProgress - Server on which the application will be set as default.
applicationName - The name (on the server side) of the application to be set as default.
Throws:
javax.jms.JMSException - If sending the JMS message fails.
org.ow2.jasmine.jadort.api.JadortServiceException

undeploy

public static void undeploy(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                            org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress,
                            java.lang.String applicationName)
                     throws javax.jms.JMSException,
                            org.ow2.jasmine.jadort.api.JadortServiceException
Undeploy an application on the server.

Parameters:
operation - Operation to work on.
serverProgress - Server on which the application will be undeployed.
applicationName - The name (on the server side) of the application to be undeployed.
Throws:
javax.jms.JMSException - If sending the JMS message fails.
org.ow2.jasmine.jadort.api.JadortServiceException

erase

public static void erase(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                         org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress,
                         java.lang.String applicationName)
                  throws javax.jms.JMSException,
                         org.ow2.jasmine.jadort.api.JadortServiceException
Erases an application on the server.

Parameters:
operation - Operation to work on.
serverProgress - Server on which the application will be erased.
applicationName - The name (on the server side) of the application to be undeployed.
Throws:
javax.jms.JMSException - If sending the JMS message fails.
org.ow2.jasmine.jadort.api.JadortServiceException - If applicationName is null.

stopServer

public static void stopServer(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                              org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress,
                              boolean useTarget)
                       throws javax.jms.JMSException
Stops a server.

Parameters:
operation - Operation to work on.
serverProgress - Server that will be stopped.
useTarget - Whether to use the target server (if available).
Throws:
javax.jms.JMSException - If sending the JMS message fails.

startServer

public static void startServer(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                               org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress,
                               boolean useTarget)
                        throws javax.jms.JMSException
Starts a server.

Parameters:
operation - Operation to work on.
serverProgress - Server that will be started.
useTarget - Whether to use the target server (if available).
Throws:
javax.jms.JMSException - If sending the JMS message fails.

disableApplications

public static void disableApplications(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                                       org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress)
                                throws javax.jms.JMSException
Disables all applications a server.

Parameters:
operation - Operation to work on.
serverProgress - Server on which all applications will be disabled.
Throws:
javax.jms.JMSException - If sending the JMS message fails.

enableApplications

public static void enableApplications(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                                      org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress)
                               throws javax.jms.JMSException
Enables all applications a server.

Parameters:
operation - Operation to work on.
serverProgress - Server on which all applications will be enabled.
Throws:
javax.jms.JMSException - If sending the JMS message fails.

startWorker

public static void startWorker(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                               org.ow2.jasmine.jadort.api.entities.deployment.WorkerProgressBean workerProgress)
                        throws javax.jms.JMSException
Starts a worker.

Parameters:
operation - Operation to work on.
workerProgress - Worker that will be started.
Throws:
javax.jms.JMSException - If sending the JMS message fails.

stopWorker

public static void stopWorker(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                              org.ow2.jasmine.jadort.api.entities.deployment.WorkerProgressBean workerProgress)
                       throws javax.jms.JMSException
Stop a worker.

Parameters:
operation - Operation to work on.
workerProgress - Worker that will be stop.
Throws:
javax.jms.JMSException - If sending the JMS message fails.

startVM

public static void startVM(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                           org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress,
                           boolean useTarget,
                           java.lang.String vmName)
                    throws javax.jms.JMSException,
                           org.ow2.jasmine.jadort.api.JadortServiceException
Starts a VM.

Parameters:
operation - Operation to work on.
serverProgress - Server of the VM to start.
useTarget - Whether to use the target server (if available).
vmName - Name of the VM to start.
Throws:
javax.jms.JMSException - If sending the JMS message fails.
org.ow2.jasmine.jadort.api.JadortServiceException - If the vmName is null.

stopVM

public static void stopVM(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                          org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress,
                          boolean useTarget,
                          java.lang.String vmName)
                   throws javax.jms.JMSException,
                          org.ow2.jasmine.jadort.api.JadortServiceException
Stop a VM.

Parameters:
operation - Operation to work on.
serverProgress - Server of the VM to stop.
useTarget - Whether to use the target server (if available).
vmName - Name of the VM to stop.
Throws:
javax.jms.JMSException - If sending the JMS message fails.
org.ow2.jasmine.jadort.api.JadortServiceException - If the vmName is null.

createVM

public static void createVM(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                            org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress,
                            java.lang.String vmName)
                     throws javax.jms.JMSException
Creates a VM.

Parameters:
operation - Operation to work on.
serverProgress - Server of the VM to copy VM properties from (memory, etc.).
vmName - Name of the VM to create.
Throws:
javax.jms.JMSException - If sending the JMS message fails.

destroyVM

public static void destroyVM(org.ow2.jasmine.jadort.api.entities.deployment.OperationStateBean operation,
                             org.ow2.jasmine.jadort.api.entities.deployment.ServerProgressBean serverProgress,
                             java.lang.String vmName,
                             boolean checkIfHostHalted)
                      throws javax.jms.JMSException,
                             org.ow2.jasmine.jadort.api.JadortServiceException
Destroys a VM.

Parameters:
operation - Operation to work on.
serverProgress - Server of the VM to destroy.
vmName - Name of the VM to destroy.
Throws:
javax.jms.JMSException - If sending the JMS message fails.
org.ow2.jasmine.jadort.api.JadortServiceException - If the vmName is null.


Copyright © 2009 OW2 Consortium. All Rights Reserved.