DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > EJB 3.1 to Release on Third Quarter of 2009

EJB 3.1 to Release on Third Quarter of 2009

Felipe Gaúcho user avatar by
Felipe Gaúcho
·
Jun. 03, 09 · Java Zone · Interview
Like (0)
Save
Tweet
5.09K Views

Join the DZone community and get the full member experience.

Join For Free

After the impressive General Session, I attended a session about EJB 3.1 - proposed to release on the third quarter of this year. There are tons of blogs with complete overview of the new EJB, but here are the fresh highlights from the session:

  1. Optional local interface business interface

  2. Packaging

    • We don't need to create EAR every time anymore
    • EJB 3.1 can be deployed directly inside the WAR file

    • ejb-jar.xml is optional

    • All resources are shared in the WAR file

  3. EJB 3.1 Lite API

    • Web profile (injection like Spring does)
    • No portability issue, works in Tomcat and Java EE containers, for example.

    • only available for local EJBs (no MDB, ws-endpoints, etc). Supposed to be a simplified and lightweight model.

  4. Portable Global JNDI names

    • The lookup mechanism will look for the local and remote interface (remember, the local is optional)
    • Improve the portability of remote Java Clients.

  5. Portable Naming Syntax: every session bean gets the following entries:

    • The lookup mechanism will look for the local and remote interface (remember, the local is optional)

    • Globally unique name:

    • Unique name within the same application.

    • Unique name within defining module.

  6. Testing EJBs

    • Embedded Container can be used in test classes:

      EJBContainer container = EJBContainer.createEJBContainer();
      container.getContext().lookup("java:global:/module/BankBean");

       

       

  7. Embeddable API

    • The code running in the Client side will have the same component behaviour /life cycle of the code running on the server side.

  8. New features

    1. Singletons - designed for efficient concurrent access.

      • Single Thread (default)

        @Singleton
        @Lock(READ)
        public class SharedBean {
        ...
        @Lock(READ)
        @AccessTimeout(value=1, ...)
        public void timeoutMethod(...) {
        }

        @Lock(WRITE)
        public void update(...) {
        }
        }

         

      • Container Managed Concurrency (method-level locking)
      • Bean Managed Concurrency (all concurrent invocations have access to bean instance). The developer is responsible to care about concurrency in this mode.
    2. Startup / Shutdown callbacks.

      • Startup: @Startup + @PostConstruct

      • Shutdown: @PreDestroy.

    3. Calendar-based timers: timeouts, automatic timer creation, non.persistent timers. A cron-like semantics with improved syntax. Automatic timer creation can be specified via annotations or deployment descriptor (ejb-jar.xml).

    4. @Asynchronous session bean invocations. Fire and Forget or async results via Future<V>. It is not available for MDB (for obvious reasons). Best ever delivers, better than JMS for EJB calls (persitent delivery guarantee not included in the spec).

      @Asynchronous
      public Future compute(Task t) { ... }

       

    5.  No transaction propagation from caller to callee.

    6. JAX-RS integration (RESTful). Instead of using Jersey or other technology to expose a RESTful web-service, we can just expose the bean on the HTTP interface. That's really cool and IMO it will save a lot of boiler plate code.

From http://weblogs.java.net/blog/felipegaucho
Release (agency)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How To Integrate Event Streaming Into Your Applications
  • How to Determine if Microservices Architecture Is Right for Your Business?
  • Waterfall Vs. Agile Methodologies: Which Is Best For Project Management?
  • Choosing Between REST and GraphQL

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo