SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
TM
Enterprise JavaBeans
(EJBTM) 3.1
Kenneth Saks
Senior Staff Engineer
SUN Microsystems
EJB 3.1 Specification
• Goals
  > Continued focus on ease-of-use
  > New features
• JSR (Java Specification Request) 318
  > Part of Java EE 6
  > Java Persistence API will evolve separately ( JSR 317 )
  > Public Draft Released October 2008
• Caveat – APIs still subject to change


                                                         2
Ease of Use Improvements

•   Optional Local Business Interfaces
•   Simplified Packaging in .war
•   EJB “Lite”
•   Portable Global JNDI Names
•   Simplified Unit Testing




                                         3
Session Bean with “No-interface”
View
 @Stateless
 public class HelloBean {
     public String sayHello(String msg) {
         return “Hello “ + msg;
     }
 }


 // Client of HelloBean no-interface view
 @EJB HelloBean h;
 …
 h.sayHello(“bob”);


                                            4
Web/EJB Application in
    TM
Java EE Platform 5
           foo.ear                          foo.ear

                                    lib/foo_common.jar
  foo_web.war
  WEB-INF/web.xml                   com/acme/Foo.class
  WEB-INF/classes/
   com/acme/FooServlet.class        foo_web.war
  WEB-INF/classes
   com/acme/Foo.class          OR   WEB-INF/web.xml
                                    WEB-INF/classes/
                                     com/acme/FooServlet.class
  foo_ejb.jar
 com/acme/FooBean.class             foo_ejb.jar
 com/acme/Foo.class
                                    com/acme/FooBean.class


                                                                 5
Web/EJB Application in
    TM
Java EE Platform 6
                  foo.war

          WEB-INF/classes/
           com/acme/FooServlet.class

          WEB-INF/classes/
           com/acme/FooBean.class




                                       6
EJB “Lite” vs. Full EJB 3.1 API
EJB Lite                      Full = Lite + :
• Local Session Beans         • Message Driven Beans
• Annotations / ejb-jar.xml   • EJB Web Service
• CMT / BMT                     Endpoints
• Declarative Security        • RMI-IIOP
                                Interoperability
• Interceptors
                              • 2.x / 3.x Remote view
                              • 2.x Local view
                              • Timer Service
                              • CMP / BMP             7
Portable Global JNDI Names
 “java:global[/<app-name>]/<module-
 name>/<bean-name>”

 // Client in a Java EE container
 @EJB(mappedName=
      ”java:global/hello/HelloBean”)
 Hello hello;


 // Client in a Java SE environment
 Hello hello = (Hello) new InitialContext()
     lookup(“java:global/hello/HelloBean”);

                                         8
Enhanced Testing Support
 public class BankTester {

   public static void main(String[] args) {

       EJBContainer container =
          EJBContainer.createEJBContainer();

       // Acquire EJB component reference
       BankBean bank = (BankBean)container.getContext().
          lookup(“java:global/bank/BankBean”);

       testBank(bank);
       ...
       container.close();
   }

                                                   9
Example : Embeddable API (cont.)
 % java -classpath bankClient.jar :
                   bank.jar :
                   javaee.jar :
                   <vendor_rt>.jar

                   com.acme.BankTester




                                         10
New Features

•   Singletons
•   Application startup / shutdown callbacks
•   Calendar-based timer expressions
•   Automatic timer creation
•   Simple Asynchrony




                                               11
Simple Singleton
 @Singleton
 public class SharedBean {

     private SharedData shared;

     @PostConstruct private void init() {
       shared = ...;
     }

     public int getXYZ() {
       return shared.xyz;
     }

 }


                                            12
Singleton Client
 @Stateless
 public class FooBean {

     @EJB
     private SharedBean shared;

     public void foo() {
       int xyz = shared.getXYZ();
       ...
     }

 }




                                    13
Automatic Timer Creation
 @Stateless
 public class BankBean {

     @PersistenceContext EntityManager accountDB;
     @Resource javax.mail.Session mailSession;

     // Callback the 1st of each month at 8 a.m.

     @Schedule(hour=”8”, dayOfMonth=”1”)
     void sendMonthlyBankStatements() {
       ...
     }

 }




                                                    14
Simple Asynchrony
 @Stateless public class DocBean {

     @Resource SessionContext ctx;

     public void processDocument(Document document) {
       DocBean me = ctx.getBusinessObject(DocBean.class);
       me.doAnalysisA(document);
       me.doAnalysisB(document);
     }

     @Asynchronous public void doAnalysisA(Document d) {...}

     @Asynchronous public void doAnalysisB(Document d) {...}

 }


                                                            15
Asynchronous Operation Results --
Client
 @EJB Processor processor;

 Task task = new Task(...);

 Future<int> computeTask = processor.compute(task);

 ...

 int result = computeTask.get();




                                                 16
EJB 3.1 and Glassfish V3 Prelude
• Glassfish V3 is reference implementation for EJB 3.1
• V3 Prelude has preview implementations of these
  EJB 3.1 features :
  >   No-interface view
  >   .war packaging of stateless session beans
  >   Singletons
  >   Portable Global JNDI Names
• EJB 3.1 preview module available from Update Tool


                                                  17
For More Information
• JSR 318 Home : http://jcp.org/en/jsr/detail?id=318
  > Send comments to jsr-318-comments@jcp.org
• Blog : http://blogs.sun.com/kensaks/
• Reference Implementation : GlassFish project V3
  > http://glassfish.dev.java.net
  > ejb@glassfish.dev.java.net




                                                    18

Weitere ähnliche Inhalte

Was ist angesagt?

Jsp (java server page)
Jsp (java server page)Jsp (java server page)
Jsp (java server page)Chitrank Dixit
 
Jsp interview questions by java training center
Jsp interview questions by java training centerJsp interview questions by java training center
Jsp interview questions by java training centerMaheshit Jtc
 
Java EE 7 - Into the Cloud
Java EE 7 - Into the CloudJava EE 7 - Into the Cloud
Java EE 7 - Into the CloudMarkus Eisele
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)Manisha Keim
 
1 java servlets and jsp
1   java servlets and jsp1   java servlets and jsp
1 java servlets and jspAnkit Minocha
 
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...ddrschiw
 
java Servlet technology
java Servlet technologyjava Servlet technology
java Servlet technologyTanmoy Barman
 
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE  AND JSP PROCESSINGINTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE  AND JSP PROCESSING
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSINGAaqib Hussain
 
Jsp elements
Jsp elementsJsp elements
Jsp elementsNuha Noor
 

Was ist angesagt? (20)

Jsp chapter 1
Jsp chapter 1Jsp chapter 1
Jsp chapter 1
 
Wt unit 4
Wt unit 4Wt unit 4
Wt unit 4
 
Jsp (java server page)
Jsp (java server page)Jsp (java server page)
Jsp (java server page)
 
Jsp interview questions by java training center
Jsp interview questions by java training centerJsp interview questions by java training center
Jsp interview questions by java training center
 
Jsp Slides
Jsp SlidesJsp Slides
Jsp Slides
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
Java EE 7 - Into the Cloud
Java EE 7 - Into the CloudJava EE 7 - Into the Cloud
Java EE 7 - Into the Cloud
 
Wt unit 3
Wt unit 3 Wt unit 3
Wt unit 3
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
1 java servlets and jsp
1   java servlets and jsp1   java servlets and jsp
1 java servlets and jsp
 
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
 
java Servlet technology
java Servlet technologyjava Servlet technology
java Servlet technology
 
Java server pages
Java server pagesJava server pages
Java server pages
 
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE  AND JSP PROCESSINGINTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE  AND JSP PROCESSING
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
 
JSP Directives
JSP DirectivesJSP Directives
JSP Directives
 
Jsp elements
Jsp elementsJsp elements
Jsp elements
 
Jsp presentation
Jsp presentationJsp presentation
Jsp presentation
 
Jsp element
Jsp elementJsp element
Jsp element
 
Being agile with modern Java
Being agile with modern JavaBeing agile with modern Java
Being agile with modern Java
 

Ähnlich wie EJB 3.1 and GlassFish v3 Prelude

GlassFish Tool Bundle for Eclipse
GlassFish Tool Bundle for EclipseGlassFish Tool Bundle for Eclipse
GlassFish Tool Bundle for EclipseLudovic Champenois
 
What's New in Enterprise JavaBean Technology ?
What's New in Enterprise JavaBean Technology ?What's New in Enterprise JavaBean Technology ?
What's New in Enterprise JavaBean Technology ?Sanjeeb Sahoo
 
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010Arun Gupta
 
J2EE - Practical Overview
J2EE - Practical OverviewJ2EE - Practical Overview
J2EE - Practical OverviewSvetlin Nakov
 
EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)Montreal JUG
 
Java Enterprise Edition 6 Overview
Java Enterprise Edition 6 OverviewJava Enterprise Edition 6 Overview
Java Enterprise Edition 6 OverviewEugene Bogaart
 
Session 4 Tp4
Session 4 Tp4Session 4 Tp4
Session 4 Tp4phanleson
 
Skillwise EJB3.0 training
Skillwise EJB3.0 trainingSkillwise EJB3.0 training
Skillwise EJB3.0 trainingSkillwise Group
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerArun Gupta
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionJava EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionArun Gupta
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGArun Gupta
 
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureJava EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureArun Gupta
 

Ähnlich wie EJB 3.1 and GlassFish v3 Prelude (20)

GlassFish Tool Bundle for Eclipse
GlassFish Tool Bundle for EclipseGlassFish Tool Bundle for Eclipse
GlassFish Tool Bundle for Eclipse
 
What's New in Enterprise JavaBean Technology ?
What's New in Enterprise JavaBean Technology ?What's New in Enterprise JavaBean Technology ?
What's New in Enterprise JavaBean Technology ?
 
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010
 
J2 Ee Overview
J2 Ee OverviewJ2 Ee Overview
J2 Ee Overview
 
J2EE - Practical Overview
J2EE - Practical OverviewJ2EE - Practical Overview
J2EE - Practical Overview
 
Seam Glassfish Perspective
Seam Glassfish PerspectiveSeam Glassfish Perspective
Seam Glassfish Perspective
 
EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)
 
Java Enterprise Edition 6 Overview
Java Enterprise Edition 6 OverviewJava Enterprise Edition 6 Overview
Java Enterprise Edition 6 Overview
 
Session 4 Tp4
Session 4 Tp4Session 4 Tp4
Session 4 Tp4
 
GlassFish v3 : En Route Java EE 6
GlassFish v3 : En Route Java EE 6GlassFish v3 : En Route Java EE 6
GlassFish v3 : En Route Java EE 6
 
JBoss AS7 OSDC 2011
JBoss AS7 OSDC 2011JBoss AS7 OSDC 2011
JBoss AS7 OSDC 2011
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6
 
Skillwise EJB3.0 training
Skillwise EJB3.0 trainingSkillwise EJB3.0 training
Skillwise EJB3.0 training
 
Glass Fishv3 March2010
Glass Fishv3 March2010Glass Fishv3 March2010
Glass Fishv3 March2010
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More Power
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionJava EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
 
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureJava EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for future
 
EJB .
EJB .EJB .
EJB .
 
Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)
 

Mehr von Eduardo Pelegri-Llopart

Pelegri Desarrollando en una nueva era de software
Pelegri   Desarrollando en una nueva era de software Pelegri   Desarrollando en una nueva era de software
Pelegri Desarrollando en una nueva era de software Eduardo Pelegri-Llopart
 
Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015Eduardo Pelegri-Llopart
 
The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015Eduardo Pelegri-Llopart
 
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...Eduardo Pelegri-Llopart
 
What is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts YouWhat is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts YouEduardo Pelegri-Llopart
 
Ehcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEhcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEduardo Pelegri-Llopart
 

Mehr von Eduardo Pelegri-Llopart (20)

Juggling at freenome
Juggling   at freenomeJuggling   at freenome
Juggling at freenome
 
Csumb capstone-fall2016
Csumb capstone-fall2016Csumb capstone-fall2016
Csumb capstone-fall2016
 
Digital activitymanagement
Digital activitymanagementDigital activitymanagement
Digital activitymanagement
 
Progress next iot_pelegri
Progress next iot_pelegriProgress next iot_pelegri
Progress next iot_pelegri
 
Pelegri Desarrollando en una nueva era de software
Pelegri   Desarrollando en una nueva era de software Pelegri   Desarrollando en una nueva era de software
Pelegri Desarrollando en una nueva era de software
 
Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015
 
The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015
 
IOT - Presentation to PEP @ Progress
IOT - Presentation to PEP @ ProgressIOT - Presentation to PEP @ Progress
IOT - Presentation to PEP @ Progress
 
Node.js as an IOT Bridge
Node.js as an IOT BridgeNode.js as an IOT Bridge
Node.js as an IOT Bridge
 
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
 
What is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts YouWhat is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts You
 
Community Update 25 Mar2010 - English
Community Update 25 Mar2010 - EnglishCommunity Update 25 Mar2010 - English
Community Update 25 Mar2010 - English
 
GlassFish Community Update 25 Mar2010
GlassFish Community Update 25 Mar2010GlassFish Community Update 25 Mar2010
GlassFish Community Update 25 Mar2010
 
Glass Fish Portfolio C1 West V3.Mini
Glass Fish Portfolio C1 West V3.MiniGlass Fish Portfolio C1 West V3.Mini
Glass Fish Portfolio C1 West V3.Mini
 
Virtual Box Aquarium May09
Virtual Box Aquarium May09Virtual Box Aquarium May09
Virtual Box Aquarium May09
 
Introduction To Web Beans
Introduction To Web BeansIntroduction To Web Beans
Introduction To Web Beans
 
Ehcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEhcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage Patterns
 
OpenDS Primer Aquarium
OpenDS Primer AquariumOpenDS Primer Aquarium
OpenDS Primer Aquarium
 
Fuji Overview
Fuji OverviewFuji Overview
Fuji Overview
 
Nuxeo 5.2 Glassfish
Nuxeo 5.2 GlassfishNuxeo 5.2 Glassfish
Nuxeo 5.2 Glassfish
 

Kürzlich hochgeladen

UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 

Kürzlich hochgeladen (20)

UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 

EJB 3.1 and GlassFish v3 Prelude

  • 1. TM Enterprise JavaBeans (EJBTM) 3.1 Kenneth Saks Senior Staff Engineer SUN Microsystems
  • 2. EJB 3.1 Specification • Goals > Continued focus on ease-of-use > New features • JSR (Java Specification Request) 318 > Part of Java EE 6 > Java Persistence API will evolve separately ( JSR 317 ) > Public Draft Released October 2008 • Caveat – APIs still subject to change 2
  • 3. Ease of Use Improvements • Optional Local Business Interfaces • Simplified Packaging in .war • EJB “Lite” • Portable Global JNDI Names • Simplified Unit Testing 3
  • 4. Session Bean with “No-interface” View @Stateless public class HelloBean { public String sayHello(String msg) { return “Hello “ + msg; } } // Client of HelloBean no-interface view @EJB HelloBean h; … h.sayHello(“bob”); 4
  • 5. Web/EJB Application in TM Java EE Platform 5 foo.ear foo.ear lib/foo_common.jar foo_web.war WEB-INF/web.xml com/acme/Foo.class WEB-INF/classes/ com/acme/FooServlet.class foo_web.war WEB-INF/classes com/acme/Foo.class OR WEB-INF/web.xml WEB-INF/classes/ com/acme/FooServlet.class foo_ejb.jar com/acme/FooBean.class foo_ejb.jar com/acme/Foo.class com/acme/FooBean.class 5
  • 6. Web/EJB Application in TM Java EE Platform 6 foo.war WEB-INF/classes/ com/acme/FooServlet.class WEB-INF/classes/ com/acme/FooBean.class 6
  • 7. EJB “Lite” vs. Full EJB 3.1 API EJB Lite Full = Lite + : • Local Session Beans • Message Driven Beans • Annotations / ejb-jar.xml • EJB Web Service • CMT / BMT Endpoints • Declarative Security • RMI-IIOP Interoperability • Interceptors • 2.x / 3.x Remote view • 2.x Local view • Timer Service • CMP / BMP 7
  • 8. Portable Global JNDI Names “java:global[/<app-name>]/<module- name>/<bean-name>” // Client in a Java EE container @EJB(mappedName= ”java:global/hello/HelloBean”) Hello hello; // Client in a Java SE environment Hello hello = (Hello) new InitialContext() lookup(“java:global/hello/HelloBean”); 8
  • 9. Enhanced Testing Support public class BankTester { public static void main(String[] args) { EJBContainer container = EJBContainer.createEJBContainer(); // Acquire EJB component reference BankBean bank = (BankBean)container.getContext(). lookup(“java:global/bank/BankBean”); testBank(bank); ... container.close(); } 9
  • 10. Example : Embeddable API (cont.) % java -classpath bankClient.jar : bank.jar : javaee.jar : <vendor_rt>.jar com.acme.BankTester 10
  • 11. New Features • Singletons • Application startup / shutdown callbacks • Calendar-based timer expressions • Automatic timer creation • Simple Asynchrony 11
  • 12. Simple Singleton @Singleton public class SharedBean { private SharedData shared; @PostConstruct private void init() { shared = ...; } public int getXYZ() { return shared.xyz; } } 12
  • 13. Singleton Client @Stateless public class FooBean { @EJB private SharedBean shared; public void foo() { int xyz = shared.getXYZ(); ... } } 13
  • 14. Automatic Timer Creation @Stateless public class BankBean { @PersistenceContext EntityManager accountDB; @Resource javax.mail.Session mailSession; // Callback the 1st of each month at 8 a.m. @Schedule(hour=”8”, dayOfMonth=”1”) void sendMonthlyBankStatements() { ... } } 14
  • 15. Simple Asynchrony @Stateless public class DocBean { @Resource SessionContext ctx; public void processDocument(Document document) { DocBean me = ctx.getBusinessObject(DocBean.class); me.doAnalysisA(document); me.doAnalysisB(document); } @Asynchronous public void doAnalysisA(Document d) {...} @Asynchronous public void doAnalysisB(Document d) {...} } 15
  • 16. Asynchronous Operation Results -- Client @EJB Processor processor; Task task = new Task(...); Future<int> computeTask = processor.compute(task); ... int result = computeTask.get(); 16
  • 17. EJB 3.1 and Glassfish V3 Prelude • Glassfish V3 is reference implementation for EJB 3.1 • V3 Prelude has preview implementations of these EJB 3.1 features : > No-interface view > .war packaging of stateless session beans > Singletons > Portable Global JNDI Names • EJB 3.1 preview module available from Update Tool 17
  • 18. For More Information • JSR 318 Home : http://jcp.org/en/jsr/detail?id=318 > Send comments to jsr-318-comments@jcp.org • Blog : http://blogs.sun.com/kensaks/ • Reference Implementation : GlassFish project V3 > http://glassfish.dev.java.net > ejb@glassfish.dev.java.net 18