Enterprise JavaBeans. Layer 05: Deployment

Similar documents
BEAWebLogic Server and WebLogic Express. Programming WebLogic JNDI

Introduction to Session beans EJB 3.0

Enterprise JavaBeans. Layer:01. Overview

Using JNDI from J2EE components

SUN Enterprise Development with iplanet Application Server

Overview p. 1 Server-side Component Architectures p. 3 The Need for a Server-Side Component Architecture p. 4 Server-Side Component Architecture

Server and WebLogic Express

jar command Java Archive inherits from tar : Tape Archive commands: jar cvf filename jar tvf filename jar xvf filename java jar filename.

Course Content for Java J2EE

Chapter 6 Enterprise Java Beans

SUN Sun Cert Bus Component Developer Java EE Platform 5, Upgrade. Download Full Version :

WHAT IS EJB. Security. life cycle management.

Ask the Experts JNDI Naming configuration and problem determination

Deccansoft Software Services. J2EE Syllabus

presentation DAD Distributed Applications Development Cristian Toma

BEA WebLogic. Server. Programming WebLogic JNDI

2 Introduction and Roadmap

1Z Oracle. Java Enterprise Edition 5 Business Component Developer Certified Professional Upgrade

Implementing a Web Service p. 110 Implementing a Web Service Client p. 114 Summary p. 117 Introduction to Entity Beans p. 119 Persistence Concepts p.

Advanced Java Programming

New Features in EJB 3.1

Programming JNDI for Oracle WebLogic Server 11g Release 1 (10.3.6)

Designing a Distributed System

Enterprise JavaBeans. Layer:08. Persistence

Enterprise JavaBeans (I) K.P. Chow University of Hong Kong

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format.

Java EE Application Assembly & Deployment Packaging Applications, Java EE modules. Model View Controller (MVC)2 Architecture & Packaging EJB Module

J2EE. Enterprise Architecture Styles: Two-Tier Architectures:

Installing and Configuring the Runtime Processes 2

ITdumpsFree. Get free valid exam dumps and pass your exam test with confidence

History of Enterprise Java

JNDI. Java Naming and Directory Interface. See also:

Distributed Multitiered Application

NetBeans IDE Field Guide

Writing Portable Applications for J2EE. Pete Heist Compoze Software, Inc.

Developing Portable Applications for the Java 2 Platform, Enterprise Edition (J2EE )

Vision of J2EE. Why J2EE? Need for. J2EE Suite. J2EE Based Distributed Application Architecture Overview. Umair Javed 1

Exam Actual. Higher Quality. Better Service! QUESTION & ANSWER

Practice Test. Oracle 1z Java Enterprise Edition 5 Business Component Developer Certified Professional Upgrade Exam. Version: 14.

Outline. Project Goal. Overview of J2EE. J2EE Architecture. J2EE Container. San H. Aung 26 September, 2003

The ps-makeejb Command 16

Introduction. Enterprise Java Instructor: Please introduce yourself Name Experience in Java Enterprise Edition Goals you hope to achieve

Java EE 7: Back-End Server Application Development

Application Servers G Session 5 - Sub-Topic 1 Java Naming and Directory Interface (JNDI) Dr. Jean-Claude Franchitti

Programming Web Services in Java

Communication Framework

For this week, I recommend studying Chapter 2 of "Beginning Java EE 7".

web.xml Deployment Descriptor Elements

WebSphere Application Server - Overview

Agenda. Naming & Directory Services. Extreme Java G Naming and directory services JNDI naming directory service provider interface Q & A

J2EE - Version: 25. Developing Enterprise Applications with J2EE Enterprise Technologies

Projects. How much new information can fit in your brain? Corporate Trainer s Profile TECHNOLOGIES

Application Servers in E-Commerce Applications

MyEclipse EJB Development Quickstart

Oracle 10g: Build J2EE Applications

Building the Enterprise

Configuration in Enhydra 6.2

Application Servers G Session 11 - Sub-Topic 2 Using Enterprise JavaBeans. Dr. Jean-Claude Franchitti

JBuilder. Getting Started Guide part II. Preface. Creating your Second Enterprise JavaBean. Container Managed Persistent Bean.

Lab2: CMP Entity Bean working with Session Bean

BEA WebLogic Server. Enterprise JavaBeans

JBoss AS 6 JNDI Naming for EJBs How does a client application refer to the EJB resource defined in the diagram below?

Java Technologies Resources and JNDI

Naming Distributed Systems. Sources: Computer Networks by Peterson and Davie and Sun Microsystems Java documentation.

Objectives. Software Development using MacroMedia s JRun. What are EJBs? Topics for Discussion. Examples of Session beans calling entity beans

Oracle Banking APIs. Part No. E Third Party Simulation Guide Release April 2018

Enterprise JavaBeans, Version 3 (EJB3) Programming

V3 EJB Test One Pager

J2EE Development with Apache Geronimo. Aaron Mulder Chariot Solutions

Borland Application Server Certification. Study Guide. Version 1.0 Copyright 2001 Borland Software Corporation. All Rights Reserved.

BEAAquaLogic. Service Bus. Interoperability With EJB Transport

Introduction to componentbased software development

Getting Started with JMS

Stateless Session Bean

Artix for J2EE. Version 4.2, March 2007

Dan Hayes. October 27, 2005

[Course Overview] After completing this module you are ready to: Develop Desktop applications, Networking & Multi-threaded programs in java.

Simple Stateless with Descriptor

Creating Mediation Handler for WAS 8.5 using EJB 3.0 Author: Hemalatha Rajendran

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR (ODD SEMESTER) QUESTION BANK

Fast Track to EJB 3.0 and the JPA Using JBoss

The team that wrote this redbook

IT6503 WEB PROGRAMMING. Unit-I

BEAWebLogic. Server. Programming Stand-alone Clients

JBoss to Geronimo - EJB-MDB Migration

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Agenda. Summary of Previous Session. Extreme Java G Session 3 - Main Theme Java Core Technologies (Part I)

Stateful Session Beans

Integrating NWDS with a Non-SAP Server (JBoss AS) to Develop and Deploy Java EE Applications

COMP9321 Web Application Engineering

Problems in Scaling an Application Client

OracleAS 10g R3: Build J2EE Applications II

A Guide to Porting Applications

CO Java EE 7: Back-End Server Application Development

Course: JBoss Training: JBoss AS 7 and JBoss EAP 6 Administration and Clustering Training

BEAWebLogic. Server. Programming Stand-alone Clients

Java 2 Platform, Enterprise Edition: Platform and Component Specifications

BEAWebLogic. Server. Deploying Applications to WebLogic Server

SCBCD EXAM STUDY KIT. Paul Sanghera CX JAVA BUSINESS COMPONENT DEVELOPER CERTIFICATION FOR EJB MANNING. Covers all you need to pass

Reading Assignment (Prepare yourself for the next assignment)

Transcription:

Enterprise JavaBeans Layer 05: Deployment

Agenda Discuss the deployment descriptor including its structure and capabilities. Discuss JNDI as it pertains to EJB. Last Revised: 10/2/2001 Copyright (C) 2001 2

Example I'll continue to use the same example that I used before, specifically the Book bean. Last Revised: 10/2/2001 Copyright (C) 2001 3

JNDI

Purpose JNDI is an acronym for Java Naming and Directory Interface. This is an API for accessing naming services such as: COSNaming LDAP RMI Registry Last Revised: 10/2/2001 Copyright (C) 2001 5

Directories Conceptually, a directory service is similar to a file system. Rather than serving up files, directory services serve up objects. Each entry in a directory is associated with a name. We use JNDI to establish a uniform way of accessing the entries within directories. Last Revised: 10/2/2001 Copyright (C) 2001 6

Server Compliance To be compliant with the EJB 1.1 specification, each EJB server must provide JNDI access to its naming service. Only lookup access is required; the vendor need not provide update capabilities. Additional proprietary access mechanisms may be supplied, but must not be required. Last Revised: 10/2/2001 Copyright (C) 2001 7

Package The JNDI API is accessible from the javax.naming package. We'll only use a small part of the API including: InitialContext Context NamingException Last Revised: 10/2/2001 Copyright (C) 2001 8

Connecting to a Directory As with databases, sockets, and other such objects, we first need to connect to the appropriate directory service. Each kind of naming service may have its own set of properties that can be used to configure this connection. Last Revised: 10/2/2001 Copyright (C) 2001 9

InitialContext (1 of 2) The InitialContext is used to provide a starting location in the directory hierarchy. The code on the following page demonstrates how to connect to the JBoss naming service. Last Revised: 10/2/2001 Copyright (C) 2001 10

BookClient 1. Properties env = new Properties(); 2. env.setproperty("java.naming.factory.initial", "org.jnp.interfaces.namingcontextfactory"); 3. env.setproperty("java.naming.provider.url", "localhost:1099"); 4. env.setproperty("java.naming.factory.url.pkgs", "org.jboss.naming"); 5. InitialContext ic = new InitialContext( env ); Last Revised: 10/2/2001 Copyright (C) 2001 11

InitialContext (2 of 2) To create an initial context, we provide information about the directory service we're using. Other such information may be required by each individual vendor. This data is provided as a Hashtable to the InitialContext constructor. Last Revised: 10/2/2001 Copyright (C) 2001 12

Deployment

Purpose Deployment is the process of making a server aware of some new component. This process is generally vendor-specific although the various high-level tasks to be performed are common to all implementations. Last Revised: 10/2/2001 Copyright (C) 2001 14

EJBs To deploy an EJB we need to complete the following steps: 1. Create a deployment descriptor. 2. Create a JAR file containing the necessary classes and the deployment descriptor. 3. Install the new bean into the server. Last Revised: 10/2/2001 Copyright (C) 2001 15

ejb-jar.xml (1 of 3) 1. <?xml version="1.0" encoding="cp1252"?> 2. <ejb-jar> 3. <description> Contains all book-related EJBs. </description> 4. <display-name>bookjar</display-name> 5. <enterprise-beans> 6. <session> 7. <description> Controls book processing. </description> Last Revised: 10/2/2001 Copyright (C) 2001 16

ejb-jar.xml (2 of 3) 8. <display-name> BookEJB </display-name> 9. <ejb-name> BookEJB </ejb-name> 10. <home> se554.layer05.ejb.bookhome </home> 11. <remote> se554.layer05.ejb.book </remote> Last Revised: 10/2/2001 Copyright (C) 2001 17

ejb-jar.xml (3 of 3) 12. <ejb-class> se554.layer05.ejb.bookbean </ejb-class> 13. <session-type> Stateful </session-type> 14. <transaction-type> Bean </transaction-type> 15. </session> 16. </enterprise-beans> 17. </ejb-jar> Last Revised: 10/2/2001 Copyright (C) 2001 18

Environment

Purpose To make beans less brittle, we can take advantage of their environment. Each bean class is given an area within the server's namespace by which they can access bean-specific data. Environment entries Bean references Resource factories Last Revised: 10/2/2001 Copyright (C) 2001 20

Environment Entries (1 of 2) Beans often need to access configuration information. To avoid hard-coding this information in the bean, we use an environment entry. An environment entry is a value that's placed in the bean's namespace within the server's naming server. Last Revised: 10/2/2001 Copyright (C) 2001 21

Environment Entries (2 of 2) To access an environment entry, an EJB will use JNDI. By default, all environment entries are placed under the context: java:comp/env The bean provider needs to make sure that the entry is defined at deployment time. Last Revised: 10/2/2001 Copyright (C) 2001 22

Defining Environment Entries ( 1 of 2) During the deployment process, the bean provider indicates that a bean requires an environment entry. They'll provide the entry's: Name Type Value Last Revised: 10/2/2001 Copyright (C) 2001 23

Defining Environment Entries (2 of 2) 1. <env-entry> 2. <description> General description of the entry. </description> 3. <env-entry-name> platypus </env-entry-name> 4. <env-entry-type> java.lang.string </env-entry-type> 5. <env-entry-value> some String value </env-entry-value> 6. </env-entry> Last Revised: 10/2/2001 Copyright (C) 2001 24

Using Environment Entries 1. Properties env = new Properties(); 2. env.setproperty("java.naming.factory.initial", "org.jnp.interfaces.namingcontextfactory"); 3. env.setproperty("java.naming.provider.url", "localhost:1099"); 4. env.setproperty("java.naming.factory.url.pkgs", "org.jboss.naming"); 5. InitialContext ic = new InitialContext( env ); 6. Object obj = ic.lookup("java:comp/env/platypus"); 7. String platypusstring = (String)obj; Last Revised: 10/2/2001 Copyright (C) 2001 25

Deployment Descriptor Entries There are other entries that we'll make within the deployment descriptor: EJB references Resource factories Last Revised: 10/2/2001 Copyright (C) 2001 26

Deployment

Process The actual deployment process is different for each EJB server, but they all share common characteristics: Create stubs and skeletons. Generate home and EJB objects. Install the home object into the naming service. Last Revised: 10/2/2001 Copyright (C) 2001 28

Summary Discuss the deployment descriptor including its structure and capabilities. Discuss JNDI as it pertains to EJB. Last Revised: 10/2/2001 Copyright (C) 2001 29

Next Steps Read chapter 10 in your text. The assignment for layer:05 is available on the course website. Last Revised: 10/2/2001 Copyright (C) 2001 30