SlideShare une entreprise Scribd logo
Déployer une application Java EE
dans Azure
José Paumard @JosePaumard
Sébastien Pertus @SebastienPertus
tech.days 2015#mstechdays #JEEAzure
#JEEAzure
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
 Podcast « les casts codeurs »
http://lescastcodeurs.com/2014/10/26/lcc-111-interview-sur-microsoft-
azure-avec-patrick-chanezon-et-benjamin-guinebertiere/
 MOOC sur MVA
http://www.microsoftvirtualacademy.com/training-courses/deploiement-
application-java-dans-microsoft-azure
 Patterns !
https://github.com/Azure/azure-sdk-for-java
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
 Pourquoi vouloir déployer une application Java EE
dans Azure ?
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
 Pourquoi vouloir déployer une application Java EE
dans Azure ?
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
 Pour une application Java EE :
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
 Outils de développement pour le « Javaiste »
 IHM de gestion d’Azure, configuration, monitoring
 Gestion de données structurées / non structurées
 Application jouet
 Modes de déploiement de l’application
 Démo de l’application
 Q / R
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
 Eclipse Java EE « classique »
 + plugin spécifique Azure
 Ressource Github
https://github.com/azure
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
 Java EE = jeu de spécifications
 Java EE = du papier !
 Du papier + une implémentation de référence
 JPA → EclipseLink
 JAX-RS → Jersey
 JSF → Mojara
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
 Organisation
Déployer une application Java EE dans Azure
Portable
extensions
JSP 2.3 JSF 2.2 JAX RS 2 EL 3
Servlet 3.1
Managed Beans 1.0 EJB 3.2
JCA 1.7 JPA 2.1 JTA 2.1 JMS 2.0
Interceptors 1.1 CDI 1.1
Common
annotations 1.1
BeanValidation1.1
Concurrency
utilities
Batch
applications
Java API
for JSON
Java API
for Websocket
tech.days 2015#mstechdays #JEEAzure
 Organisation
Déployer une application Java EE dans Azure
Portable
extensions
JSP 2.3 JSF 2.2 JAX RS 2 EL 3
Servlet 3.1
Managed Beans 1.0 EJB 3.2
JCA 1.7 JPA 2.1 JTA 2.1 JMS 2.0
Interceptors 1.1 CDI 1.1
Common
annotations 1.1
BeanValidation1.1
Concurrency
utilities
Batch
applications
Java API
for JSON
Java API
for Websocket
tech.days 2015#mstechdays #JEEAzure
 Organisation
Déployer une application Java EE dans Azure
Portable
extensions
JSP 2.3 JSF 2.2 JAX RS 2 EL 3
Servlet 3.1
Managed Beans 1.0 EJB 3.2
JCA 1.7 JPA 2.1 JTA 2.1 JMS 2.0
Interceptors 1.1 CDI 1.1
Common
annotations 1.1
BeanValidation1.1
Concurrency
utilities
Batch
applications
Java API
for JSON
Java API
for Websocket
tech.days 2015#mstechdays #JEEAzure
 Organisation
Déployer une application Java EE dans Azure
Portable
extensions
JSP 2.3 JSF 2.2 JAX RS 2 EL 3
Servlet 3.1
Managed Beans 1.0 EJB 3.2
JCA 1.7 JPA 2.1 JTA 2.1 JMS 2.0
Interceptors 1.1 CDI 1.1
Common
annotations 1.1
Concurrency
utilities
Batch
applications
Java API
for JSON
Java API
for Websocket
BeanValidation1.1
tech.days 2015#mstechdays #JEEAzure
 JPA, EJB, JAX-RS, JAX-WS
 JSF (si on l’utilise)
 JMS ?
 Java Mail ?
 Journalisation ?
→ On peut utiliser directement des services cloud
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
SQL Database
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
 Deux versions de Java EE
 Tomcat implémente le « web profile »
 Wildfly (JBoss), Glassfish, Weblogic, Websphere,
implémentent le « full profile »
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
 Accès aux données (JPA)
 Couche de service (EJB)
 Services REST (JAX-RS)
 IHM (JSF)
 Stockage d’images en BLOB
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
 « Entité » JPA
Déployer une application Java EE dans Azure
public class Musician {
private String name ;
private Date dateOfBirth ;
private MusicType musicType ;
// getters / setters
}
tech.days 2015#mstechdays #JEEAzure
 « Entité » JPA
Déployer une application Java EE dans Azure
public class Musician {
private Long id ;
private String name ;
private Date dateOfBirth ;
private MusicType musicType ;
// getters / setters
}
tech.days 2015#mstechdays #JEEAzure
 « Entité » JPA
Déployer une application Java EE dans Azure
@Entity
public class Musician {
@Id
private Long id ;
private String name ;
private Date dateOfBirth ;
private MusicType musicType ;
// getters / setters
}
tech.days 2015#mstechdays #JEEAzure
 « Entité » JPA
Déployer une application Java EE dans Azure
@Entity
public class Musician {
@Id @GeneratedValue(strategy=GenerationType.AUTO)
private Long id ;
private String name ;
private Date dateOfBirth ;
private MusicType musicType ;
// getters / setters
}
tech.days 2015#mstechdays #JEEAzure
 « Entité » JPA
Déployer une application Java EE dans Azure
@Entity
public class Musician {
@Id @GeneratedValue(strategy=GenerationType.AUTO)
private Long id ;
private String name ;
@Temporal(TemporalType.DATE)
private Date dateOfBirth ;
private MusicType musicType ;
// getters / setters
}
tech.days 2015#mstechdays #JEEAzure
 « Entité » JPA
Déployer une application Java EE dans Azure
@Entity
public class Musician {
@Id @GeneratedValue(strategy=GenerationType.AUTO)
private Long id ;
@Column(name="name")
private String name ;
@Temporal(TemporalType.DATE)
private Date dateOfBirth ;
private MusicType musicType ;
// getters / setters
}
tech.days 2015#mstechdays #JEEAzure
 « Entité » JPA
Déployer une application Java EE dans Azure
@Entity
public class Musician {
@Id @GeneratedValue(strategy=GenerationType.AUTO)
private Long id ;
@Column(name="name")
private String name ;
@Temporal(TemporalType.DATE)
private Date dateOfBirth ;
@Enumerated(EnumType.STRING)
private MusicType musicType ;
// getters / setters
}
public enum MusicType {
JAZZ, CLASSICAL, ROCK, FOLK
}
tech.days 2015#mstechdays #JEEAzure
 « Entité » JPA
Déployer une application Java EE dans Azure
@Entity
public class Musician {
@OneToMany
private List<Instrument> instruments ;
// getters / setters
}
tech.days 2015#mstechdays #JEEAzure
 « Entité » JPA
Déployer une application Java EE dans Azure
@Entity
public class Musician {
@OneToMany
private List<Instrument> instruments ;
@ManyToMany
private List<Orchestra> orchestras ;
// getters / setters
}
tech.days 2015#mstechdays #JEEAzure
 « Entité » JPA
Déployer une application Java EE dans Azure
@Entity
public class Musician {
@OneToMany
private List<Instrument> instruments ;
@ManyToMany
private List<Orchestra> orchestras ;
@Embedded
private Address address ;
// getters / setters
}
tech.days 2015#mstechdays #JEEAzure
 « Entité » JPA
Déployer une application Java EE dans Azure
@Entity
public class Musician {
@OneToMany
private List<Instrument> instruments ;
@ManyToMany
private List<Orchestra> orchestras ;
@Embedded
private Address address ;
@Column(name="email", length=80)
private String email ;
// getters / setters
}
tech.days 2015#mstechdays #JEEAzure
 « Entité » JPA
Déployer une application Java EE dans Azure
@Entity
public class Musician {
@OneToMany
private List<Instrument> instruments ;
@ManyToMany
private List<Orchestra> orchestras ;
@Embedded
private Address address ;
@Column(name="email", length=80) @Email
private String email ;
// getters / setters
}
tech.days 2015#mstechdays #JEEAzure
 Gestion des relations *:*
 Gestion de l’héritage
 Génération du schéma
 Adaptation à un schéma existant
 Gestion des requêtes SQL / JPQL
 Configuration par annotations ou XML
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzureDéployer une application Java EE dans Azure
 Injection / production
@Stateless
public class EntityManagerProvider {
@PersistenceContext(unitName="DataService")
private static EntityManager entityManager ;
}
tech.days 2015#mstechdays #JEEAzureDéployer une application Java EE dans Azure
 Injection / production
@Stateless
public class EntityManagerProvider {
@Produces
@PersistenceContext(unitName="DataService")
private static EntityManager entityManager ;
}
tech.days 2015#mstechdays #JEEAzureDéployer une application Java EE dans Azure
 Injection / production
@Stateless
public class EntityManagerProvider {
@Produces
@PersistenceContext(unitName="DataService")
private static EntityManager entityManager ;
}
@Stateless
public class MusicianService {
@Inject
private EntityManager em ;
}
tech.days 2015#mstechdays #JEEAzureDéployer une application Java EE dans Azure
 Injection / production
@Stateless
public class EntityManagerProvider {
@Produces @DBProd
@PersistenceContext(unitName="DataService")
private static EntityManager entityManager ;
}
@Stateless
public class MusicianService {
@Inject @DBProd
private EntityManager em ;
}
tech.days 2015#mstechdays #JEEAzure
 Implémentées par des EJB
Déployer une application Java EE dans Azure
public class MusicianService {
private EntityManager em ;
public Musician findById(long id) {
return em.find(Musician.class, id) ;
}
public List<Musician> findByName(String name) {
Query q = em.createNamedQuery("Musician.byName") ;
q.setParam("name", name) ;
return q.getResultList() ;
}
}
tech.days 2015#mstechdays #JEEAzure
 Implémentées par des EJB
Déployer une application Java EE dans Azure
@Stateless
public class MusicianService {
@Inject
private EntityManager em ;
public Musician findById(long id) {
return em.find(Musician.class, id) ;
}
public List<Musician> findByName(String name) {
Query q = em.createNamedQuery("Musician.byName") ;
q.setParam("name", name) ;
return q.getResultList() ;
}
}
tech.days 2015#mstechdays #JEEAzure
 Implémentées par des EJB
Déployer une application Java EE dans Azure
@Stateless
public class MusicianService {
@Inject
private EntityManager em ;
@Transactionnal(TxType.SUPPORTS)
public Musician findById(long id) {
return em.find(Musician.class, id) ;
}
@Transactionnal(TxType.SUPPORTS)
public List<Musician> findByName(String name) {
Query q = em.createNamedQuery("Musician.byName") ;
q.setParam("name", name) ;
return q.getResultList() ;
}
}
tech.days 2015#mstechdays #JEEAzure
 JAX-RS
Déployer une application Java EE dans Azure
public class MusicianRestService {
private MusicianService musicianService ;
public Response getById( long id) {
Musician musician = musicianService.findById(id) ;
if (musician == null) {
return Response.status(Status.NOT_FOUND).build() ;
} else {
return Response.ok(musician).build() ;
}
}
}
tech.days 2015#mstechdays #JEEAzure
 JAX-RS
Déployer une application Java EE dans Azure
@Path("musician")
public class MusicianRestService {
@Inject
private MusicianService musicianService ;
@Path("{id}") // /musician/23
public Response getById( long id) {
Musician musician = musicianService.findById(id) ;
if (musician == null) {
return Response.status(Status.NOT_FOUND).build() ;
} else {
return Response.ok(musician).build() ;
}
}
}
tech.days 2015#mstechdays #JEEAzure
 JAX-RS
Déployer une application Java EE dans Azure
@Path("musician")
public class MusicianRestService {
@Inject
private MusicianService musicianService ;
@Path("{id}") // /musician/23
public Response getById(@PathParam("id") long id) {
Musician musician = musicianService.findById(id) ;
if (musician == null) {
return Response.status(Status.NOT_FOUND).build() ;
} else {
return Response.ok(musician).build() ;
}
}
}
tech.days 2015#mstechdays #JEEAzure
 JAX-RS
Déployer une application Java EE dans Azure
@Path("musician")
public class MusicianRestService {
@Inject
private MusicianService musicianService ;
@Path("{id}") // /musician/23
@GET
public Response getById(@PathParam("id") long id) {
Musician musician = musicianService.findById(id) ;
if (musician == null) {
return Response.status(Status.NOT_FOUND).build() ;
} else {
return Response.ok(musician).build() ;
}
}
}
tech.days 2015#mstechdays #JEEAzure
 JAX-RS
Déployer une application Java EE dans Azure
@Path("musician")
public class MusicianRestService {
@Inject
private MusicianService musicianService ;
@Path("{id}") // /musician/23
@GET @Produces({MediaType.TEXT_XML, MediaType.APPLICATION_JSON})
public Response getById(@PathParam("id") long id) {
Musician musician = musicianService.findById(id) ;
if (musician == null) {
return Response.status(Status.NOT_FOUND).build() ;
} else {
return Response.ok(musician).build() ;
}
}
}
tech.days 2015#mstechdays #JEEAzure
 JAX-RS / JAXB
Déployer une application Java EE dans Azure
@XmlRootElement @XmlAccessorType(XmlAccessType.FIELD)
public class Musician {
@XmlAttribute
private Long id ;
@XmlElement
private String name ;
@XmlElement(name="date-of-birth")
private Date dateOfBirth ;
private MusicType musicType ;
// getters / setters
}
tech.days 2015#mstechdays #JEEAzure
 Présentation de l’IHM (MVC)
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
IaaS / PaaS
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzureDéployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzureDéployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
Application CRUD
Service REST
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
 Azure offre une solution de déploiement
d’application Java
 Techniquement très complète et « à jour »
 Commercialement supportée
 Donc oui, évaluer Azure lorsque l’on veut déployer
du Java dans le cloud, c’est intéressant !
Déployer une application Java EE dans Azure
tech.days 2015#mstechdays #JEEAzure
 Questions ? Commentaires ? Interrogations ?
@JosePaumard
@SebastienPertus
Déployer une application Java EE dans Azure
© 2015 Microsoft Corporation. All rights reserved.
tech days•
2015
#mstechdays techdays.microsoft.fr

Contenu connexe

KEY
CDI mis en pratique avec Seam Social et Weld OSGI
PPT
Presentation Spring
PPT
Apache ANT
PDF
Gradle_LyonJUG
PDF
Springioc
PDF
Gradle_Paris2010
PDF
Introduction jdbc
CDI mis en pratique avec Seam Social et Weld OSGI
Presentation Spring
Apache ANT
Gradle_LyonJUG
Springioc
Gradle_Paris2010
Introduction jdbc

Tendances (20)

PDF
Gradle_NormandyJUG
PPTX
Spring ioc
PPT
Spring MVC
PPT
Presentation JPA
PDF
Présentation Gradle au LyonJUG par Grégory Boissinot - Zenika
PDF
Environnement java
PPSX
5 android web_service
PDF
Gradle_BordeauxJUG
PDF
Introduction à Zend Framework 2
PDF
Spring Meetup Paris - Back to the basics of Spring (Boot)
PDF
gradle_nantesjug
PDF
Rapport tp1 j2ee
PPTX
Jpa(1)
PDF
gradle_lavajug
PDF
Introduction à JPA (Java Persistence API )
PDF
Introduction aspnet
PPTX
Introduction à spring boot
PDF
Gradle_ToursJUG
PPTX
Les dessous du framework spring
PDF
Gradle_ToulouseJUG
Gradle_NormandyJUG
Spring ioc
Spring MVC
Presentation JPA
Présentation Gradle au LyonJUG par Grégory Boissinot - Zenika
Environnement java
5 android web_service
Gradle_BordeauxJUG
Introduction à Zend Framework 2
Spring Meetup Paris - Back to the basics of Spring (Boot)
gradle_nantesjug
Rapport tp1 j2ee
Jpa(1)
gradle_lavajug
Introduction à JPA (Java Persistence API )
Introduction aspnet
Introduction à spring boot
Gradle_ToursJUG
Les dessous du framework spring
Gradle_ToulouseJUG
Publicité

En vedette (11)

PDF
Linked to ArrayList: the full story
PDF
API Asynchrones en Java 8
PDF
Java 8 Stream API and RxJava Comparison
PDF
Les Streams sont parmi nous
PDF
Java SE 8 for Java EE developers
PDF
50 new things we can do with Java 8
PDF
ArrayList et LinkedList sont dans un bateau
PDF
Free your lambdas
PDF
50 nouvelles choses que l'on peut faire avec Java 8
PPTX
JFokus 50 new things with java 8
PDF
Java 8 Streams and Rx Java Comparison
Linked to ArrayList: the full story
API Asynchrones en Java 8
Java 8 Stream API and RxJava Comparison
Les Streams sont parmi nous
Java SE 8 for Java EE developers
50 new things we can do with Java 8
ArrayList et LinkedList sont dans un bateau
Free your lambdas
50 nouvelles choses que l'on peut faire avec Java 8
JFokus 50 new things with java 8
Java 8 Streams and Rx Java Comparison
Publicité

Similaire à Déploiement d'une application Java EE dans Azure (20)

PPTX
Introduction JavaEE
PPT
PDF
cours-gratuit.com--id-1964.pdf
PPSX
Formation JAVA/J2EE
PPTX
Archi tech 2010-09-13
DOCX
Java j2ee
PDF
Mémoire de Licence, site web dynamique sous JEE, application aux entreprises ...
PDF
Présentation de JEE et de son écosysteme
PDF
Cours d'introduction à la programmation j2ee donc java 2ee
PPTX
Présentation PFE Module Article GPAO
PDF
01_Introduction_a_JEE.pdf
PPT
JavaEEGibello.ppt
PPTX
Entreprise Java Beans (EJB)
PDF
Saas Libre
PPTX
Support cours j2_ee
ODP
#5 Java EE5 Client Lourd et Smart Client
PDF
PPTX
Javavs net
DOCX
Cv Moez HAMZAOUI JAVA J2EE FULL STACK
Introduction JavaEE
cours-gratuit.com--id-1964.pdf
Formation JAVA/J2EE
Archi tech 2010-09-13
Java j2ee
Mémoire de Licence, site web dynamique sous JEE, application aux entreprises ...
Présentation de JEE et de son écosysteme
Cours d'introduction à la programmation j2ee donc java 2ee
Présentation PFE Module Article GPAO
01_Introduction_a_JEE.pdf
JavaEEGibello.ppt
Entreprise Java Beans (EJB)
Saas Libre
Support cours j2_ee
#5 Java EE5 Client Lourd et Smart Client
Javavs net
Cv Moez HAMZAOUI JAVA J2EE FULL STACK

Plus de José Paumard (20)

PDF
Loom Virtual Threads in the JDK 19
PDF
From Java 11 to 17 and beyond.pdf
PDF
The Future of Java: Records, Sealed Classes and Pattern Matching
PDF
Deep Dive Java 17 Devoxx UK
PDF
Designing functional and fluent API: application to some GoF patterns
PDF
The Sincerest Form of Flattery
PPTX
The Sincerest Form of Flattery
PDF
Designing functional and fluent API: example of the Visitor Pattern
PDF
Construire son JDK en 10 étapes
PDF
Java Keeps Throttling Up!
PDF
Lambdas and Streams Master Class Part 2
PDF
Lambda and Stream Master class - part 1
PDF
Asynchronous Systems with Fn Flow
PDF
Java Full Throttle
PDF
JAX-RS and CDI Bike the (Reactive) Bridge
PDF
Collectors in the Wild
PDF
Streams in the wild
PDF
JAX RS and CDI bike the reactive bridge
PDF
Free your lambdas
PDF
L'API Collector dans tous ses états
Loom Virtual Threads in the JDK 19
From Java 11 to 17 and beyond.pdf
The Future of Java: Records, Sealed Classes and Pattern Matching
Deep Dive Java 17 Devoxx UK
Designing functional and fluent API: application to some GoF patterns
The Sincerest Form of Flattery
The Sincerest Form of Flattery
Designing functional and fluent API: example of the Visitor Pattern
Construire son JDK en 10 étapes
Java Keeps Throttling Up!
Lambdas and Streams Master Class Part 2
Lambda and Stream Master class - part 1
Asynchronous Systems with Fn Flow
Java Full Throttle
JAX-RS and CDI Bike the (Reactive) Bridge
Collectors in the Wild
Streams in the wild
JAX RS and CDI bike the reactive bridge
Free your lambdas
L'API Collector dans tous ses états

Dernier (20)

PPTX
Formation Equipement de protection .pptx
PPTX
Copie de Présentation Personal Branding J2025.pptx_20250610_120558_0000.pptx
PPTX
Le rendez-vous de l'été.pptx Film français
PPT
مبادئ و هدف الحركة الكشفية عرض تقديمي.ppt
PPTX
Informatique pour débutants niveau 1.pptx
PPTX
Hopital bonne sante.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PPT
Les moyens de transport-2023.ppt french language teaching ppt
PPTX
Marketing de l'Artisanat et la technique
PDF
Avis Digital Marketing Elite: Mon Retour d'Expérience Après 3 Mois d'Utilisation
PPTX
Le tableau volé.pptx Film françaisde pascal Bonitzer
PPT
diaporama pictogrammes de securité2.ppt
PPTX
le-present-de-lindicatif-ou-le-subjonctif-present-exercice-grammatical-feuill...
PPTX
Présentation Personal Branding J2025.pptx_20250218_132749_0000.pptx_20250610_...
PDF
_LEAN_MANAGEMENT_Am_lioration_continue_�_1724845102.pdf
PPTX
Séminaire protection des personnes vulnérables.pptx
PPTX
SESSION5-SUPPORT-DE-COURS-FLEC-(Future leader en énergie au Cameroun)-CECOSDA...
PDF
🎓 Le Secret des Profs Captivants - 💡 Pourquoi l’oral est stratégique en class...
PPTX
SESSION2-SUPPORT-DE-COURS-FLEC-(Future leader en énergie au Cameroun)-CECOSDA...
PDF
Referentiel des metiers cadres dans la banque
PPTX
Fondamentaux du LMD.pptx pour les etudiants
Formation Equipement de protection .pptx
Copie de Présentation Personal Branding J2025.pptx_20250610_120558_0000.pptx
Le rendez-vous de l'été.pptx Film français
مبادئ و هدف الحركة الكشفية عرض تقديمي.ppt
Informatique pour débutants niveau 1.pptx
Hopital bonne sante.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Les moyens de transport-2023.ppt french language teaching ppt
Marketing de l'Artisanat et la technique
Avis Digital Marketing Elite: Mon Retour d'Expérience Après 3 Mois d'Utilisation
Le tableau volé.pptx Film françaisde pascal Bonitzer
diaporama pictogrammes de securité2.ppt
le-present-de-lindicatif-ou-le-subjonctif-present-exercice-grammatical-feuill...
Présentation Personal Branding J2025.pptx_20250218_132749_0000.pptx_20250610_...
_LEAN_MANAGEMENT_Am_lioration_continue_�_1724845102.pdf
Séminaire protection des personnes vulnérables.pptx
SESSION5-SUPPORT-DE-COURS-FLEC-(Future leader en énergie au Cameroun)-CECOSDA...
🎓 Le Secret des Profs Captivants - 💡 Pourquoi l’oral est stratégique en class...
SESSION2-SUPPORT-DE-COURS-FLEC-(Future leader en énergie au Cameroun)-CECOSDA...
Referentiel des metiers cadres dans la banque
Fondamentaux du LMD.pptx pour les etudiants

Déploiement d'une application Java EE dans Azure

  • 1. Déployer une application Java EE dans Azure José Paumard @JosePaumard Sébastien Pertus @SebastienPertus
  • 2. tech.days 2015#mstechdays #JEEAzure #JEEAzure Déployer une application Java EE dans Azure
  • 3. tech.days 2015#mstechdays #JEEAzure  Podcast « les casts codeurs » http://lescastcodeurs.com/2014/10/26/lcc-111-interview-sur-microsoft- azure-avec-patrick-chanezon-et-benjamin-guinebertiere/  MOOC sur MVA http://www.microsoftvirtualacademy.com/training-courses/deploiement- application-java-dans-microsoft-azure  Patterns ! https://github.com/Azure/azure-sdk-for-java Déployer une application Java EE dans Azure
  • 4. tech.days 2015#mstechdays #JEEAzure  Pourquoi vouloir déployer une application Java EE dans Azure ? Déployer une application Java EE dans Azure
  • 5. tech.days 2015#mstechdays #JEEAzure  Pourquoi vouloir déployer une application Java EE dans Azure ? Déployer une application Java EE dans Azure
  • 6. tech.days 2015#mstechdays #JEEAzure  Pour une application Java EE : Déployer une application Java EE dans Azure
  • 7. tech.days 2015#mstechdays #JEEAzure  Outils de développement pour le « Javaiste »  IHM de gestion d’Azure, configuration, monitoring  Gestion de données structurées / non structurées  Application jouet  Modes de déploiement de l’application  Démo de l’application  Q / R Déployer une application Java EE dans Azure
  • 8. tech.days 2015#mstechdays #JEEAzure  Eclipse Java EE « classique »  + plugin spécifique Azure  Ressource Github https://github.com/azure Déployer une application Java EE dans Azure
  • 9. tech.days 2015#mstechdays #JEEAzure  Java EE = jeu de spécifications  Java EE = du papier !  Du papier + une implémentation de référence  JPA → EclipseLink  JAX-RS → Jersey  JSF → Mojara Déployer une application Java EE dans Azure
  • 10. tech.days 2015#mstechdays #JEEAzure  Organisation Déployer une application Java EE dans Azure Portable extensions JSP 2.3 JSF 2.2 JAX RS 2 EL 3 Servlet 3.1 Managed Beans 1.0 EJB 3.2 JCA 1.7 JPA 2.1 JTA 2.1 JMS 2.0 Interceptors 1.1 CDI 1.1 Common annotations 1.1 BeanValidation1.1 Concurrency utilities Batch applications Java API for JSON Java API for Websocket
  • 11. tech.days 2015#mstechdays #JEEAzure  Organisation Déployer une application Java EE dans Azure Portable extensions JSP 2.3 JSF 2.2 JAX RS 2 EL 3 Servlet 3.1 Managed Beans 1.0 EJB 3.2 JCA 1.7 JPA 2.1 JTA 2.1 JMS 2.0 Interceptors 1.1 CDI 1.1 Common annotations 1.1 BeanValidation1.1 Concurrency utilities Batch applications Java API for JSON Java API for Websocket
  • 12. tech.days 2015#mstechdays #JEEAzure  Organisation Déployer une application Java EE dans Azure Portable extensions JSP 2.3 JSF 2.2 JAX RS 2 EL 3 Servlet 3.1 Managed Beans 1.0 EJB 3.2 JCA 1.7 JPA 2.1 JTA 2.1 JMS 2.0 Interceptors 1.1 CDI 1.1 Common annotations 1.1 BeanValidation1.1 Concurrency utilities Batch applications Java API for JSON Java API for Websocket
  • 13. tech.days 2015#mstechdays #JEEAzure  Organisation Déployer une application Java EE dans Azure Portable extensions JSP 2.3 JSF 2.2 JAX RS 2 EL 3 Servlet 3.1 Managed Beans 1.0 EJB 3.2 JCA 1.7 JPA 2.1 JTA 2.1 JMS 2.0 Interceptors 1.1 CDI 1.1 Common annotations 1.1 Concurrency utilities Batch applications Java API for JSON Java API for Websocket BeanValidation1.1
  • 14. tech.days 2015#mstechdays #JEEAzure  JPA, EJB, JAX-RS, JAX-WS  JSF (si on l’utilise)  JMS ?  Java Mail ?  Journalisation ? → On peut utiliser directement des services cloud Déployer une application Java EE dans Azure
  • 15. tech.days 2015#mstechdays #JEEAzure SQL Database Déployer une application Java EE dans Azure
  • 16. tech.days 2015#mstechdays #JEEAzure  Deux versions de Java EE  Tomcat implémente le « web profile »  Wildfly (JBoss), Glassfish, Weblogic, Websphere, implémentent le « full profile » Déployer une application Java EE dans Azure
  • 17. tech.days 2015#mstechdays #JEEAzure  Accès aux données (JPA)  Couche de service (EJB)  Services REST (JAX-RS)  IHM (JSF)  Stockage d’images en BLOB Déployer une application Java EE dans Azure
  • 18. tech.days 2015#mstechdays #JEEAzure  « Entité » JPA Déployer une application Java EE dans Azure public class Musician { private String name ; private Date dateOfBirth ; private MusicType musicType ; // getters / setters }
  • 19. tech.days 2015#mstechdays #JEEAzure  « Entité » JPA Déployer une application Java EE dans Azure public class Musician { private Long id ; private String name ; private Date dateOfBirth ; private MusicType musicType ; // getters / setters }
  • 20. tech.days 2015#mstechdays #JEEAzure  « Entité » JPA Déployer une application Java EE dans Azure @Entity public class Musician { @Id private Long id ; private String name ; private Date dateOfBirth ; private MusicType musicType ; // getters / setters }
  • 21. tech.days 2015#mstechdays #JEEAzure  « Entité » JPA Déployer une application Java EE dans Azure @Entity public class Musician { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id ; private String name ; private Date dateOfBirth ; private MusicType musicType ; // getters / setters }
  • 22. tech.days 2015#mstechdays #JEEAzure  « Entité » JPA Déployer une application Java EE dans Azure @Entity public class Musician { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id ; private String name ; @Temporal(TemporalType.DATE) private Date dateOfBirth ; private MusicType musicType ; // getters / setters }
  • 23. tech.days 2015#mstechdays #JEEAzure  « Entité » JPA Déployer une application Java EE dans Azure @Entity public class Musician { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id ; @Column(name="name") private String name ; @Temporal(TemporalType.DATE) private Date dateOfBirth ; private MusicType musicType ; // getters / setters }
  • 24. tech.days 2015#mstechdays #JEEAzure  « Entité » JPA Déployer une application Java EE dans Azure @Entity public class Musician { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id ; @Column(name="name") private String name ; @Temporal(TemporalType.DATE) private Date dateOfBirth ; @Enumerated(EnumType.STRING) private MusicType musicType ; // getters / setters } public enum MusicType { JAZZ, CLASSICAL, ROCK, FOLK }
  • 25. tech.days 2015#mstechdays #JEEAzure  « Entité » JPA Déployer une application Java EE dans Azure @Entity public class Musician { @OneToMany private List<Instrument> instruments ; // getters / setters }
  • 26. tech.days 2015#mstechdays #JEEAzure  « Entité » JPA Déployer une application Java EE dans Azure @Entity public class Musician { @OneToMany private List<Instrument> instruments ; @ManyToMany private List<Orchestra> orchestras ; // getters / setters }
  • 27. tech.days 2015#mstechdays #JEEAzure  « Entité » JPA Déployer une application Java EE dans Azure @Entity public class Musician { @OneToMany private List<Instrument> instruments ; @ManyToMany private List<Orchestra> orchestras ; @Embedded private Address address ; // getters / setters }
  • 28. tech.days 2015#mstechdays #JEEAzure  « Entité » JPA Déployer une application Java EE dans Azure @Entity public class Musician { @OneToMany private List<Instrument> instruments ; @ManyToMany private List<Orchestra> orchestras ; @Embedded private Address address ; @Column(name="email", length=80) private String email ; // getters / setters }
  • 29. tech.days 2015#mstechdays #JEEAzure  « Entité » JPA Déployer une application Java EE dans Azure @Entity public class Musician { @OneToMany private List<Instrument> instruments ; @ManyToMany private List<Orchestra> orchestras ; @Embedded private Address address ; @Column(name="email", length=80) @Email private String email ; // getters / setters }
  • 30. tech.days 2015#mstechdays #JEEAzure  Gestion des relations *:*  Gestion de l’héritage  Génération du schéma  Adaptation à un schéma existant  Gestion des requêtes SQL / JPQL  Configuration par annotations ou XML Déployer une application Java EE dans Azure
  • 31. tech.days 2015#mstechdays #JEEAzureDéployer une application Java EE dans Azure  Injection / production @Stateless public class EntityManagerProvider { @PersistenceContext(unitName="DataService") private static EntityManager entityManager ; }
  • 32. tech.days 2015#mstechdays #JEEAzureDéployer une application Java EE dans Azure  Injection / production @Stateless public class EntityManagerProvider { @Produces @PersistenceContext(unitName="DataService") private static EntityManager entityManager ; }
  • 33. tech.days 2015#mstechdays #JEEAzureDéployer une application Java EE dans Azure  Injection / production @Stateless public class EntityManagerProvider { @Produces @PersistenceContext(unitName="DataService") private static EntityManager entityManager ; } @Stateless public class MusicianService { @Inject private EntityManager em ; }
  • 34. tech.days 2015#mstechdays #JEEAzureDéployer une application Java EE dans Azure  Injection / production @Stateless public class EntityManagerProvider { @Produces @DBProd @PersistenceContext(unitName="DataService") private static EntityManager entityManager ; } @Stateless public class MusicianService { @Inject @DBProd private EntityManager em ; }
  • 35. tech.days 2015#mstechdays #JEEAzure  Implémentées par des EJB Déployer une application Java EE dans Azure public class MusicianService { private EntityManager em ; public Musician findById(long id) { return em.find(Musician.class, id) ; } public List<Musician> findByName(String name) { Query q = em.createNamedQuery("Musician.byName") ; q.setParam("name", name) ; return q.getResultList() ; } }
  • 36. tech.days 2015#mstechdays #JEEAzure  Implémentées par des EJB Déployer une application Java EE dans Azure @Stateless public class MusicianService { @Inject private EntityManager em ; public Musician findById(long id) { return em.find(Musician.class, id) ; } public List<Musician> findByName(String name) { Query q = em.createNamedQuery("Musician.byName") ; q.setParam("name", name) ; return q.getResultList() ; } }
  • 37. tech.days 2015#mstechdays #JEEAzure  Implémentées par des EJB Déployer une application Java EE dans Azure @Stateless public class MusicianService { @Inject private EntityManager em ; @Transactionnal(TxType.SUPPORTS) public Musician findById(long id) { return em.find(Musician.class, id) ; } @Transactionnal(TxType.SUPPORTS) public List<Musician> findByName(String name) { Query q = em.createNamedQuery("Musician.byName") ; q.setParam("name", name) ; return q.getResultList() ; } }
  • 38. tech.days 2015#mstechdays #JEEAzure  JAX-RS Déployer une application Java EE dans Azure public class MusicianRestService { private MusicianService musicianService ; public Response getById( long id) { Musician musician = musicianService.findById(id) ; if (musician == null) { return Response.status(Status.NOT_FOUND).build() ; } else { return Response.ok(musician).build() ; } } }
  • 39. tech.days 2015#mstechdays #JEEAzure  JAX-RS Déployer une application Java EE dans Azure @Path("musician") public class MusicianRestService { @Inject private MusicianService musicianService ; @Path("{id}") // /musician/23 public Response getById( long id) { Musician musician = musicianService.findById(id) ; if (musician == null) { return Response.status(Status.NOT_FOUND).build() ; } else { return Response.ok(musician).build() ; } } }
  • 40. tech.days 2015#mstechdays #JEEAzure  JAX-RS Déployer une application Java EE dans Azure @Path("musician") public class MusicianRestService { @Inject private MusicianService musicianService ; @Path("{id}") // /musician/23 public Response getById(@PathParam("id") long id) { Musician musician = musicianService.findById(id) ; if (musician == null) { return Response.status(Status.NOT_FOUND).build() ; } else { return Response.ok(musician).build() ; } } }
  • 41. tech.days 2015#mstechdays #JEEAzure  JAX-RS Déployer une application Java EE dans Azure @Path("musician") public class MusicianRestService { @Inject private MusicianService musicianService ; @Path("{id}") // /musician/23 @GET public Response getById(@PathParam("id") long id) { Musician musician = musicianService.findById(id) ; if (musician == null) { return Response.status(Status.NOT_FOUND).build() ; } else { return Response.ok(musician).build() ; } } }
  • 42. tech.days 2015#mstechdays #JEEAzure  JAX-RS Déployer une application Java EE dans Azure @Path("musician") public class MusicianRestService { @Inject private MusicianService musicianService ; @Path("{id}") // /musician/23 @GET @Produces({MediaType.TEXT_XML, MediaType.APPLICATION_JSON}) public Response getById(@PathParam("id") long id) { Musician musician = musicianService.findById(id) ; if (musician == null) { return Response.status(Status.NOT_FOUND).build() ; } else { return Response.ok(musician).build() ; } } }
  • 43. tech.days 2015#mstechdays #JEEAzure  JAX-RS / JAXB Déployer une application Java EE dans Azure @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class Musician { @XmlAttribute private Long id ; @XmlElement private String name ; @XmlElement(name="date-of-birth") private Date dateOfBirth ; private MusicType musicType ; // getters / setters }
  • 44. tech.days 2015#mstechdays #JEEAzure  Présentation de l’IHM (MVC) Déployer une application Java EE dans Azure
  • 45. tech.days 2015#mstechdays #JEEAzure IaaS / PaaS Déployer une application Java EE dans Azure
  • 46. tech.days 2015#mstechdays #JEEAzureDéployer une application Java EE dans Azure
  • 47. tech.days 2015#mstechdays #JEEAzureDéployer une application Java EE dans Azure
  • 48. tech.days 2015#mstechdays #JEEAzure Application CRUD Service REST Déployer une application Java EE dans Azure
  • 49. tech.days 2015#mstechdays #JEEAzure  Azure offre une solution de déploiement d’application Java  Techniquement très complète et « à jour »  Commercialement supportée  Donc oui, évaluer Azure lorsque l’on veut déployer du Java dans le cloud, c’est intéressant ! Déployer une application Java EE dans Azure
  • 50. tech.days 2015#mstechdays #JEEAzure  Questions ? Commentaires ? Interrogations ? @JosePaumard @SebastienPertus Déployer une application Java EE dans Azure
  • 51. © 2015 Microsoft Corporation. All rights reserved. tech days• 2015 #mstechdays techdays.microsoft.fr