SlideShare a Scribd company logo
Fun with EJB
                                      and OpenEJB

                          David Blevins
                          @dblevins
                          #OpenEJB




Friday, October 7, 2011
The Basics - History
                          • Timeline
                           • 1999 - Founded in Exoffice - EJB 1.1 level
                           • 2001 - Integrated in Apple’s WebObjects
                           • 2002 - Moved to SourceForge
                           • 2003 - Integrated in Apache Geronimo
                           • 2004 - Moved to Codehaus
                           • 2006 - Moved to Apache Incubator
                           • 2007 - Graduated Apache OpenEJB
                          • Specification involvement
                           • EJB 2.1 (Monson-Haefel)
                           • EJB 3.0 (Blevins)
                           • EJB 3.1 (Blevins)
                           • EJB 3.2 (Blevins)




                                                        2

Friday, October 7, 2011
Focuses since inception
                          • Always an Embeddable EJB Container
                            • Good idea for Embeddable Databases, good idea for us
                            • Our downfall in early 2000 -- people were not ready
                            • Our success after EJB 3.0
                          • No love for traditional Application Servers
                            • Don’t give up main(String[] args)
                          • Always doing the Opposite
                            • Instead of putting the Application in the Container, put the Container in
                              the Application
                          • What do you mean hard to test??
                            • Don’t blame EJB because your Server is hard to test
                            • In what way is mocking not writing an EJB container?




                                                          3

Friday, October 7, 2011
We were only
                          pretending to test




Friday, October 7, 2011
EJB Vision & Philosophy
                          • Misunderstood technology
                           • Many things people attribute to “EJB” are not part of EJB
                          • EJB can be light
                           • EJB as a concept is not heavy, implementations were heavy
                          • EJB can be simpler
                           • Though the API was cumbersome it could be improved
                          • EJB can be used for plain applications
                           • The portability concept can be flipped on end
                           • The flexability applications get also provides great flexability to the
                             container to do things differently yet not break compliance




                                                          5

Friday, October 7, 2011
There is no “heavy”
                             requirement




Friday, October 7, 2011
Show me the heavy




Friday, October 7, 2011
Friday, October 7, 2011
EJB.next and Java EE.next
                          • Promote @ManagedBean to a Session bean
                          • Break up EJB -- separate the toppings
                           • @TransactionManagement
                           • @ConcurrencyManagement
                           • @Schedule
                           • @RolesAllowed
                           • @Asynchronous
                          • Allow all annotations to be used as meta-annotations
                          • Modernize the Connector/MDB relationship
                          • Interceptor improvements
                          • Balance API
                           • Everything that can be turned on should be able to shut off
                          • Improve @ApplicationException


                                                         9

Friday, October 7, 2011
Interceptor -- Today
                              @InterceptorBinding
                          @Target(value = {ElementType.TYPE})
                          @Retention(RetentionPolicy.RUNTIME)
                          public @interface Log {
                          }

                          @Log
                          public class FooBean {

                              public void somethingCommon(){
                                //...

                              public void somethingImportant() {
                               //...

                              public void somethingNoteworthy() {
                                 //...
                          }

                          @Log
                          public class LoggingInterceptor {

                              private java.util.logging.Logger logger =
                                      java.util.logging.Logger.getLogger("theLogger");

                              @AroundInvoke
                              public Object intercept(InvocationContext context) throws Exception {
                                  logger.info("" + context.getMethod().getName());
                                  return context.proceed();
                              }
                          }




                                                                     10

Friday, October 7, 2011
Interceptor Improvements
                              @Log
                          public class FooBean {

                              public void somethingCommon(){
                                  //...
                              }

                              @Info
                              public void somethingImportant() {
                                  //...
                              }

                              @Fine
                              public void somethingNoteworthy() {
                                  //...
                              }
                          }




                                                               11

Friday, October 7, 2011
Interceptor Improvements
                              @Log
                          public class LoggingInterceptor {

                              private java.util.logging.Logger logger =
                                      java.util.logging.Logger.getLogger("theLogger");

                              @AroundInvoke
                              public Object finest(InvocationContext context) throws Exception {
                                  logger.finest("" + context.getMethod().getName());
                                  return context.proceed();
                              }

                              @Info
                              public Object info(InvocationContext context) throws Exception {
                                  logger.info("" + context.getMethod().getName());
                                  return context.proceed();
                              }

                              @Fine
                              public Object fine(InvocationContext context) throws Exception {
                                  logger.fine("" + context.getMethod().getName());
                                  return context.proceed();
                              }
                          }




                                                               12

Friday, October 7, 2011
Meta-Annotations
                              @RolesAllowed({"SuperUser", "AccountAdmin", "SystemAdmin"})
                          @Stereotype
                          @Target(METHOD)
                          @Retention(RUNTIME)
                          public interface Admins {}


                          @Schedule(second=”0”, minute=”0”, hour=”0”, month=”*”, dayOfWeek=”*”, year=”*”)
                          @Stereotype
                          @Target(METHOD)
                          @Retention(RUNTIME)
                          public @interface Hourly {}


                          @Schedule(second=”0”, minute=”0”, hour=”0”, month=”*”, dayOfMonth=”15,Last”, year=”*”)
                          @Stereotype
                          @Target(METHOD)
                          @Retention(RUNTIME)
                          public @interface BiMonthly {}

                          @Singleton
                          @TransactionManagement(CONTAINER)
                          @TransactionAttribute(REQUIRED)
                          @ConcurrencyManagement(CONTAINER)
                          @Lock(READ)
                          @Interceptors({LoggingInterceptor.class, StatisticsInterceptor.class})
                          @Stereotype
                          @Target(TYPE)
                          @Retention(RUNTIME)
                          public @interface SuperBean {}




                                                                  13

Friday, October 7, 2011
Meta-Annotations
                              @Singleton
                          @TransactionManagement(CONTAINER)
                          @TransactionAttribute(REQUIRED)
                          @ConcurrencyManagement(CONTAINER)
                          @Lock(READ)
                          @Interceptors({LoggingInterceptor.class, StatisticsInterceptor.class})
                          public class MyBean {

                              @Schedule(second=”0”, minute=”0”, hour=”0”, month=”*”, dayOfWeek=”*”, year=”*”)
                              public void runBatchJob() {
                                  //...
                              }

                              @Schedule(second=”0”, minute=”0”, hour=”0”, month=”*”, dayOfMonth=”15,Last”, year=”*”)
                              public void sendPaychecks() {
                                  //...
                              }
                              
                              @RolesAllowed({"SuperUser", "AccountAdmin", "SystemAdmin"})
                              public void deleteAccount(String accountId) {
                                  //...
                              }
                          }




                                                                  14

Friday, October 7, 2011
Meta-Annotations
                          @SuperBean
                          public class MyBean {

                              @Hourly
                              public void runBatchJob() {
                                  //...
                              }

                              @BiMonthly
                              public void sendPaychecks() {
                                  //...
                              }
                              
                              @Admin
                              public void deleteAccount(String accountId) {
                                  //...
                              }
                          }




                                                                  15

Friday, October 7, 2011
Testing




Friday, October 7, 2011
Embeded / Testing Principles
                          • Be as invisible as possible
                          • No special classloaders required
                          • No files
                            • All Configuration can be done in the test or via properties
                            • No logging files
                            • No database files (in memory db)
                          • No ports
                            • Remote EJB calls done with “intra-vm” server
                            • JMS done via embedded broker with local transport
                            • Database connections via embedded database
                          • No JavaAgent
                            • Avoidable if not using JPA or if using Hibernate as the provider
                            • OpenJPA to a limited extent



                                                          17

Friday, October 7, 2011
What can you test?
                          • EJBs
                           • @Stateless
                           • @Stateful
                           • @Singleton
                           • @MessageDriven
                           • @ManagedBean
                           • Interceptors
                           • Legacy EJB 2.x and earlier
                          • Views
                           • @Remote
                           • @Local
                           • @LocalBean
                           • @WebService (requires a port)




                                                          18

Friday, October 7, 2011
What can you test? (cont.)
                          • Container Provided resources
                           • DataSources
                           • EntityManagers and EntityManagerFactories
                           • JMS Topics/Queues
                           • WebServiceRefs
                           • Any Java EE Connector provided object
                          • Services
                           • Timers
                           • Transactions
                           • Security
                           • Asynchronous methods




                                                      19

Friday, October 7, 2011
What can’t you test?
                          • Servlets
                          • Filters
                          • Listeners
                          • JSPs
                          • JSF Managed Beans
                          • Non-EJB WebServices


                                          Hello, TomEE



                                                  20

Friday, October 7, 2011
Unique Testing Features
                          • Most spec complete embedded container
                          • Fast startup (1 - 2 seconds)
                          • Test case injection
                          • Overriding
                            • Configuration overriding
                            • Persistence Unit overriding
                            • Logging overriding
                          • Test centric-descriptors
                            • test-specific ejb-jar.xml or persistence.xml, etc.
                          • Validation
                            • Compiler-style output of application compliance issues
                            • Avoid multiple “fix, recompile, redeploy, fail, repeat" cycles
                          • Descriptor output -- great for xml overriding


                                                            21

Friday, October 7, 2011
Questions?




Friday, October 7, 2011
thank you!
                          openejb.apache.org




Friday, October 7, 2011

More Related Content

Viewers also liked

December 2014 Greater Boston Real Estate Market Trends Report
December 2014 Greater Boston Real Estate Market Trends ReportDecember 2014 Greater Boston Real Estate Market Trends Report
December 2014 Greater Boston Real Estate Market Trends Report
Unit Realty Group
 
Boston By The Numbers - Boston Housing Stock (Report)
Boston By The Numbers - Boston Housing Stock (Report)Boston By The Numbers - Boston Housing Stock (Report)
Boston By The Numbers - Boston Housing Stock (Report)
Unit Realty Group
 
March 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate
March 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate March 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate
March 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate
Unit Realty Group
 
Ryan rowleylegalpp
Ryan rowleylegalppRyan rowleylegalpp
Ryan rowleylegalpp
walgrowl
 
Ryan rowleylegalpp
Ryan rowleylegalppRyan rowleylegalpp
Ryan rowleylegalpp
walgrowl
 
February 2013's Monthly Indicators report - Boston Real Estate Market Trends
February 2013's Monthly Indicators report - Boston Real Estate Market TrendsFebruary 2013's Monthly Indicators report - Boston Real Estate Market Trends
February 2013's Monthly Indicators report - Boston Real Estate Market Trends
Unit Realty Group
 
February 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate
February 2013 Monthly Multi-family Housing Activity Report - Boston Real EstateFebruary 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate
February 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate
Unit Realty Group
 
Fun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJBFun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJB
Arun Gupta
 
Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Future of Java EE with Java SE 8
Future of Java EE with Java SE 8
Hirofumi Iwasaki
 
Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]
Ryan Cuprak
 
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
50 EJB 3 Best Practices in 50 Minutes - JavaOne 201450 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
Ryan Cuprak
 

Viewers also liked (11)

December 2014 Greater Boston Real Estate Market Trends Report
December 2014 Greater Boston Real Estate Market Trends ReportDecember 2014 Greater Boston Real Estate Market Trends Report
December 2014 Greater Boston Real Estate Market Trends Report
 
Boston By The Numbers - Boston Housing Stock (Report)
Boston By The Numbers - Boston Housing Stock (Report)Boston By The Numbers - Boston Housing Stock (Report)
Boston By The Numbers - Boston Housing Stock (Report)
 
March 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate
March 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate March 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate
March 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate
 
Ryan rowleylegalpp
Ryan rowleylegalppRyan rowleylegalpp
Ryan rowleylegalpp
 
Ryan rowleylegalpp
Ryan rowleylegalppRyan rowleylegalpp
Ryan rowleylegalpp
 
February 2013's Monthly Indicators report - Boston Real Estate Market Trends
February 2013's Monthly Indicators report - Boston Real Estate Market TrendsFebruary 2013's Monthly Indicators report - Boston Real Estate Market Trends
February 2013's Monthly Indicators report - Boston Real Estate Market Trends
 
February 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate
February 2013 Monthly Multi-family Housing Activity Report - Boston Real EstateFebruary 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate
February 2013 Monthly Multi-family Housing Activity Report - Boston Real Estate
 
Fun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJBFun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJB
 
Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Future of Java EE with Java SE 8
Future of Java EE with Java SE 8
 
Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]
 
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
50 EJB 3 Best Practices in 50 Minutes - JavaOne 201450 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
 

Similar to 2011 JavaOne Fun with EJB 3.1 and OpenEJB

2011 JavaOne EJB with Meta Annotations
2011 JavaOne EJB with Meta Annotations2011 JavaOne EJB with Meta Annotations
2011 JavaOne EJB with Meta Annotations
David Blevins
 
Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore
Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan GallimoreJava EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore
Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore
JAX London
 
2011 JavaOne Apache TomEE Java EE 6 Web Profile
2011 JavaOne Apache TomEE Java EE 6 Web Profile2011 JavaOne Apache TomEE Java EE 6 Web Profile
2011 JavaOne Apache TomEE Java EE 6 Web Profile
David Blevins
 
3D in the Browser via WebGL: It's Go Time
3D in the Browser via WebGL: It's Go Time 3D in the Browser via WebGL: It's Go Time
3D in the Browser via WebGL: It's Go Time
Pascal Rettig
 
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
devstonez
 
Introducing the Ceylon Project
Introducing the Ceylon ProjectIntroducing the Ceylon Project
Introducing the Ceylon Project
Michael Scovetta
 
MongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema DesignMongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema Design
DATAVERSITY
 
Javascript Views, Client-side or Server-side with NodeJS
Javascript Views, Client-side or Server-side with NodeJSJavascript Views, Client-side or Server-side with NodeJS
Javascript Views, Client-side or Server-side with NodeJS
Sylvain Zimmer
 
EJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionEJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another Introduction
Kelum Senanayake
 
GeoLinkedData
GeoLinkedDataGeoLinkedData
GeoLinkedData
Alexander De Leon
 
Geolinkeddata 07042011 1
Geolinkeddata 07042011 1Geolinkeddata 07042011 1
Geolinkeddata 07042011 1
Boris Villazón-Terrazas
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
WO Community
 
Jython 2.7 and techniques for integrating with Java - Frank Wierzbicki
Jython 2.7 and techniques for integrating with Java - Frank WierzbickiJython 2.7 and techniques for integrating with Java - Frank Wierzbicki
Jython 2.7 and techniques for integrating with Java - Frank Wierzbicki
fwierzbicki
 
JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011
Charles Nutter
 
Railsconf 2010
Railsconf 2010Railsconf 2010
Railsconf 2010
John Woodell
 
eZ Publish nextgen
eZ Publish nextgeneZ Publish nextgen
eZ Publish nextgen
Jérôme Vieilledent
 
Web micro-framework BATTLE!
Web micro-framework BATTLE!Web micro-framework BATTLE!
Web micro-framework BATTLE!
Richard Jones
 
Python - the basics
Python - the basicsPython - the basics
Python - the basics
University of Technology
 
Training python (new Updated)
Training python (new Updated)Training python (new Updated)
Training python (new Updated)
University of Technology
 
02 Objective C
02 Objective C02 Objective C
02 Objective C
Mahmoud
 

Similar to 2011 JavaOne Fun with EJB 3.1 and OpenEJB (20)

2011 JavaOne EJB with Meta Annotations
2011 JavaOne EJB with Meta Annotations2011 JavaOne EJB with Meta Annotations
2011 JavaOne EJB with Meta Annotations
 
Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore
Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan GallimoreJava EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore
Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore
 
2011 JavaOne Apache TomEE Java EE 6 Web Profile
2011 JavaOne Apache TomEE Java EE 6 Web Profile2011 JavaOne Apache TomEE Java EE 6 Web Profile
2011 JavaOne Apache TomEE Java EE 6 Web Profile
 
3D in the Browser via WebGL: It's Go Time
3D in the Browser via WebGL: It's Go Time 3D in the Browser via WebGL: It's Go Time
3D in the Browser via WebGL: It's Go Time
 
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
 
Introducing the Ceylon Project
Introducing the Ceylon ProjectIntroducing the Ceylon Project
Introducing the Ceylon Project
 
MongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema DesignMongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema Design
 
Javascript Views, Client-side or Server-side with NodeJS
Javascript Views, Client-side or Server-side with NodeJSJavascript Views, Client-side or Server-side with NodeJS
Javascript Views, Client-side or Server-side with NodeJS
 
EJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionEJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another Introduction
 
GeoLinkedData
GeoLinkedDataGeoLinkedData
GeoLinkedData
 
Geolinkeddata 07042011 1
Geolinkeddata 07042011 1Geolinkeddata 07042011 1
Geolinkeddata 07042011 1
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
 
Jython 2.7 and techniques for integrating with Java - Frank Wierzbicki
Jython 2.7 and techniques for integrating with Java - Frank WierzbickiJython 2.7 and techniques for integrating with Java - Frank Wierzbicki
Jython 2.7 and techniques for integrating with Java - Frank Wierzbicki
 
JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011
 
Railsconf 2010
Railsconf 2010Railsconf 2010
Railsconf 2010
 
eZ Publish nextgen
eZ Publish nextgeneZ Publish nextgen
eZ Publish nextgen
 
Web micro-framework BATTLE!
Web micro-framework BATTLE!Web micro-framework BATTLE!
Web micro-framework BATTLE!
 
Python - the basics
Python - the basicsPython - the basics
Python - the basics
 
Training python (new Updated)
Training python (new Updated)Training python (new Updated)
Training python (new Updated)
 
02 Objective C
02 Objective C02 Objective C
02 Objective C
 

More from David Blevins

DevNexus 2020 - Jakarta Messaging 3.x, Redefining JMS
DevNexus 2020 - Jakarta Messaging 3.x, Redefining JMSDevNexus 2020 - Jakarta Messaging 3.x, Redefining JMS
DevNexus 2020 - Jakarta Messaging 3.x, Redefining JMS
David Blevins
 
2019 JJUG CCC Stateless Microservice Security with MicroProfile JWT
2019 JJUG CCC Stateless Microservice Security with MicroProfile JWT2019 JJUG CCC Stateless Microservice Security with MicroProfile JWT
2019 JJUG CCC Stateless Microservice Security with MicroProfile JWT
David Blevins
 
2018 jPrime Deconstructing and Evolving REST Security
2018 jPrime Deconstructing and Evolving REST Security2018 jPrime Deconstructing and Evolving REST Security
2018 jPrime Deconstructing and Evolving REST Security
David Blevins
 
2018 Denver JUG Deconstructing and Evolving REST Security
2018 Denver JUG Deconstructing and Evolving REST Security2018 Denver JUG Deconstructing and Evolving REST Security
2018 Denver JUG Deconstructing and Evolving REST Security
David Blevins
 
2018 Boulder JUG Deconstructing and Evolving REST Security
2018 Boulder JUG Deconstructing and Evolving REST Security2018 Boulder JUG Deconstructing and Evolving REST Security
2018 Boulder JUG Deconstructing and Evolving REST Security
David Blevins
 
2018 JavaLand Deconstructing and Evolving REST Security
2018 JavaLand Deconstructing and Evolving REST Security2018 JavaLand Deconstructing and Evolving REST Security
2018 JavaLand Deconstructing and Evolving REST Security
David Blevins
 
2018 IterateConf Deconstructing and Evolving REST Security
2018 IterateConf Deconstructing and Evolving REST Security2018 IterateConf Deconstructing and Evolving REST Security
2018 IterateConf Deconstructing and Evolving REST Security
David Blevins
 
2018 SDJUG Deconstructing and Evolving REST Security
2018 SDJUG Deconstructing and Evolving REST Security2018 SDJUG Deconstructing and Evolving REST Security
2018 SDJUG Deconstructing and Evolving REST Security
David Blevins
 
2017 Devoxx MA Deconstructing and Evolving REST Security
2017 Devoxx MA Deconstructing and Evolving REST Security2017 Devoxx MA Deconstructing and Evolving REST Security
2017 Devoxx MA Deconstructing and Evolving REST Security
David Blevins
 
2017 JavaOne Deconstructing and Evolving REST Security
2017 JavaOne Deconstructing and Evolving REST Security2017 JavaOne Deconstructing and Evolving REST Security
2017 JavaOne Deconstructing and Evolving REST Security
David Blevins
 
2017 JCP EC: Configuration JSR
2017 JCP EC: Configuration JSR2017 JCP EC: Configuration JSR
2017 JCP EC: Configuration JSR
David Blevins
 
2017 dev nexus_deconstructing_rest_security
2017 dev nexus_deconstructing_rest_security2017 dev nexus_deconstructing_rest_security
2017 dev nexus_deconstructing_rest_security
David Blevins
 
2016 JavaOne Deconstructing REST Security
2016 JavaOne Deconstructing REST Security2016 JavaOne Deconstructing REST Security
2016 JavaOne Deconstructing REST Security
David Blevins
 
2015 JavaOne EJB/CDI Alignment
2015 JavaOne EJB/CDI Alignment2015 JavaOne EJB/CDI Alignment
2015 JavaOne EJB/CDI Alignment
David Blevins
 
JavaOne 2013 - Apache TomEE, Java EE Web Profile {and more} on Tomcat
JavaOne 2013 - Apache TomEE, Java EE Web Profile {and more} on TomcatJavaOne 2013 - Apache TomEE, Java EE Web Profile {and more} on Tomcat
JavaOne 2013 - Apache TomEE, Java EE Web Profile {and more} on Tomcat
David Blevins
 

More from David Blevins (15)

DevNexus 2020 - Jakarta Messaging 3.x, Redefining JMS
DevNexus 2020 - Jakarta Messaging 3.x, Redefining JMSDevNexus 2020 - Jakarta Messaging 3.x, Redefining JMS
DevNexus 2020 - Jakarta Messaging 3.x, Redefining JMS
 
2019 JJUG CCC Stateless Microservice Security with MicroProfile JWT
2019 JJUG CCC Stateless Microservice Security with MicroProfile JWT2019 JJUG CCC Stateless Microservice Security with MicroProfile JWT
2019 JJUG CCC Stateless Microservice Security with MicroProfile JWT
 
2018 jPrime Deconstructing and Evolving REST Security
2018 jPrime Deconstructing and Evolving REST Security2018 jPrime Deconstructing and Evolving REST Security
2018 jPrime Deconstructing and Evolving REST Security
 
2018 Denver JUG Deconstructing and Evolving REST Security
2018 Denver JUG Deconstructing and Evolving REST Security2018 Denver JUG Deconstructing and Evolving REST Security
2018 Denver JUG Deconstructing and Evolving REST Security
 
2018 Boulder JUG Deconstructing and Evolving REST Security
2018 Boulder JUG Deconstructing and Evolving REST Security2018 Boulder JUG Deconstructing and Evolving REST Security
2018 Boulder JUG Deconstructing and Evolving REST Security
 
2018 JavaLand Deconstructing and Evolving REST Security
2018 JavaLand Deconstructing and Evolving REST Security2018 JavaLand Deconstructing and Evolving REST Security
2018 JavaLand Deconstructing and Evolving REST Security
 
2018 IterateConf Deconstructing and Evolving REST Security
2018 IterateConf Deconstructing and Evolving REST Security2018 IterateConf Deconstructing and Evolving REST Security
2018 IterateConf Deconstructing and Evolving REST Security
 
2018 SDJUG Deconstructing and Evolving REST Security
2018 SDJUG Deconstructing and Evolving REST Security2018 SDJUG Deconstructing and Evolving REST Security
2018 SDJUG Deconstructing and Evolving REST Security
 
2017 Devoxx MA Deconstructing and Evolving REST Security
2017 Devoxx MA Deconstructing and Evolving REST Security2017 Devoxx MA Deconstructing and Evolving REST Security
2017 Devoxx MA Deconstructing and Evolving REST Security
 
2017 JavaOne Deconstructing and Evolving REST Security
2017 JavaOne Deconstructing and Evolving REST Security2017 JavaOne Deconstructing and Evolving REST Security
2017 JavaOne Deconstructing and Evolving REST Security
 
2017 JCP EC: Configuration JSR
2017 JCP EC: Configuration JSR2017 JCP EC: Configuration JSR
2017 JCP EC: Configuration JSR
 
2017 dev nexus_deconstructing_rest_security
2017 dev nexus_deconstructing_rest_security2017 dev nexus_deconstructing_rest_security
2017 dev nexus_deconstructing_rest_security
 
2016 JavaOne Deconstructing REST Security
2016 JavaOne Deconstructing REST Security2016 JavaOne Deconstructing REST Security
2016 JavaOne Deconstructing REST Security
 
2015 JavaOne EJB/CDI Alignment
2015 JavaOne EJB/CDI Alignment2015 JavaOne EJB/CDI Alignment
2015 JavaOne EJB/CDI Alignment
 
JavaOne 2013 - Apache TomEE, Java EE Web Profile {and more} on Tomcat
JavaOne 2013 - Apache TomEE, Java EE Web Profile {and more} on TomcatJavaOne 2013 - Apache TomEE, Java EE Web Profile {and more} on Tomcat
JavaOne 2013 - Apache TomEE, Java EE Web Profile {and more} on Tomcat
 

Recently uploaded

Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
Enterprise Knowledge
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
DanBrown980551
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024
Vadym Kazulkin
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
LizaNolte
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 

Recently uploaded (20)

Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 

2011 JavaOne Fun with EJB 3.1 and OpenEJB

  • 1. Fun with EJB and OpenEJB David Blevins @dblevins #OpenEJB Friday, October 7, 2011
  • 2. The Basics - History • Timeline • 1999 - Founded in Exoffice - EJB 1.1 level • 2001 - Integrated in Apple’s WebObjects • 2002 - Moved to SourceForge • 2003 - Integrated in Apache Geronimo • 2004 - Moved to Codehaus • 2006 - Moved to Apache Incubator • 2007 - Graduated Apache OpenEJB • Specification involvement • EJB 2.1 (Monson-Haefel) • EJB 3.0 (Blevins) • EJB 3.1 (Blevins) • EJB 3.2 (Blevins) 2 Friday, October 7, 2011
  • 3. Focuses since inception • Always an Embeddable EJB Container • Good idea for Embeddable Databases, good idea for us • Our downfall in early 2000 -- people were not ready • Our success after EJB 3.0 • No love for traditional Application Servers • Don’t give up main(String[] args) • Always doing the Opposite • Instead of putting the Application in the Container, put the Container in the Application • What do you mean hard to test?? • Don’t blame EJB because your Server is hard to test • In what way is mocking not writing an EJB container? 3 Friday, October 7, 2011
  • 4. We were only pretending to test Friday, October 7, 2011
  • 5. EJB Vision & Philosophy • Misunderstood technology • Many things people attribute to “EJB” are not part of EJB • EJB can be light • EJB as a concept is not heavy, implementations were heavy • EJB can be simpler • Though the API was cumbersome it could be improved • EJB can be used for plain applications • The portability concept can be flipped on end • The flexability applications get also provides great flexability to the container to do things differently yet not break compliance 5 Friday, October 7, 2011
  • 6. There is no “heavy” requirement Friday, October 7, 2011
  • 7. Show me the heavy Friday, October 7, 2011
  • 9. EJB.next and Java EE.next • Promote @ManagedBean to a Session bean • Break up EJB -- separate the toppings • @TransactionManagement • @ConcurrencyManagement • @Schedule • @RolesAllowed • @Asynchronous • Allow all annotations to be used as meta-annotations • Modernize the Connector/MDB relationship • Interceptor improvements • Balance API • Everything that can be turned on should be able to shut off • Improve @ApplicationException 9 Friday, October 7, 2011
  • 10. Interceptor -- Today @InterceptorBinding @Target(value = {ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface Log { } @Log public class FooBean {     public void somethingCommon(){       //...     public void somethingImportant() {      //...     public void somethingNoteworthy() {      //... } @Log public class LoggingInterceptor {     private java.util.logging.Logger logger =             java.util.logging.Logger.getLogger("theLogger");     @AroundInvoke     public Object intercept(InvocationContext context) throws Exception {         logger.info("" + context.getMethod().getName());         return context.proceed();     } } 10 Friday, October 7, 2011
  • 11. Interceptor Improvements @Log public class FooBean {     public void somethingCommon(){         //...     }     @Info     public void somethingImportant() {         //...     }     @Fine     public void somethingNoteworthy() {         //...     } } 11 Friday, October 7, 2011
  • 12. Interceptor Improvements @Log public class LoggingInterceptor {     private java.util.logging.Logger logger =             java.util.logging.Logger.getLogger("theLogger");     @AroundInvoke     public Object finest(InvocationContext context) throws Exception {         logger.finest("" + context.getMethod().getName());         return context.proceed();     }     @Info     public Object info(InvocationContext context) throws Exception {         logger.info("" + context.getMethod().getName());         return context.proceed();     }     @Fine     public Object fine(InvocationContext context) throws Exception {         logger.fine("" + context.getMethod().getName());         return context.proceed();     } } 12 Friday, October 7, 2011
  • 13. Meta-Annotations @RolesAllowed({"SuperUser", "AccountAdmin", "SystemAdmin"}) @Stereotype @Target(METHOD) @Retention(RUNTIME) public interface Admins {} @Schedule(second=”0”, minute=”0”, hour=”0”, month=”*”, dayOfWeek=”*”, year=”*”) @Stereotype @Target(METHOD) @Retention(RUNTIME) public @interface Hourly {} @Schedule(second=”0”, minute=”0”, hour=”0”, month=”*”, dayOfMonth=”15,Last”, year=”*”) @Stereotype @Target(METHOD) @Retention(RUNTIME) public @interface BiMonthly {} @Singleton @TransactionManagement(CONTAINER) @TransactionAttribute(REQUIRED) @ConcurrencyManagement(CONTAINER) @Lock(READ) @Interceptors({LoggingInterceptor.class, StatisticsInterceptor.class}) @Stereotype @Target(TYPE) @Retention(RUNTIME) public @interface SuperBean {} 13 Friday, October 7, 2011
  • 14. Meta-Annotations @Singleton @TransactionManagement(CONTAINER) @TransactionAttribute(REQUIRED) @ConcurrencyManagement(CONTAINER) @Lock(READ) @Interceptors({LoggingInterceptor.class, StatisticsInterceptor.class}) public class MyBean {     @Schedule(second=”0”, minute=”0”, hour=”0”, month=”*”, dayOfWeek=”*”, year=”*”)     public void runBatchJob() {         //...     }     @Schedule(second=”0”, minute=”0”, hour=”0”, month=”*”, dayOfMonth=”15,Last”, year=”*”)     public void sendPaychecks() {         //...     }          @RolesAllowed({"SuperUser", "AccountAdmin", "SystemAdmin"})     public void deleteAccount(String accountId) {         //...     } } 14 Friday, October 7, 2011
  • 15. Meta-Annotations @SuperBean public class MyBean {     @Hourly     public void runBatchJob() {         //...     }     @BiMonthly     public void sendPaychecks() {         //...     }          @Admin     public void deleteAccount(String accountId) {         //...     } } 15 Friday, October 7, 2011
  • 17. Embeded / Testing Principles • Be as invisible as possible • No special classloaders required • No files • All Configuration can be done in the test or via properties • No logging files • No database files (in memory db) • No ports • Remote EJB calls done with “intra-vm” server • JMS done via embedded broker with local transport • Database connections via embedded database • No JavaAgent • Avoidable if not using JPA or if using Hibernate as the provider • OpenJPA to a limited extent 17 Friday, October 7, 2011
  • 18. What can you test? • EJBs • @Stateless • @Stateful • @Singleton • @MessageDriven • @ManagedBean • Interceptors • Legacy EJB 2.x and earlier • Views • @Remote • @Local • @LocalBean • @WebService (requires a port) 18 Friday, October 7, 2011
  • 19. What can you test? (cont.) • Container Provided resources • DataSources • EntityManagers and EntityManagerFactories • JMS Topics/Queues • WebServiceRefs • Any Java EE Connector provided object • Services • Timers • Transactions • Security • Asynchronous methods 19 Friday, October 7, 2011
  • 20. What can’t you test? • Servlets • Filters • Listeners • JSPs • JSF Managed Beans • Non-EJB WebServices Hello, TomEE 20 Friday, October 7, 2011
  • 21. Unique Testing Features • Most spec complete embedded container • Fast startup (1 - 2 seconds) • Test case injection • Overriding • Configuration overriding • Persistence Unit overriding • Logging overriding • Test centric-descriptors • test-specific ejb-jar.xml or persistence.xml, etc. • Validation • Compiler-style output of application compliance issues • Avoid multiple “fix, recompile, redeploy, fail, repeat" cycles • Descriptor output -- great for xml overriding 21 Friday, October 7, 2011
  • 23. thank you! openejb.apache.org Friday, October 7, 2011