Configuring Deployment Behavior

Applications can be deployed to OC4J Standalone in three different ways (each of which is described in detail in Chapter 9):

  • By editing server.xml to add an <application> element

  • Through the command line, using the admin.jar utility

  • By placing the application in an auto-deploy directory (in other words through "hot deployment")

Within server.xml , you can configure the directories used for autodeploying, staging, and running applications, and Connectors. You can also control which applications are started automatically when the server starts, which can be useful for balancing server startup time vs. responsiveness to the first user request.

The following example from server.xml file shows the default OC4J configuration:

 <application-server     application-directory="../applications"     deployment-directory="../application-deployments"     connector-directory="../connectors"     auto-start-applications="true"> ... </application-server> 

The following sections describe the < application-server> attributes. As with other configuration files, all file paths are relative to the location of server.xml .

Application-Auto-Deploy-Directory

This attribute specifies the "hot deployment" directory. Any updates to EAR files (or in the case of exploded deployments, any updates to META-INF/application.xml ) in this directory will be noticed and will prompt OC4J to redeploy the application. This is very useful during development to avoid the hassle of manually redeploying or restarting the server every time the application is rebuilt. Instead, you can just have the last step of the build process copy the EAR file into an autodeployment directory. Alternatively, if your project build directory is laid out in the same way as an EAR, you can just make that the autodeployment directory and you don't have to create an EAR at all.

No autodeployment directories are configured by default.

Application-Directory

This specifies the directory in which application archives that are deployed through admin.jar will be stored. This is basically just a staging area for EARs before they're exploded into the deployment-directory . The default value is ../applications .

Deployment-Directory

This attribute specifies the directory in which applications will actually be deployed (in other words, exploded, compiled, validated , and run). This directory is generally only touched by the server itself and the default value is ../application-deployments .

Connector-Directory

This attribute specifies the directory in which global Connectors will be deployed. The default value is ../connectors .

Connectors (also known as resource adapters) are J2EE components that allow access to external systems other than databases (for example, mainframes, billing systems, and so on). Global Connectors are made available to all applications within the server. Other Connectors can be deployed as part of a J2EE application (see Chapter 12).

Auto-Start-Applications

This attribute controls whether deployed applications are automatically started when the server is started. If you set it to true (the default setting), all applications will be fully initialized when the server starts. If set to false , then applications will not be initialized until the first user request. However, individual applications can override this false value, thus allowing a limited subset of deployed applications to be started automatically.

When working with one application, it generally makes sense to leave this parameter set to true . However, when multiple applications are deployed, you may want to decrease server startup time by only automatically initializing the applications that are used the most. For example, if you've deployed a J2EE testing application that you occasionally use to test your EJBs, you may not want to wait for it to be deployed every time you bounce the server. Instead, you just have to wait a few extra seconds for it to load (automatically) if and when you do decide to use it.



Oracle Application Server 10g. J2EE Deployment and Administration
Oracle Application Server 10g: J2EE Deployment and Administration
ISBN: 1590592352
EAN: 2147483647
Year: 2004
Pages: 150

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net