org.ow2.jonas.webapp.jonasadmin.resourceadapter
Class ApplyCreateResourceAdapterAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.ow2.jonas.webapp.jonasadmin.JonasBaseAction
          extended by org.ow2.jonas.webapp.jonasadmin.deploy.BaseDeployAction
              extended by org.ow2.jonas.webapp.jonasadmin.resourceadapter.ApplyCreateResourceAdapterAction

public class ApplyCreateResourceAdapterAction
extends BaseDeployAction

The action used when a Resource Adapter is created. This uses a Velocity template to build up the XML and creates a RAR file.

Author:
Patrick Smith

Field Summary
 
Fields inherited from class org.ow2.jonas.webapp.jonasadmin.JonasBaseAction
DEPTH_DOMAIN, DEPTH_SERVER, GLOBAL_ERROR_FORWARD, m_Errors, m_Resources, m_Session, m_WhereAreYou
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
ApplyCreateResourceAdapterAction()
           
 
Method Summary
protected  String createEmptyJonasRa()
          Creates an empty jonas-ra.xml content header.
protected  void createJonasRa(CreateResourceAdapterForm oForm, org.apache.velocity.app.VelocityEngine ve, String domainName, String serverName)
          Create a ra.xml file (from a Velocity template) and adds it to a RAR file.
protected  void createRa(CreateResourceAdapterForm oForm, org.apache.velocity.app.VelocityEngine ve, String domainName, String serverName)
          Create a ra.xml file (from a Velocity template) and adds it to a RAR file.
 org.apache.struts.action.ActionForward executeAction(org.apache.struts.action.ActionMapping p_Mapping, org.apache.struts.action.ActionForm p_Form, HttpServletRequest p_Request, HttpServletResponse p_Response)
          The action to use when the Struts action is executed.
 
Methods inherited from class org.ow2.jonas.webapp.jonasadmin.deploy.BaseDeployAction
deploy, deployDataSource, deployMailFactory, deployModule, getCurrentJonasDeployment, getDomainDeploymentMethodName, getDomainUploadDeployMethodName, getForwardEdit, getListDeployableFiles, getListDeployedFiles, isConfigurable, isDeployment, isDomain, isModule, refreshJoramTree, refreshMBeansTree, refreshServiceTree, refreshTree, refreshWebServiceTree, removeFile, removeModule, runGC, setCurrentJonasDeployment, undeploy, undeployDataSource, undeployMailFactory, undeployModule
 
Methods inherited from class org.ow2.jonas.webapp.jonasadmin.JonasBaseAction
addGlobalError, execute, getAttributes, getBooleanAttribute, getBooleanAttribute, getBooleanAttribute, getIntAttribute, getIntegerAttribute, getIntegerAttribute, getIntegerAttribute, getJonasBase, getListAttribute, getLongAttribute, getLongAttribute, getLongAttribute, getNameForProvider, getPropsFromString, getServerItem, getShortAttribute, getStringArrayAttribute, getStringAttribute, getStringAttribute, getStringAttribute, getTreeBranchName, initialize, invoke, isActive, refreshDomainDeployTree, refreshServicesTree, removeChar, setBooleanAttribute, setBooleanAttribute, setIntegerAttribute, setIntegerAttribute, setIntegerAttribute, setLongAttribute, setLongAttribute, setShortAttribute, setStringAttribute, setStringAttribute, setStringAttribute, toStringBooleanAttribute, toStringIntegerAttribute, toStringLongAttribute, toStringShortAttribute
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplyCreateResourceAdapterAction

public ApplyCreateResourceAdapterAction()
Method Detail

executeAction

public org.apache.struts.action.ActionForward executeAction(org.apache.struts.action.ActionMapping p_Mapping,
                                                            org.apache.struts.action.ActionForm p_Form,
                                                            HttpServletRequest p_Request,
                                                            HttpServletResponse p_Response)
                                                     throws IOException,
                                                            ServletException
The action to use when the Struts action is executed. Create the appropriate RAR and forward to the RAR configuration tool if no errors exist.

Specified by:
executeAction in class JonasBaseAction
Parameters:
p_Mapping - The ActionMapping for the action.
p_Form - The form used in this action.
p_Request - HTTP Request for the action.
p_Response - The HTTP Response.
Returns:
A forward to the next Struts page.
Throws:
IOException - if the there is a problem with the template files, creation of the RARs.
ServletException - if the there is a servlet error.

createEmptyJonasRa

protected String createEmptyJonasRa()
Creates an empty jonas-ra.xml content header.

Returns:
The content of an empty jonas-ra XML file.

createRa

protected void createRa(CreateResourceAdapterForm oForm,
                        org.apache.velocity.app.VelocityEngine ve,
                        String domainName,
                        String serverName)
                 throws Exception
Create a ra.xml file (from a Velocity template) and adds it to a RAR file.

Parameters:
oForm - The struts form used in this Struts action.
ve - The Velocity engine that contains the appropriate template.
Throws:
Exception - If the invokation of creating the RAR or adding a file to the RAR fails.

createJonasRa

protected void createJonasRa(CreateResourceAdapterForm oForm,
                             org.apache.velocity.app.VelocityEngine ve,
                             String domainName,
                             String serverName)
                      throws Exception
Create a ra.xml file (from a Velocity template) and adds it to a RAR file.

Parameters:
oForm - The struts form used in this Struts action.
ve - The Velocity engine that contains the appropriate template.
Throws:
Exception - If the invokation of creating the RAR or adding a file to the RAR fails.


Copyright © 2010 OW2 Consortium. All Rights Reserved.