Part I Development Tasks and Tools
1. Setting Up a Development Environment
3. Using Ant with Enterprise Server
Setting Up Your Ant Environment
Defining the ANT_OPTS Variable
Subelements of sun-appserv-deploy
Attributes of sun-appserv-deploy
Examples of sun-appserv-deploy
Subelements of sun-appserv-undeploy
Attributes of sun-appserv-undeploy
Examples of sun-appserv-undeploy
Subelements of sun-appserv-instance
Attributes of sun-appserv-instance
Examples of sun-appserv-instance
The sun-appserv-component Task
Subelements of sun-appserv-component
Attributes of sun-appserv-component
Examples of sun-appserv-component
Subelements of sun-appserv-admin
Attributes of sun-appserv-admin
Attributes of sun-appserv-jspc
Attributes of sun-appserv-update
Part II Developing Applications and Application Components
7. Using the Java Persistence API
8. Developing Web Applications
9. Using Enterprise JavaBeans Technology
10. Using Container-Managed Persistence
13. Developing Lifecycle Listeners
Part III Using Services and APIs
14. Using the JDBC API for Database Access
15. Using the Transaction Service
16. Using the Java Naming and Directory Interface
Reusable subelements of the Ant tasks for the Enterprise Server are as follows. These are objects upon which the Ant tasks act.
Specifies an Enterprise Server instance. Allows a single task to act on multiple server instances. The server attributes override corresponding attributes in the parent task; therefore, the parent task attributes function as default values.
The following table describes attributes for the server element.
|
You can control multiple servers using a single task. In this example, two servers are started, each using a different password. Only the second server is started in debug mode.
<sun-appserv-instance action="start"> <server host="greg.sun.com" passwordfile="${password.greg}"/> <server host="joe.sun.com" passwordfile="${password.joe}" debug="true"/> </sun-appserv-instance>
You can create instances on multiple servers using a single task. This example creates a new instance named qa on two different servers. Both servers use the same password.
<sun-appserv-instance action="create" instanceport="8080" instance="qa" passwordfile="${passwordfile}> <server host="greg.sun.com"/> <server host="joe.sun.com"/> </sun-appserv-instance>
These instances can also be removed from their respective servers:
<sun-appserv-instance action="delete" instance="qa" passwordfile="${passwordfile}> <server host="greg.sun.com"/> <server host="joe.sun.com"/> </sun-appserv-instance>
You can specify different instance names and instance ports using attributes of the nested server element:
<sun-appserv-instance action="create" passwordfile="${passwordfile}> <server host="greg.sun.com" instanceport="8080" instance="qa"/> <server host="joe.sun.com" instanceport="9090" instance="integration-test"/> </sun-appserv-instance>
You can deploy multiple components to multiple servers (see the The component Subelement) . This example
deploys each component to two Enterprise Server instances running on remote servers. Both
servers use the same password.
<sun-appserv-deploy passwordfile="${passwordfile}" asinstalldir="/opt/s1as8" > <server host="greg.sun.com"/> <server host="joe.sun.com"/> <component file="${assemble}/simpleapp.ear"/> <component file="${assemble}/simpleservlet.war" contextroot="test"/> <component file="${assemble}/simplebean.jar"/> </sun-appserv-deploy>
You can also undeploy multiple components from multiple servers. This example shows the same three components being removed from two different instances. Both servers use the same password.
<sun-appserv-undeploy passwordfile="${passwordfile}"> <server host="greg.sun.com"/> <server host="joe.sun.com"/> <component file="${assemble}/simpleapp.ear"/> <component file="${assemble}/simpleservlet.war"/> <component name="simplebean" /> </sun-appserv-undeploy>
You can enable or disable components on multiple servers. This example shows the same three components being enabled on two different instances. Both servers use the same password.
<sun-appserv-component action="enable" passwordfile="${passwordfile}"> <server host="greg.sun.com"/> <server host="joe.sun.com"/> <component file="${assemble}/simpleapp.ear"/> <component file="${assemble}/simpleservlet.war"/> <component name="simplebean" /> </sun-appserv-component>
Specifies a Java EE component. Allows a single task to act on multiple components. The component attributes override corresponding attributes in the parent task; therefore, the parent task attributes function as default values.
The following table describes attributes for the component element.
|
You can deploy multiple components using a single task. This example deploys each component to the same Enterprise Server instance running on a remote server.
<sun-appserv-deploy passwordfile="${passwordfile}" host="greg.sun.com" asinstalldir="/opt/s1as8" > <component file="${assemble}/simpleapp.ear"/> <component file="${assemble}/simpleservlet.war" contextroot="test"/> <component file="${assemble}/simplebean.jar"/> </sun-appserv-deploy>
You can also undeploy multiple components using a single task. This example demonstrates using the archive files (EAR and WAR, in this case) and the component name (for the EJB component).
<sun-appserv-undeploy passwordfile="${passwordfile}"> <component file="${assemble}/simpleapp.ear"/ <component file="${assemble}/simpleservlet.war"/> <component name="simplebean" /> </sun-appserv-undeploy>
You can deploy multiple components to multiple servers. This example deploys each component to two instances running on remote servers. Both servers use the same password.
<sun-appserv-deploy passwordfile="${passwordfile}" asinstalldir="/opt/s1as8" > <server host="greg.sun.com"/> <server host="joe.sun.com"/> <component file="${assemble}/simpleapp.ear"/> <component file="${assemble}/simpleservlet.war" contextroot="test"/> <component file="${assemble}/simplebean.jar"/> </sun-appserv-deploy>
You can also undeploy multiple components to multiple servers. This example shows the same three components being removed from two different instances. Both servers use the same password.
<sun-appserv-undeploy passwordfile="${passwordfile}"> <server host="greg.sun.com"/> <server host="joe.sun.com"/> <component file="${assemble}/simpleapp.ear"/> <component file="${assemble}/simpleservlet.war"/> <component name="simplebean" /> </sun-appserv-undeploy>
You can enable or disable multiple components. This example demonstrates disabling multiple components using the archive files (EAR and WAR, in this case) and the component name (for the EJB component).
<sun-appserv-component action="disable" passwordfile="${passwordfile}"> <component file="${assemble}/simpleapp.ear"/> <component file="${assemble}/simpleservlet.war"/> <component name="simplebean" /> </sun-appserv-component>
You can enable or disable multiple components on multiple servers. This example shows the same three components being enabled on two different instances. Both servers use the same password.
<sun-appserv-component action="enable" passwordfile="${passwordfile}"> <server host="greg.sun.com"/> <server host="joe.sun.com"/> <component file="${assemble}/simpleapp.ear"/> <component file="${assemble}/simpleservlet.war"/> <component name="simplebean" /> </sun-appserv-component>
Selects component files that match specified parameters. When fileset is included as a subelement, the name and contextroot attributes of the containing element must use their default values for each file in the fileset. For more information, see http://ant.apache.org/manual/CoreTypes/fileset.html.