![]() |
|
Drag-and-Drop service is used to deploy applications by moving the archives to be deployed to a particular directory. Shell scripts, ANT scripts, and OS shell commands can be used to move or copy archives to the AutoDeploy directory.
The Deploy Service is used to deploy applications. Deployments are filtered using file name filters. Server allows deployment of files with .ear, .jar, .war, and .rar extensions, as also exploded directories.
Drag-and-Drop service provides support to configure multiple directories as AutoDeploy directory. AutoDeployer keeps track of the directory configured to deploy archives. Any archive added to this directory is deployed automatically, or a modified archive redeployed.
The AutoDeploy directory is used to deploy applications on the Server. When an archive is dropped into the directory, it is deployed using the Deploy Service. The archive gets redeployed on modification, automatically.
The following types of archives can be dropped into the AutoDeploy:
AutoDeploy directory can be configured in deploy-config.xml located in <install_dir>/server/nodes/<node_name>/config/deploy-config.xml.
A sample code is provided below:
<deploy-config>
<auto-deploy>
<dir>$NODE_DIR/archives/autodeploy<dir>
<poll-interval-seconds>5<poll-interval-seconds>
</auto-deploy>
<deploy-config>
The following archives can be dropped into the AutoDeploy directory:
pramati-j2ee-server.xml with complete mappings. In case of CMP beans, pramati-or-map.xml with complete mappings and Web components with complete mappings.Note: Archives containing MDB archives with incomplete mappings for MDB’s, or archives containing CMP bean archives with partially mapped pramati-or-map.xml cannot be deployed in the AutoDeploy directory.
Valid archives moved into the AutoDeploy directory get deployed in the Server. In case of incomplete mappings, the deployment mappings are verified by an auto-mapping resolution framework and the validity of the archive is checked by a validation mechanism. This framework verifies and completes the mappings by assuming default data-source and mail-resource picked from the resource configuration.
If the archive has CMP beans, tables should be created before the deployment process. Server creates the tables automatically at the time of deployment, identifies the container managed relationship (CMR) between the beans, and specifies foreign-key (FK) constraints for the database tables.
The auto deployer keeps polling for the new archives added to the AutoDeploy directory and verifies the timestamps of the existing archives. If a new archive is added, it gets deployed automatically. An archive is redeployed if the timestamp of the existing archive is modified.
The AutoDeploy directory has a timeout parameter poll interval, which is the time taken by the auto deployer to search for new deployments and modified deployments. It should be specified in seconds and can be configured in the deploy-config.xml.
pramati-or-map.xml cannot be dropped into the directory.The Deploy Service comprises of auto-resolution, automatic table creation, and validation framework.
The auto-resolution framework verifies deployment information during deployment of an archive and resolves incomplete mappings. The framework helps in smooth deployment and finishes the deployment tasks left out by the application deployer. Any archive that has to be deployed, should have deployment information specific to the target server environment.
Deployment Information
The following information is required for an application to be deployed in the Server environment:
Server Specific Deployment Information
Server specific deployment information is specified in:
pramati-j2ee-server.xml containing the jndi-names, pool-sizes, reference-mappings for beans, context root information in case of Web componentspramati-or-map.xml containing Datasource mappings, CMP field mappings, relationships and table mappings in case of CMP beansQueries.props in case of CMP1.1 beans for query mappingsNote: An incomplete deployment mapping becomes a deployment task.
The Auto Resolution process performs the following functions:
Verification of Deployment Information
Verification of deployment information is a two-step process:
ejb-jar.xml for bean components, web.xml for Web components, and ra.xml for connector components. These XMLs contain information about resource references, security references and EJB references defined in the archive, which are to be mapped to the JNDI names in Server environment. In case of an invalid information, the validity of the standard J2EE XMLs, with regards to the packaged components, is checked and feedback is given to you.Auto-mapping
Auto-mapping is the completion of deployment tasks with default mappings. These default mappings are specified in the server specific deployment descriptors at the time of deployment.
Default datasource and mail resource are obtained from the resource-config.xml from the default resources section, while the default pool sizes for ejb-container are obtained from the ejb-config.xml.
For CMP 2.0 beans, pramati-or-map.xml is generated by the automatic table creator. All the mappings required for the deployment of an archive with CMP beans are completed.
For .wars, the ejb-link element that has ejb-references should point to a valid bean in a .jar.
Invalid deployment information provided in the standard J2EE XMLs
Verification process identifies an incomplete or invalid application deployment information in the standard J2EE XMLs, and gives the feedback about the information to be specified. For example, if the ejb-jar.xml contains an invalid resource type for a resource reference, at the time of deployment, you receive the following error message: The resource-ref <ref-name _moz-userdefined=""> in <bean-name _moz-userdefined=""> defined in ejb-jar.xml of <jar-name _moz-userdefined=""> contains an invalid resource-type <res-type _moz-userdefined="">.</res-type></jar-name></bean-name></ref-name>
Incomplete mappings for an unsupported type of archive for auto-resolution
If the server specific deployment XMLs contain incomplete mappings for an unsupported type of archive like CMP 1.1, you receive feedback about the type of mappings to be specified. For example, for MDBs, destination or queue mappings are mandatory. In the absence of these mappings, deployment process stops with a message prompting you to complete mappings.
Creation of tables during deployment is essential for deployment. Mapping tables and CMP fields for an archive with lot of CMP beans is a tedious task as each bean field has to be mapped to a DB field. The Server provides automatic table info generation, table creation, and or-map.xml generation.
Creating Tables
Table creation involves:
Table name information is generated from the bean name and database fields are generated from the CMP field name. Java types defined for the CMP fields are mapped to the appropriate database types by a type-mapping process. For table creation, SQL queries are generated with all the information obtained for table-name, database field name and database types.
Relationships can be specified within beans that use CMRs. Information on CMR is available in ejb-jar.xml, using which foreign-key relationships are obtained and specified in the SQL queries.
Deployment information for CMP beans is available in pramati-or-map.xml that is generated using all the information described above. This XML is generated to complete the table mappings, CMP field to database field mappings, and relationship mappings.
For relationship mapping, join conditions are generated along with foreign-key constraints in the tables.
| © Pramati Technologies 2007 | Runs on Pramati Server | Feedback | Legal |