1 / 17

Ch 2 – Application Assembly and Deployment

Ch 2 – Application Assembly and Deployment. COSC 617 Jeff Schmitt September 14, 2006. Assembly. Assembly of an application or component is the process of collecting all of the elements required (source code, datafiles, configuration files) into a structured format that can be

clio
Download Presentation

Ch 2 – Application Assembly and Deployment

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ch 2 – Application Assembly and Deployment COSC 617 Jeff Schmitt September 14, 2006

  2. Assembly Assembly of an application or component is the process of • collecting all of the elements required (source code, datafiles, configuration files) into a • structured format that can be • deployed to the server environment.

  3. Deployment Deployment of a component or application is the process of • actually installing the runnable codethe runtime environment, which involves • making the code available to the server and • resolving resource references in the assembly with the resources actually on the server

  4. Application Components J2EE supports various types of application components • Java Servlet API • JavaServer Pages API • JavaServer Faces API • Enterprise Java Beans API • Configuration Files – configure components and external resources needed • Deployment Descriptors – a configuration file for the application itself

  5. J2EE Terminology Component – • a functional element of an application that runs within a container and makes use of runtime resources provided by the container (such as security mgmt, transation mgmt, etc) • One or more Java classes plus component-specific resources (properties, files, images) • 5 flavors: application clients, applets, web, EJB resource adapters

  6. J2EE Terminology - 2 Module • Collections of components of the same type, to be run inside the corresponding container type • Contains component-specific classes plus any class libraries needed, and other cross-component resources such as datafiles, HTML documents and image files • Contains a standard XML deployment descriptor for external resource references and configuration details

  7. Enterprise Application Archive • .ear file • A set of one or more modules, collectively containing all components of the app. • These modules contain • all of the components of the application • a deployment descriptor • Packaged into .jar files (java archive) • A particular layout

  8. Assembling Applications • Getting all the application modules together in the right package structure • Deployment descriptor: application.xml – references all the modules which make up an application • Modules can be • EJB in an ejb-jar file • Web modules in a war file

  9. JNDI Configuration Services • Assets are located at runtime using JNDI lookups in the namespace of the application server • Examples: • JMS message queues • JCA resource adapters • DataSource for MySql or Oracle database • Other J2EE components

  10. JNDI Naming Conventions • Runtime assets are given names within the java:comp/env namespace in the JNDI service java:comp – J2EE components /env – component runtime environment • Coordination required among component code, deployment descriptors, application server • Example: java:comp/dev/jdbc/myDS • Referenced in source code • Configured in deployment descriptor • Actual asset is available in Container

  11. Two-level Name Resolution • Assign an independent name when configuring within application server • Link this asset name to the name specified in the component deployment descriptor • Benefits • Allows flexibility • Allows sharing assets among components running on same server

  12. Deploying Applications • After application assembly comes application deployment • Application server has an internal JNDI directory • Resource and component references are linked through JNDI • Classloading model – more than one JVM • Assign a separate classloader to each deployed application • Physical deployment – vendor specific details in special configuration files

  13. Component Modules Component deployment descriptors specify • Module descriptive information, eg. name • Component elements (EJB web or resource connector) • Configuration data for component services (security services, lifecycle services, persistence services) • Resource and component dependencies (JDBC DataSources, JavaMail Sessions, session EJB, entity EJB)

  14. Example • EJB Module descriptor • Component elements, configuration, resource component external resources needed • Web module descriptor • Servlet mapping – how to recognize certain file names, which refer to servlet instead of file. Example: *.do /viewprofile • Session timeouts • Resource declarations to be resolved by the applic server. Example: EJB’s

  15. Application Assemblies • Application archive is just a .jar file with files stored in specific locations • Categories of information • Application descriptive information (name) • Module references – location of module .jar file in the application archive • Application security roles- control specific user’s access to components and their operations

  16. Steps in Deploying J2EE Applications • Adjust deployment descriptors • Local environmental issues, default settings, maximum number of items, etc. • Perform server-specific configuration • Physical configuration of runtime assets not specified in J2EE since application servers implement services in many ways • Configure required assets in application server • Module deployment descriptor links to assets in app server

  17. Deploying J2EE Apps (cont.) • Generate container-specific classes • Contaner-specific classes not specified in J2EE specification • Each server provides its own tools or processes for generating these classes • JBoss automatically generates EJB interface implementations • WebLogic povides command-line tool for generating container-specific classes

More Related