Posts Tagged ‘JavaEE7’
[DevoxxBE2013] Part 1: Java EE 7: What’s New in the Java EE Platform
Antonio Goncalves and Arun Gupta, luminaries in Java EE advocacy, deliver a comprehensive exploration of Java EE 7’s advancements, blending simplification with expanded capabilities. Antonio, a senior architect and author of Beginning Java EE 6 Platform with GlassFish 3, collaborates with Arun, Red Hat’s Director of Developer Advocacy and former Java EE pioneer at Sun Microsystems, to unveil WebSocket, JSON processing, and enhanced CDI and JTA features. Their session, rich with demos, highlights how these innovations bolster HTML5 support and streamline enterprise development.
Java EE 7, they assert, refines container services while embracing modern web paradigms. From WebSocket’s real-time communication to CDI’s unified bean management, they showcase practical integrations, ensuring developers can craft scalable, responsive applications.
WebSocket for Real-Time Communication
Antonio introduces WebSocket, a cornerstone for HTML5’s bidirectional connectivity. He demonstrates @ServerEndpoint-annotated classes, crafting a chat application where messages flow instantly, bypassing HTTP’s overhead.
Arun details encoders/decoders, transforming POJOs to wire-ready text or binary frames, streamlining data exchange for real-time apps like live dashboards.
JSON Processing and JAX-RS Enhancements
Arun explores JSON-P (JSR 353), parsing and generating JSON with a fluid API. He demos building JSON objects from POJOs, integrating with JAX-RS’s HTTP client for seamless RESTful interactions.
This synergy, Antonio notes, equips developers to handle data-driven web applications, aligning with HTML5’s data-centric demands.
CDI and Managed Bean Alignment
Antonio unveils CDI’s evolution, unifying managed beans with injectable interceptors. He showcases constructor injection and method-level validation, simplifying dependency management across EJBs and servlets.
Arun highlights JTA’s declarative transactions, enabling @Transactional annotations to streamline database operations, reducing boilerplate.
Simplified JMS and Batch Processing
Arun introduces JMS 2.0’s simplified APIs, demonstrating streamlined message publishing. The new Batch API (JSR 352), Antonio adds, orchestrates chunk-based processing for large datasets, with demos showcasing job definitions.
These enhancements, they conclude, enhance usability, pruning legacy APIs while empowering enterprise scalability.
Resource Definitions and Community Engagement
Antonio details expanded resource definitions, configuring data sources via annotations. Arun encourages JCP involvement, noting Java EE 8’s community-driven roadmap.
Their demos—leveraging GlassFish—illustrate practical adoption, inviting developers to shape future specifications.
Links:
[DevoxxBE2013] Java EE 7’s Java API for WebSocket
Arun Gupta, Director of Developer Advocacy at Red Hat, unveils the transformative capabilities of the Java API for WebSocket in Java EE 7. A veteran of Sun Microsystems and Oracle, Arun has championed Java technologies globally, authoring extensive blogs and a best-selling book. His session explores WebSocket’s role in enabling efficient, bidirectional communication, eliminating the need for long polling or AJAX. Through live demonstrations, he illustrates server-side endpoints and client-side integrations, showcasing how this API empowers developers to craft responsive web and rich client applications.
WebSocket, a cornerstone of HTML5, facilitates real-time data exchange over a single TCP connection. Arun highlights its scalability, with GlassFish handling thousands of connections, and introduces tools like Autobahn for compliance testing. This API positions Java developers to build dynamic, scalable systems that complement RESTful architectures.
WebSocket Fundamentals and API Design
Arun introduces WebSocket’s departure from HTTP’s request-response model, leveraging a single, persistent connection. Using annotations like @ServerEndpoint, he demonstrates creating a chat application where messages flow instantly. The client API, accessible from browsers or Java applications, enables seamless integration.
This simplicity, Arun notes, reduces latency, making WebSocket ideal for real-time applications like live updates or collaborative tools.
Server-Side Scalability and Performance
Scalability is a key strength, Arun explains, with WebSocket supporting millions of file descriptors on Linux. He recounts Oracle’s GlassFish tests, achieving robust performance with thousands of connections. The Autobahn test suite, he suggests, validates compliance and load capacity.
Forthcoming WildFly tests, Arun adds, will further benchmark performance, ensuring reliability in production environments.
Complementing REST with WebSocket
Arun clarifies that WebSocket complements JAX-RS, not replaces it. He illustrates a hybrid design: REST for stateless queries, WebSocket for real-time updates. A stock ticker demo shows prices pushed to clients, blending both paradigms.
This synergy, Arun argues, enhances application flexibility, with Java EE 8 discussions exploring further integrations.
Community Engagement and Future Directions
Arun encourages joining Java EE expert groups, noting their transparent processes. Recent community gatherings, he mentions, discussed enhancing WebSocket’s role. He advocates contributing to shape Java EE 8, ensuring it meets developer needs.
This collaborative approach, Arun emphasizes, drives innovation, aligning WebSocket with evolving web standards.
Links:
[DevoxxFR2013] Java EE 7 in Detail
Lecturer
David Delabassee is a Principal Product Manager in Oracle’s GlassFish team. Previously at Sun for a decade, he focused on end-to-end Java, related technologies, and tools. Based in Belgium, he contributes to Devoxx Belgium’s steering committee.
Abstract
David Delabassee’s overview details Java EE 7’s innovations, emphasizing developer simplicity and HTML5 support. Covering WebSockets, JSON-P, JAX-RS 2, JMS 2, concurrency, caching, and batch processing, he demonstrates features via GlassFish. The analysis explores alignments with modern needs like cloud and modularity, implications for productivity, and forward compatibility.
Evolution and Key Themes: Simplifying Development and Embracing Modern Web
Delabassee notes Java EE 6’s (2009) popularity, with widespread server adoption. Java EE 7, nearing finalization, builds on this via JCP, comprising 13 updated, 4 new specs.
Themes: ease of development (defaults, pruning), web enhancements (HTML5 via WebSockets), alignment with trends (cloud, multi-tenancy). Pruning removes outdated techs like EJB CMP; new APIs address gaps.
GlassFish 4, the reference implementation, enables early testing. Delabassee demos features, stressing community feedback.
Core API Enhancements: WebSockets, JSON, and REST Improvements
WebSocket (JSR 356): Enables full-duplex, bidirectional communication over single TCP. Annotate endpoints (@ServerEndpoint), handle messages (@OnMessage).
@ServerEndpoint("/echo")
public class EchoEndpoint {
@OnMessage
public void echo(String message, Session session) {
session.getBasicRemote().sendText(message);
}
}
JSON-P (JSR 353): Parsing/processing API with streaming, object models. Complements JAX-RS for RESTful services.
JAX-RS 2 (JSR 339): Client API, filters/interceptors, async support. Client example:
Client client = ClientBuilder.newClient();
WebTarget target = client.target("http://example.com");
Response response = target.request().get();
These foster efficient, modern web apps.
Messaging and Concurrency: JMS 2 and Utilities for EE
JMS 2 simplifies: annotation-based injection (@JMSConnectionFactory), simplified API for sending/receiving.
@Inject
JMSContext context;
@Resource(lookup="myQueue")
Queue queue;
context.send(queue, "message");
Concurrency Utilities (JSR 236): Managed executors, scheduled tasks in EE context. Propagate context to threads, avoiding direct Thread creation.
Batch Applications (JSR 352): Framework for chunk/step processing, job management. XML-defined jobs with readers, processors, writers.
Additional Features and Future Outlook: Caching, CDI, and Java EE 8
Though JCache (JSR 107) deferred, it enables standardized distributed caching, usable on EE 7.
CDI 1.1 enhances: @Vetoed for exclusions, alternatives activation.
Java EE 8 plans: modularity, cloud (PaaS/SaaS), further HTML5. Community shapes via surveys.
Delabassee urges Adopt-a-JSR participation for influence.
Implications for Enterprise Development: Productivity and Adaptability
Java EE 7 boosts productivity via simplifications, aligns with web/cloud via new APIs. Demos show practical integration, like WebSocket chats or batch jobs.
Challenges: Learning curve for new features; benefits outweigh via robust, scalable apps.
Forward, EE 7 paves for EE 8’s evolutions, ensuring Java’s enterprise relevance.
Links:
[DevoxxBE2012] Spring 3.2 and 3.2 Themes and Trends
In a dynamic presentation, Josh Long, a prominent Spring developer advocate and author, delved into the evolving landscape of the Spring Framework. As someone deeply embedded in the Spring ecosystem, Josh highlighted how Spring continues to address modern development challenges while maintaining its core principles. He began by recapping the framework’s foundational aspects, emphasizing its role in promoting clean, extensible code without unnecessary reinvention.
Josh explained that Spring operates as a lightweight dependency injection container, layered with vertical technologies for diverse needs like mobile development, big data handling, and web applications. This decoupling from underlying infrastructure enables seamless transitions between environments, from traditional servers to cloud platforms. He noted the increasing complexity in data stores, caching solutions, and client interfaces, underscoring Spring’s relevance in today’s fragmented tech world. By focusing on dependency injection, aspect-oriented programming, and portable service abstractions, Spring empowers developers to build robust, maintainable systems.
Transitioning to recent advancements, Josh reviewed Spring 3.1, released in December 2011, which introduced features like environment profiles and Java-based configuration. These enhancements facilitate tailored bean activations across development stages, simplifying configurations that diverge between local setups and production clouds. He illustrated this with examples of data sources, showing how profiles partition configurations effectively.
Moreover, Josh discussed the caching abstraction in Spring 3.1, which provides a unified SPI for various caches like EHCache and Redis. This abstraction, combined with annotations for cache management, streamlines performance optimizations without locking developers into specific implementations.
Core Refinements in Spring 3.2
Shifting focus to Spring 3.2, slated for release by year’s end, Josh outlined its core refinements. Building on Java 7, it incorporates asynchronous support from Servlet 3.0, enabling efficient handling of long-running tasks in web applications. He demonstrated this with controller methods returning Callable or DeferredResult, allowing requests and responses to process in separate threads, enhancing scalability.
Josh also introduced the Spring MVC Test Framework, a tool for unit testing controllers with mocked servlet APIs. This framework, revamped for 3.2, integrates seamlessly with existing test contexts, promoting better code quality through isolated testing.
Additionally, upgrades to the Spring Expression Language (SpEL) and backported features from 3.1.x bolster the framework’s expressiveness and compatibility. Josh emphasized that these changes maintain Spring’s low-risk upgrade path, ensuring stability for enterprise adopters.
Looking Ahead to Spring 3.3
Josh then previewed Spring 3.3, expected in late 2013, which promises substantial innovations. Central to this release is support for Java SE 8 features, including lambdas, which align naturally with Spring’s single abstract method interfaces. He showcased how lambdas simplify callbacks in components like JdbcTemplate, reducing boilerplate code.
Furthermore, Josh touched on enhanced Groovy support and the integration of the Grails Bean Builder, expanding Spring’s appeal for dynamic languages. The release will also track Java EE 7 APIs, such as JCache 1.0 and JMS 2.0, with annotation-centric endpoints for message-driven architectures.
WebSocket support, crucial for real-time web applications, will be fully integrated into Spring MVC, complementing existing messaging capabilities in Spring Integration.
Strategic Motivations and Community Impact
Throughout his talk, Josh articulated the motivations behind Spring’s shorter release cycles, aiming to deliver timely features without overwhelming users. He stressed the framework’s alignment with emerging standards, positioning it as a bridge between Java SE 7/8 and EE 7.
Josh also shared insights into community contributions, mentioning the GitHub-based model and Gradle builds that foster collaboration. He encouraged feedback, highlighting his role in curating community resources like the weekly roundup on springsource.org.
In closing, Josh fielded questions on topics like bean metadata navigation and conditional caching, reinforcing Spring’s commitment to developer productivity. His enthusiasm underscored Spring’s enduring value in navigating the complexities of modern software engineering.