11 - 15 december antwerp belgiumnagiworld.net/code/javapolis/jee-enhancements.pdf11 - 15 december...

75
11 - 15 DECEMBER ANTWERP BELGIUM 1

Upload: others

Post on 03-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

1

Page 2: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

www.javapolis.com 2

Java EE Enhancements for Real World Deployments

Nagesh SusarlaStaff Software EngineerBEA Systems

Page 3: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

3

Overall Presentation Goal

Get an understanding of the latest application packaging, upgrade and configuration features in a Java EE

environment

It covers in detail the application library features allowing Java EE EARs to become composite applications of reusable component libraries.

Page 4: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

4

Speaker’s Qualifications

Nagesh Susarla is a Staff Software Engineer at BEA SystemsNagesh Susarla leads the Java EE Application Container & WebApp teamNagesh Susarla has in the past worked on building the WebLogic Servlet and JSP containersNagesh Susarla writes frequently on WebLogic Server internals on dev2dev.bea.com

Page 5: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

5

Beyond the APIs …

Going beyond the Java EE programming APIs with features for packaging,

upgrading, and maintaining enterprise applications.

Page 6: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

6

Outline

Why Share? Application Libraries – What?

Production Redeployment Interruption-free?

Configuration ChangesCan it be external please?

Page 7: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

7

Outline

Why Share? Java EE Deployment UnitsCommon Libraries & PackagingJava EE Optional PackagesApplication Libraries Web Application Libraries

Production RedeploymentConfiguration Changes

Page 8: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

8

Java EE Deployment Units

EAR (Enterprise Archives)WAR (Web Application Archives)EJB (Enterprise Java Beans)RAR (Connector Archives)Application Clients

Page 9: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

9

Common Libraries

Common libraries are used by many applicationsDeveloped in-house Frameworks (Struts, Webwork, Spring, Portal)

Jar containing classes. EAR containing EJBsWebApp modules containing classes and

resources.

Page 10: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

10

Packaging Common Libraries

Package common modules: In the System Classpath. Within each application.

New versions require manually updating Application.Updating difficult when modules contain resources and classes.

Page 11: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

11

Problems

Scoping All Modules are tightly scoped. Modules cannot reference modules residing

outside an EARDelivering applications as a single EAR is limiting.

Page 12: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

12

Java EE Optional Packages

Share Plain Jars (w/ Classes) Any Module type can refer to an optional Jar.Via META-INF/MANIFEST.MF

Extension-List: optpack1 [optpackn] optpack1-Extension-Name: library-nameoptpack1-Specification-Version: (optional)optpack1-Implementation-Version: (optional)

Page 13: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

13

Java EE Optional Packages

Added to Module ClasspathMatch package with highest specification/implementation-versionDescriptors are ignored

Page 14: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

14

Application Libraries

GoalsSupported TypesSemanticsDeploymentReferencingPortability

Page 15: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

15

Application Libraries - Goals

Sharing of external code librariesPortability of library based applicationsOlder WebLogic Server ReleasesOther Application Servers

Require limited changes to existing applications to be packaged as a library.Provide Versioning Distribution and management.

Page 16: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

16

Application Libraries - Types

Referencing EAR

EAR Library

EJB jar

WAR library

Plain jar

Page 17: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

17

Application Libraries - Semantics

EJB jar A

WebApp BEJB Module

DAO Module

EAR EAR Library

References EJB Lib

DAO Module

Page 18: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

17

Application Libraries - Semantics

EJB jar A

WebApp BEJB Module

DAO Module

EAR EAR Library

EJB Lib

DAO Module

Page 19: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

17

Application Libraries - Semantics

EJB Module

DAO Module

EAR EAR Library

EJB Lib

DAO Module

Page 20: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

17

Application Libraries - Semantics

EJB Module

DAO Module

EAR Library

EJB Lib

DAO Module

Page 21: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

17

Application Libraries - Semantics

EAR Library

EJB Lib

DAO Module

Page 22: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

17

Application Libraries - Semantics

EAR Library

EJB jar A

WebApp B

EJB Lib (Lib)

DAO Module (Lib)

Merged View

EJB Lib

DAO Module

Page 23: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

18

Application Libraries - Semantics

Application(2) + Lib(2) => App’(4)Applications can reference: EAR Libraries: application.xml &

weblogic-application.xml mergedEJB jars: Included to the list to be

deployed.WARsPlain jars: Added to the App CP

Precedence order: App > Lib1 > Lib2 .

Page 24: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

19

Application Libraries - Semantics

Resource and ClassLoadingLibraries merged with referencing

application.No shared classloader for libraries

• Complicates redeployment of libraries and referencing applications.

Page 25: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

20

Application Library - Deployment

Package an EAR, EJB jar or WARAdd META-INF/MANIFEST.MF :Extension-Name: libNameSpecification-Version: 1.1Implementation-Version: 0.9

Multiple specification-versions may be deployed Deploy - Multiple libraries same specification-version but different implementation-version

Page 26: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

21

Application Libraries - Referencing

Add library-ref element to referencing EAR’s weblogic-application.xml.

library-ref

specification-version

library-name

implementation-version

exact-match

myLibrary

1.1

1.1.0

false

Page 27: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

22

Application Libraries - Referencing

Spec-version=1.1

exact-match=trueSpec-version=1.1

exact-match=false

Spec-version: 1.1

Impl-Version: 1.3

DAO Lib A

StableTeam App

PerpetualBeta App

Page 28: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

22

Application Libraries - Referencing

Spec-version=1.1

exact-match=trueSpec-version=1.1

exact-match=false

Spec-version: 1.1

Impl-Version: 1.3

DAO Lib A

StableTeam App

PerpetualBeta App

Page 29: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

22

Application Libraries - Referencing

Spec-version=1.1

exact-match=trueSpec-version=1.1

exact-match=false

Spec-version: 1.1

Impl-Version: 1.3

DAO Lib A

StableTeam App

PerpetualBeta App

Page 30: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

22

Application Libraries - Referencing

Spec-version=1.1

exact-match=trueSpec-version=1.1

exact-match=false

Spec-version: 1.1

Impl-Version: 1.3

Spec-version: 2.0

Impl-Version: 1.0

DAO Lib A DAO Lib A

StableTeam App

PerpetualBeta App

Page 31: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

22

Application Libraries - Referencing

Spec-version=1.1

exact-match=trueSpec-version=1.1

exact-match=false

Spec-version: 1.1

Impl-Version: 1.3

Spec-version: 2.0

Impl-Version: 1.0

DAO Lib A DAO Lib A

StableTeam App

PerpetualBeta App

Page 32: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

22

Application Libraries - Referencing

Spec-version=1.1

exact-match=trueSpec-version=1.1

exact-match=false

Spec-version: 1.1

Impl-Version: 1.3

Spec-version: 2.0

Impl-Version: 1.0

DAO Lib A DAO Lib A

StableTeam App

PerpetualBeta App

Page 33: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

22

Application Libraries - Referencing

Spec-version=1.1

exact-match=trueSpec-version=1.1

exact-match=false

Spec-version: 1.1

Impl-Version: 1.3

Spec-version: 2.0

Impl-Version: 1.0

DAO Lib A DAO Lib A

StableTeam App

PerpetualBeta App

Page 34: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

22

Application Libraries - Referencing

Spec-version=1.1

exact-match=trueSpec-version=1.1

exact-match=false

Spec-version: 1.1

Impl-Version: 1.3

Spec-version: 2.0

Impl-Version: 1.0

DAO Lib A DAO Lib A

StableTeam App

PerpetualBeta App

Page 35: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

22

Application Libraries - Referencing

Spec-version=1.1

exact-match=trueSpec-version=1.1

exact-match=false

Spec-version: 1.1

Impl-Version: 1.3

Spec-version: 2.0

Impl-Version: 1.0

DAO Lib A DAO Lib A

StableTeam App

PerpetualBeta App

Page 36: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

22

Application Libraries - Referencing

Spec-version=1.1

exact-match=trueSpec-version=1.1

exact-match=false

Spec-version: 1.1

Impl-Version: 1.3

Spec-version: 2.0

Impl-Version: 1.0

DAO Lib A DAO Lib A

StableTeam App

PerpetualBeta App

Page 37: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

22

Application Libraries - Referencing

Spec-version=1.1

exact-match=trueSpec-version=1.1

exact-match=false

Spec-version: 1.1

Impl-Version: 1.3

Spec-version: 2.0

Impl-Version: 1.0

DAO Lib A DAO Lib A

StableTeam App

PerpetualBeta App

Page 38: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

23

Application Libraries – Portability

Goal: Deploy library based apps to older releases of WebLogic Server or to other application serversCommand line tool called “weblogic.appmerge”Uses the same code as the runtime Container.Physically merges the libraries with the application.Merges Descriptors and writes them to disk.

Page 39: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

24

Web Application Libraries

Similar to Application libraries WAR can refer to WAR libraries Useful in referring to web frameworksNested libraries are supportedweb.xml is merged. Filters, servlets from library visible to

referencing web app

Page 40: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

25

Web Application Libraries (cont’d)

Example: JSTL and JSF are shipped with WebLogic Server as WAR libraries.Semantics and Deployment are similar to Application Libraries.Resources and classes are returned giving precedence to the referencing WAR.

Page 41: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

26

Outline

Why Share? Application Libraries – What?

Production Redeployment Interruption-free?

Configuration ChangesCan it be external please?

Page 42: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

27

Production Redeployment

MotivationGoalsMultiple VersionsVersioned ArtifactsAutomatic RetirementTesting New Application VersionRollbackManaging Versions

Page 43: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

28

Production Redeployment

Challenge New development practices demand constant

updates to your applicationEnsure application availability during

application upgradeCurrent ApproachScheduled DowntimeRedundant cluster/domain with hardware

load-balancer

Page 44: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

29

Side by Side - Motivation

Load-balancer

Current Approach: Hardware-based LB WebLogic: Software-based Versioning

Primary Cluster

Redundant Cluster

Single Cluster / Server

App A

App A’

App A

Page 45: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

30

Side by Side Deployment - Goals

Allow multiple versions to coexistRetirement policy – Graceful, timeoutAbility to Test new version before opening it to the “world”Rollback to the previous versionManaging Versions

Page 46: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

31

Multiple versions

Version isolation of the same app (EAR or WAR)New Requests routed to active versionExisting client requests can finish up with

retiring versionUnshared local/app-scoped resourcesShared Global resourcesApplications recommended to be self-contained

Page 47: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

32

Versioned Artifacts

JNDIEach version has its own app-scoped JNDI

treeGlobal bindings are versioned

• Current version maintained in Work Context• Transparent lookup and bind/unbind/rebind

MBeansApplication and Runtime MBeansAppDeploymentMBean

Page 48: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

33

Automatic Retirement

Old version retired after new version is deployedPolicies:Graceful: wait for all in-flight work to be done

• In-Flight work: HTTP Sessions and Transactions• Can be preempted by undeploy

Timeout: Specify timeout period on redeploy

Page 49: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

34

Testing New App Version

Deploy new version in Admin-modeVersion Info in META-INF/MANIFEST.MF

Admin Mode:Accessible via Administration channel onlyWebApp Requests and JNDI lookups

Who can use Admin Mode? Members of the “AdminChannelUsers” group

Promote Admin-mode version to Active

Page 50: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

35

Rollback

Rollback to previous versionRedeploy previous versionPending retirement of previous version

Cancelled

Page 51: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

36

Managing Versions

Monitoring of all versions via WebLogic ConsoleStatus: admin-mode, active, retiring,

scheduled to be retired In-flight work: HTTP Sessions

Redeploy new versionsUndeploy retiring versions

Page 52: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

37

Outline

Why Share? Application Libraries – What?

Production Redeployment Interruption-free?

Configuration Changes

Page 53: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

38

Configuration Changes

MotivationWhat are Deployment PlansExampleTool Support

Page 54: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

39

Deployment Plans - Motivation

Page 55: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

39

Deployment Plans - Motivation

Java EE 5 Deployment Descriptors optional.Annotations in source code.Configuration spread over descriptors/

annotationsEase of Development.Administrator?

Page 56: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

39

Deployment Plans - Motivation

Java EE 5 Deployment Descriptors optional.Annotations in source code.Configuration spread over descriptors/

annotationsEase of Development.Administrator? Need a way to externally configure application environment.

Page 57: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

40

Deployment Plans - What

Optional xml file that resides outside the application.Set/Override environment property values.External resources (jndi-name)Tuning parameters (session-timeout, max-

cache)Cannot change non-configurable properties (ejb-name).Uses XPath to declare/override values.

Page 58: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

Deployment Plans

Page 59: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

Deployment Plans

Development

Page 60: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

Deployment Plans

Development

MyEjb.jar

Page 61: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

Deployment Plans

Development

MyEjb.jar

public class MyBean ... { @Resource DataSource mySqlDataSource;….

Page 62: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

Deployment Plans

Development

MyEjb.jar

Page 63: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

Deployment Plans

Development

MyEjb.jar

Page 64: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

Deployment Plans

DevelopmentTesting

MyEjb.jar MyEjb.jar

Page 65: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

qaPlan.xml

Deployment Plans

DevelopmentTesting

MyEjb.jar MyEjb.jar

Page 66: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

qaPlan.xml

Deployment Plans

DevelopmentTesting

MyEjb.jar MyEjb.jar

<variable> <name>datasource</name> <value>QADataSource</value> </variable> ....

Page 67: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

qaPlan.xml

Deployment Plans

DevelopmentTesting

MyEjb.jar MyEjb.jar

Page 68: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

qaPlan.xml

Deployment Plans

DevelopmentTesting

MyEjb.jar MyEjb.jar

Page 69: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

qaPlan.xml

Deployment Plans

DevelopmentTesting Staging

MyEjb.jar MyEjb.jar MyEjb.jar

Page 70: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

qaPlan.xml

Deployment Plans

DevelopmentTesting Staging

MyEjb.jar MyEjb.jar MyEjb.jar

ProductionPlan.xml

Page 71: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

qaPlan.xml

Deployment Plans

DevelopmentTesting Staging

MyEjb.jar MyEjb.jar MyEjb.jar

ProductionPlan.xml<variable> <name>datasource</name> <value>GADataSource</value> </variable> ....

Page 72: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

41

qaPlan.xml

Deployment Plans

DevelopmentTesting Staging

MyEjb.jar MyEjb.jar MyEjb.jar

ProductionPlan.xml

Page 73: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

42

Deployment Plans – Tool Support

Use weblogic.PlanGenerator for plan templates from an application.WebLogic Consoleweblogic.Deployer -plan

Page 74: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

11 - 15 DECEMBER ANTWERP BELGIUM

43

Summary

Application Libraries aid modular development and maintenance of Real World ApplicationsDisruption free side-by-side deployments provide: Higher Quality of ServiceTest before exposing to the world

Deployment Plans let administrators alter configuration via external plans

Page 75: 11 - 15 DECEMBER ANTWERP BELGIUMnagiworld.net/code/javapolis/JEE-Enhancements.pdf11 - 15 DECEMBER ANTWERP BELGIUM 3 Overall Presentation Goal Get an understanding of the latest application

www.javapolis.com 44

Q&A