soft-shake.ch - jboss as 7, la révolution

55
cocktail d’expérience informatiques Genève 3 & 4 octobre 2011 Seconde édition Track Auteur Session Java Alexis HASSLER JBoss Application Server 7 soft -shake.ch

Upload: soft-shakech

Post on 02-Nov-2014

1.065 views

Category:

Technology


3 download

DESCRIPTION

Alexis HasslerJBoss AS 7 est sorti pendant l’été 2011. Cette version est une véritable révolution pour tous les utilisateurs JBoss : temps de démarrage et de déploiement record, techniques d’administration renouvelées, configuration simplifiée et plus expressive,…Dans cette présentation, j’explique ces nouveautés et je les montre avec des vrais morceaux de ligne de commande.http://soft-shake.ch/2011/conference/sessions/java/2011/09/13/jboss.html

TRANSCRIPT

Page 1: soft-shake.ch - JBoss AS 7, la révolution

cocktail d’expérience informatiquesGenève 3 & 4 octobre 2011

Seconde édition

Track

Auteur

Session

Java

Alexis HASSLER

JBoss Application Server 7

soft-shake.ch

Page 2: soft-shake.ch - JBoss AS 7, la révolution
Page 3: soft-shake.ch - JBoss AS 7, la révolution

la révolution

Alexis Hassler

Page 4: soft-shake.ch - JBoss AS 7, la révolution

@AlexisHassler

Page 5: soft-shake.ch - JBoss AS 7, la révolution
Page 6: soft-shake.ch - JBoss AS 7, la révolution

AlexisHassler

Page 7: soft-shake.ch - JBoss AS 7, la révolution

JavaEE 6

JAX-RS

JAX-WSJAX-WS

Ent. WS

WS Metadata

JAX-RPC

JAXM

JAXR

JAXB

Managed Beans

WebService

Servlet

JAX-WSJSF

EL

JSTL

Debugging

JSP

WebApplication

CDI

EJB

Interceptors

Bean Validation

Enterprise Application

JCACommon

Annotations

JMS

JTA

DI

JPA

JavaMail

Auth. SPI

JAX-WSJACC

Management

JMX StAX

JDBC

JAF

Deployment

Java SE

JAXP

Management& Security

Page 8: soft-shake.ch - JBoss AS 7, la révolution

JavaEE 6 – Web Profi le

Managed Beans

CDI

EJB 3 lite

Interceptors

Bean Validation

Enterprise Application

JTA

DI

JPA

Servlet

JAX-WSJSF

EL

JSTL

JSP

WebApplication

Debugging

Page 9: soft-shake.ch - JBoss AS 7, la révolution

JavaEE 6 - Pruning

JAX-RPC

JAXR

WebService

WebApplication

EJB 2 entity

Enterprise Application

Deployment

Java SE

Management& Security

Page 10: soft-shake.ch - JBoss AS 7, la révolution

JavaEE 6

Full P rofile

Web Profil e ++

Web Profil e.0

.0 preview

.1

Page 11: soft-shake.ch - JBoss AS 7, la révolution

Historique

1999

2001

2000

2002

2003

2005

2004

2006

2007

2009

2008

2010

2011

JBoss Group LLC

JBoss Inc

RedHat

2.22.0

3.03.24.0

4.25.05.16.07.0, 6.1, 7.1

Page 12: soft-shake.ch - JBoss AS 7, la révolution

Composants AS7

Core Infrastructure

SubsystemsD

atas

ourc

e

Java

EE

EJB

CDI -

Wel

d

JPA

- H

iber

nate

Nam

ing

Cach

e -

Infi

nisp

an

JMS

- H

orne

tQ

JGro

ups

JAX

-RS

- RE

STea

sy

JCA

- Ir

onJa

cam

ar

JBos

s Tr

ansa

ctio

n

JBos

s Lo

ggin

g

JSF

- M

ojar

ra

JAX

-WS

- CX

F

...

Page 13: soft-shake.ch - JBoss AS 7, la révolution

Composants AS6

Micro container

ServicesD

atas

ourc

e

Java

EE

EJB

CDI -

Wel

d

JPA

- H

iber

nate

Nam

ing

Cach

e -

Infi

nisp

an

JMS

- H

orne

tQ

JGro

ups

JAX

-RS

- RE

STea

sy

JCA

JBos

s Tr

ansa

ctio

n

JBos

s Lo

ggin

g

JSF

- M

ojar

ra

JAX

-WS

- CX

F

...

Page 14: soft-shake.ch - JBoss AS 7, la révolution

Architecture AS7

Core Infrastructure

Subsystems

Deployers VFS Jandex Reflect Cache Repository

Server Controller Service

MSCJBoss

ModulesDMR Controller Threads

Page 15: soft-shake.ch - JBoss AS 7, la révolution

Startup

0 s

5 s

10 s

15 s

20 s

25 s

30 s

35 s

40 s

45 s

50 s

AS 4.0AS 4.2

AS 5.1

AS 6.0

AS 7.0

Page 16: soft-shake.ch - JBoss AS 7, la révolution

Startup

0 s

10 s

20 s

30 s

40 s

50 s

60 s

70 s

80 s

90 s

Geronimo 2

GlassFish 2

GlassFish 3

JBoss 5

JBoss 6

Weblogic 10

Websphere 7

http://tiny.cc/agoncal-as-startup (12/2009)

Page 17: soft-shake.ch - JBoss AS 7, la révolution

Startup

http://community.jboss.org/wiki/AS7StartupTimeShowdown

Page 18: soft-shake.ch - JBoss AS 7, la révolution

Lightweight

0 Mo

20 Mo

40 Mo

60 Mo

80 Mo

100 Mo

120 Mo

140 Mo

160 Mo

180 Mo

AS 4.0 AS 4.2

AS 5.1

AS 6.0

AS 7.0

Heap used

Page 19: soft-shake.ch - JBoss AS 7, la révolution

Configuration

find <profile_dir> -name *.xml | wc -l

0

20

40

60

80

100

120

140

160

AS 4.0 AS 4.2

AS 5.1

AS 6.0

AS 7.0

Page 20: soft-shake.ch - JBoss AS 7, la révolution

bin

bundles

modules

standalone

domain

welcome-content

configuration

data

deployments

lib/ext

docs

bin

client

lib

server

common

docs

deploylib

default

standardalljbossweb-standaloneminimal

confdatadeploy

libdeployers

Configuration

Page 21: soft-shake.ch - JBoss AS 7, la révolution

Configuration

standalone/configutation/standalone.xml

Page 22: soft-shake.ch - JBoss AS 7, la révolution

Configuration

server/default/deploy/hdscanner-jboss-beans.xml

server/default/conf/bootstrap/profile.xml

Page 23: soft-shake.ch - JBoss AS 7, la révolution

✔ Configuration (réseau)✔ Démarrage

Page 24: soft-shake.ch - JBoss AS 7, la révolution

Déploiement

bin

bundles

modules

standalone

configuration

data

deployments

lib/ext

Automatique

– idem AS <7 pour les archives

– désactivé en mode explosé

cp demo.war $JBOSS_HOME/standalone/deployments/

17:12:24,923 INFO ... Deployed "demo.war"

Page 25: soft-shake.ch - JBoss AS 7, la révolution

Déploiement

État

.dodeploy

.isdeploying

.deployed .failed

.pending

.isundeploying

.undeployed

.skipdeploy

Page 26: soft-shake.ch - JBoss AS 7, la révolution

Déploiement

Manuel

– auto-deploy-zipped="false"

cp demo.war $JBOSS_HOME/standalone/deployments/

17:12:24,923 INFO ... Found demo.war ...

touch $JBOSS_HOME/standalone/deployments/demo.war.dodeploy

17:12:24,923 INFO ... Found demo.war ...

Page 27: soft-shake.ch - JBoss AS 7, la révolution

✔ Déploiement automatique✔ Déploiement manuel

Page 28: soft-shake.ch - JBoss AS 7, la révolution

Administration

Console CLI

HTTP / JSON Java API

Page 29: soft-shake.ch - JBoss AS 7, la révolution

http://<host>:9990/console

Page 30: soft-shake.ch - JBoss AS 7, la révolution

jboss-admin.sh

Naviguer

– cd, ls, pwd

Lire la configuration

– :read-resource, :read-attribute,...

Modifier la configuration

– :add-namespace, :write-attribute,...

Page 31: soft-shake.ch - JBoss AS 7, la révolution

jboss-admin.sh

Datasource

Déploiement

– upload + deploy

– undeploy

Page 32: soft-shake.ch - JBoss AS 7, la révolution

✔ Datasource

Page 33: soft-shake.ch - JBoss AS 7, la révolution

Modules

"Classpath is dead!"

Mark Reinhold, JavaOne 2009

http://java.sun.com/javaone/2009/general_sessions.jsp

Page 34: soft-shake.ch - JBoss AS 7, la révolution

Modules

Java Module

– Projet Jigsaw

– JavaSE 8

OSGi

JBoss Module

Page 35: soft-shake.ch - JBoss AS 7, la révolution

Modules

Hiérarchie Modularité

System Classloader

JBossClassloaders

DeploymentClassloader

DeploymentClassloader

Sub-deploymentClassloader

UCR

deployment.my.war

org.hibernate.core

org.slf4j

org.jboss.weld

org.javassist

Page 36: soft-shake.ch - JBoss AS 7, la révolution

Modules

Modules système

– Java EE

Modules user

Local Resource

Inter deployment dependencies

Page 37: soft-shake.ch - JBoss AS 7, la révolution

Déploiement

Séparation module / application

1 war => 1 module

– deployment.demo.war

Page 38: soft-shake.ch - JBoss AS 7, la révolution

Déploiement

1 ear => n modules

– ear/lib

– war

– ear

<!-- config globale --><subsystem xmlns="urn:jboss:domain:ee:1.0" > <ear-subdeployments-isolated> false </ear-subdeployments-isolated></subsystem>

<!-- jboss-deployment-structure.xml--><jboss-deployment-structure> <ear-subdeployments-isolated> true </ear-subdeployments-isolated></jboss-deployment-structure>

Page 39: soft-shake.ch - JBoss AS 7, la révolution

Module global

standalone.xml ou domain.xml

– Slot = version

<subsystem xmlns="urn:jboss:domain:ee:1.0" > <global-modules> <module name="org.javassist" slot="main" /> </global-modules></subsystem>

Page 40: soft-shake.ch - JBoss AS 7, la révolution

✔ SLF4J

Page 41: soft-shake.ch - JBoss AS 7, la révolution

Domain

Host 1

HostController

Server

Server

Host 2

HostController

Server

Host 3

HostController

Server

Host 0

DomainController

Page 42: soft-shake.ch - JBoss AS 7, la révolution

Domain

Host 1

HostController

Server

Server

Host 2

HostController

Server

Host 3

HostController

Server

Host 0

DomainController

Server Group 1

Server Group 2

Page 43: soft-shake.ch - JBoss AS 7, la révolution

RHQ

Host 1

RHQAgent

JBoss AS

Httpd

Host 2

RHQAgent

...Host 0

RHQServer

MySQLOSMem, CPU, FS

...

...

...

Page 44: soft-shake.ch - JBoss AS 7, la révolution

IDE

Eclipse 3.7 + JBoss Tools

IntelliJ IDEA 11

Netbeans 7.0

Page 45: soft-shake.ch - JBoss AS 7, la révolution
Page 46: soft-shake.ch - JBoss AS 7, la révolution

Cloud

IaaSInfrastructure as a Service

PaaSPlatform as a Service

SaaSSoftware as a Service

Hardware+

OS

Runtime/

Middleware

Software

Page 47: soft-shake.ch - JBoss AS 7, la révolution

PaaS by redhat

Java, Perl, PHP, Python, Ruby

Page 48: soft-shake.ch - JBoss AS 7, la révolution

Express

– Git

– < Web profile

Flex

– Contrôle étendu

– Amazon EC2

Page 49: soft-shake.ch - JBoss AS 7, la révolution
Page 50: soft-shake.ch - JBoss AS 7, la révolution

✔ OpenShift Express

Page 51: soft-shake.ch - JBoss AS 7, la révolution

JBoss EAP 6

Q1 2012 (TBC)

Dérivé de AS 7.1

– JavaEE 6 full profile

… à suivre

Page 52: soft-shake.ch - JBoss AS 7, la révolution

Conclusion

Travaux en cours

– Full profile

– Documentation

Retour d'expérience

.0

Page 53: soft-shake.ch - JBoss AS 7, la révolution

Conclusion

1999

2001

2000

2002

2003

2005

2004

2006

2007

2009

2008

2010

2011

Glassfish 3

2.22.0

3.03.24.0

4.25.05.16.07.0, 6.1, 7.1

Glassfish 2

Page 54: soft-shake.ch - JBoss AS 7, la révolution

http://www.jboss.org/as7.html

http://www.jboss.org/openshift/

Page 55: soft-shake.ch - JBoss AS 7, la révolution

Auto-promotion

http://www.sewatech.fr/formation-jboss-7.html

http://blog.alexis-hassler.com