Presentation about the newly released JSR236 spec that Anthony Lai (Oracle) and Fred Rowe (IBM) did for session CON7948 at JavaOne SF 2013.
JSR 236 is part of EE7 platform and defines extensions to the SE concurrency APIs to allow them to be used in an app server environment.
Every few months, another Joe (or Jane) Shmoe decides it’s time to write an agenda-driven blog post (or presentation for a conference) that shows why a particular flavor of JPA blows all the other competitors out of the water. This session shows that, when properly used/tuned, the JPA implementations from the major providers (EclipseLink, Hibernate, and OpenJPA) all perform nearly the same.
WebLogic 12.1.3 was released late last year. It brings a large set of changes including support for some key new Java EE 7 APIs such as WebSocket, JAX-RS 2, JSON-P and JPA 2.1, support for Java SE 8, WebSocket fallback support, support for Server-Sent Events (SSE), improved Maven support, enhanced REST administration support, Oracle Database 12c driver support and much, much more. In this session we will take a detailed tour of these features. In addition we will also cover updated WebLogic support in the Oracle Cloud, the new Oracle public Maven repository, using WebLogic with Arquillian for testing and well as official Docker support for WebLogic.
Towards the end of the session we will discuss what's coming in WebLogic 12.2.1 this year including full support for Java EE 7, multi-tenancy and more.
All of the Performance Tuning Features in Oracle SQL DeveloperJeff Smith
An overview of all of the performance tuning instrumentation, tools, and features in Oracle SQL Developer. Get help making those applications and their queries more performant.
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015Edward Burns
It’s hard to overstate how much has changed in the world since HTTP 1.1 went final in June of 1999. There were no smartphones, Google had not yet IPO’d, Java Swing was less than a year old… you get the idea. Yet for all that change, HTTP remains at version 1.1.
Change is finally coming. HTTP 2.0 should be complete by 2015, and with that comes the need for a new version of Servlet. It will embrace HTTP 2.0 and expose its key features to Java EE 8 applications. This session gives a peek into the progress of the Servlet spec and shares some ideas about how developers can take advantage of this exciting
update to the world’s most successful application protocol on the world’s most popular programming language.
Every few months, another Joe (or Jane) Shmoe decides it’s time to write an agenda-driven blog post (or presentation for a conference) that shows why a particular flavor of JPA blows all the other competitors out of the water. This session shows that, when properly used/tuned, the JPA implementations from the major providers (EclipseLink, Hibernate, and OpenJPA) all perform nearly the same.
WebLogic 12.1.3 was released late last year. It brings a large set of changes including support for some key new Java EE 7 APIs such as WebSocket, JAX-RS 2, JSON-P and JPA 2.1, support for Java SE 8, WebSocket fallback support, support for Server-Sent Events (SSE), improved Maven support, enhanced REST administration support, Oracle Database 12c driver support and much, much more. In this session we will take a detailed tour of these features. In addition we will also cover updated WebLogic support in the Oracle Cloud, the new Oracle public Maven repository, using WebLogic with Arquillian for testing and well as official Docker support for WebLogic.
Towards the end of the session we will discuss what's coming in WebLogic 12.2.1 this year including full support for Java EE 7, multi-tenancy and more.
All of the Performance Tuning Features in Oracle SQL DeveloperJeff Smith
An overview of all of the performance tuning instrumentation, tools, and features in Oracle SQL Developer. Get help making those applications and their queries more performant.
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015Edward Burns
It’s hard to overstate how much has changed in the world since HTTP 1.1 went final in June of 1999. There were no smartphones, Google had not yet IPO’d, Java Swing was less than a year old… you get the idea. Yet for all that change, HTTP remains at version 1.1.
Change is finally coming. HTTP 2.0 should be complete by 2015, and with that comes the need for a new version of Servlet. It will embrace HTTP 2.0 and expose its key features to Java EE 8 applications. This session gives a peek into the progress of the Servlet spec and shares some ideas about how developers can take advantage of this exciting
update to the world’s most successful application protocol on the world’s most popular programming language.
Reactive Java EE - Let Me Count the Ways!Reza Rahman
As our industry matures there are pockets of increased demand for high-throughput, low-latency systems heavily utilizing event-driven programming and asynchronous processing. This trend is gradually converging on the somewhat well established but so-far not well understood term "Reactive".
This session explores how vanilla Java SE and Java EE aligns with this movement via features and APIs like JMS, MDB, EJB @Asynchronous, JAX-RS/Servlet/WebSocket async, CDI events, Java EE concurrency utilities and so on. We will also see how these robust facilities can be made digestible even in the most complex cases for mere mortal developers through Java SE 8 Lambdas and Completable Futures.
JavaOne - 10 Tips for Java EE 7 with PrimeFacesMert Çalışkan
This presentation takes you on a JSF tour with the help of Java EE 7, together with PrimeFaces and the NetBeans IDE. The tour begins with an introduction of PrimeFaces and its features, such as UI components and themes. Focusing on Java EE 7, it examines HTML5-friendly templates, resource libraries contracts, Faces Flow, EL operators, and lambda magic. Throughout, you will be shown how to apply the principles and concepts learned, via working examples in the NetBeans IDE. The presentation is brought to you “from the horse's mouth”—that is, by PrimeFaces and NetBeans IDE engineers.
With a strong focus on annotations, minimalist configuration, simple deployment, intelligent defaults and Java centric type-safety, Java EE is one of the most productive full-stack development platforms around today. This very code centric workshop is a quick tour of the Java EE platform as it stands today. If you haven't seen Java EE for a while and want to catch up, this session is definitely for you.
We will start with the basic principals of what Java EE is and what it is not, overview the platform at a high level and then dive into each key API like JSF, CDI, EJB 3, JPA, JAX-RS, WebSocket and JMS using examples and demos. This is your chance to look at Java EE 7 in the context of a realistic application named Cargo Tracker, available with an MIT license at http://cargotracker.java.net.
We will also briefly take a look at the emerging horizons of Java EE 8.
Java EE 7 from an HTML5 Perspective, JavaLand 2015Edward Burns
This 45 minute session begins by explaining what we mean by the admittedly vague term "HTML5 web application". We use the Cargo Tracker sample Java EE 7 application as the vehicle for this explanation. Diving into the code, we examine the parts of the Java EE 7 family of technologies, and the HTML5 techniques used in the application.
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)jeckels
The Oracle Coherence strategy and roadmap session from OpenWorld 2014. Includes details on the 12.1.3 Cloud Application Foundation release (including WebLogic integration), a road map for the 12.2.1 release, and notable features including JCache (JSR-107) support, Memcached adapters, federated caching, recoverable caching, security enhancements, multitenancy support and more. As usual, all items and statements contained herein are subject to change based on slide 3 of this presentation.
Reactive Java EE - Let Me Count the Ways!Reza Rahman
As our industry matures there are pockets of increased demand for high-throughput, low-latency systems heavily utilizing event-driven programming and asynchronous processing. This trend is gradually converging on the somewhat well established but so-far not well understood term "Reactive".
This session explores how vanilla Java SE and Java EE aligns with this movement via features and APIs like JMS, MDB, EJB @Asynchronous, JAX-RS/Servlet/WebSocket async, CDI events, Java EE concurrency utilities and so on. We will also see how these robust facilities can be made digestible even in the most complex cases for mere mortal developers through Java SE 8 Lambdas and Completable Futures.
JavaOne - 10 Tips for Java EE 7 with PrimeFacesMert Çalışkan
This presentation takes you on a JSF tour with the help of Java EE 7, together with PrimeFaces and the NetBeans IDE. The tour begins with an introduction of PrimeFaces and its features, such as UI components and themes. Focusing on Java EE 7, it examines HTML5-friendly templates, resource libraries contracts, Faces Flow, EL operators, and lambda magic. Throughout, you will be shown how to apply the principles and concepts learned, via working examples in the NetBeans IDE. The presentation is brought to you “from the horse's mouth”—that is, by PrimeFaces and NetBeans IDE engineers.
With a strong focus on annotations, minimalist configuration, simple deployment, intelligent defaults and Java centric type-safety, Java EE is one of the most productive full-stack development platforms around today. This very code centric workshop is a quick tour of the Java EE platform as it stands today. If you haven't seen Java EE for a while and want to catch up, this session is definitely for you.
We will start with the basic principals of what Java EE is and what it is not, overview the platform at a high level and then dive into each key API like JSF, CDI, EJB 3, JPA, JAX-RS, WebSocket and JMS using examples and demos. This is your chance to look at Java EE 7 in the context of a realistic application named Cargo Tracker, available with an MIT license at http://cargotracker.java.net.
We will also briefly take a look at the emerging horizons of Java EE 8.
Java EE 7 from an HTML5 Perspective, JavaLand 2015Edward Burns
This 45 minute session begins by explaining what we mean by the admittedly vague term "HTML5 web application". We use the Cargo Tracker sample Java EE 7 application as the vehicle for this explanation. Diving into the code, we examine the parts of the Java EE 7 family of technologies, and the HTML5 techniques used in the application.
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)jeckels
The Oracle Coherence strategy and roadmap session from OpenWorld 2014. Includes details on the 12.1.3 Cloud Application Foundation release (including WebLogic integration), a road map for the 12.2.1 release, and notable features including JCache (JSR-107) support, Memcached adapters, federated caching, recoverable caching, security enhancements, multitenancy support and more. As usual, all items and statements contained herein are subject to change based on slide 3 of this presentation.
Jakarta Concurrency is the successor of the Java EE Concurrency API. Jakarta Concurrency provides concurrency features aligned with Java SE that work in the Jakarta EE environment. For Jakarta EE 10 the team significantly upgraded Jakarta Concurrency. In this talk Steve Millidge, the lead of the Jakarta Concurrency project, will talk you through the new features in Jakarta EE 10, ideas for the future and how you can contribute to shape Jakarta Concurrency.
These slides were presented at the Community Day at the EclipseCon 2022 https://www.eclipsecon.org/2022/jakarta-ee-community-day
Read more about Jakarta Concurrency on our blog: https://blog.payara.fish/jakarta-concurrency-present-and-future
Find out more about Payara and Jakarta EE on https://www.payara.fish/solutions/jakarta-ee-and-the-payara-platform/
Presentation on the Batch JSR (JSR-352) in JavaOne India, Hyderabad 2013.
Thanks to http://www.slideshare.net/reza_rahman and http://www.slideshare.net/arungupta1 for the source slides.
Framework adoption for java enterprise application developmentClarence Ho
Java enterprise framework description and comparison.
Experience sharing on a project done, include the architect design, challenges and lesson learn.
Some thoughts on choosing framework and how to cope with the rapid change of technology.
Presentation from BGOUG conference Nov 17, 2017.
Since September 2017, Java 9 is generally available. It offers many enhancements:
• Modularity – provides clear separation between public and private APIs, stronger encapsulation & dependency management.
• JShell – using and customizing Java 9 interactive shell by example
• Process API updates – feature-rich, async OS process management and statistics
• Reactive Streams, CompletableFuture and Stream API updates
• Building asynchronous HTTP/2 and WebSocket pipelines using HTTP/2 Client and CompletableFuture composition
• Collection API updates
• Stack walking, and other language enhancements (Project Coin)
Discussed topics are accompanied by live demos available for further review @ github.com/iproduct.
MySQL Proxy. A powerful, flexible MySQL toolbox.Miguel Araújo
MySQL-Proxy is a software application that, as the name suggests, sits between your client and MySQL server(s) allowing you to monitor, analyse or transform that communication. It communicates over the network using the MySQL network protocol and as so, in its the most basic configuration, Proxy simply interposes itself between the server and clients, passing queries from the client to the server and its responses on the other way around. This opens the possibility of changing the communication packets when needed, allowing thus being used for multiple purposes being the most remarkable query analysis, query filtering and modification, load balancing, failover, query injection and pooling.
On this session I'll present and give you a global overview of MySQL-Proxy and the concepts behind it. Use-cases, technical overview and architecture will follow. And of course, everyone will want to see it working so that'll be included as well in parallel with detailed explanation on how you can use it to fulfill your needs.
For those who are developing, managing, or planning enterprise Java and business application deployments on Oracle WebLogic Server with Oracle Coherence or Oracle GlassFish Server applications, this session gives a roadmap on how Oracle is evolving this infrastructure to be the next-generation application foundation for its customers to build on in a private cloud setting. Together with Java as a Service Update you will be able to see Oracle’s vision, product plans, and roadmap for this server infrastructure and how it will be used in the rapidly maturing cloud infrastructure space. The session will help you make key decisions about running enterprise applications on Oracle’s enterprise Java server foundation.
Slides from Oracle's ADF Architecture TV series covering the Design phase of ADF projects, providing an overview on task flows.
Like to know more? Check out:
- Subscribe to the YouTube channel - http://bit.ly/adftvsub
- Design Playlist - http://www.youtube.com/playlist?list=PLJz3HAsCPVaSemIjFk4lfokNynzp5Euet
- Read the episode index on the ADF Architecture Square - http://bit.ly/adfarchsquare
Similar to JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948) (20)
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Today we will start with an overview of what JSR 236 Concurrency Utilities for Java EE is about. What its goals are and what features does it add to the Java EE platform.Then we will walk through the different types of managed objects that are defined in the spec. Then we will go through some of the feature areas that may be of interest to the developers.
First of all, lets go through the goals of Concurrency Utilities as listed in the spec…
Lets briefly go through the history of JSR 236. The JSR has a long history.It started way back in 2003 as 2 JSRs - JSR 236 and 237 were filed in 2003. JSR 236 defines the CommonJ Timers API for app servers while JSR 237 defines the CommonJ Work Manager API for application servers. Some of you may have used the CommonJ API before as it is supported by a few application servers.Then in 2006, after the introduction of the Concurrency Utilities API in Java SE 5, the API were rewritten to align with the API in the concurrent package in Java SE.In 2008, JSR 237 was officially withdrawn and the two JSRs were merged into JSR 236.However, no real progress were made in the next few years on the JSR. The JSR was left in an inactive state until last year when the JSR was restarted and work was resumed on the JSR. The spec was finally released this year as part of Java EE 7.
What are the main features provided by the Concurrency Utilities for Java EE? On a high level, it provides- A Simple, standardized API for using concurrency from application components- Provides API for Java EE application developers that is extension of Java SE Concurrency Utilities APIs (JSR-166)- Provide low-level asynchronous processing capabilities to Java EE application components in a safe, reliable, consistent manner- Provides API for Managing and monitoring of the lifecycle of asynchronous operations
More specifically, concurrency Utilities for Java EE defines 4 types of managed objects that implement the following 4 new interfaces:ManagedExecutorServiceManagedScheduledExecutorServiceManagedThreadFactory, andContextServiceThese interfaces are found in the javax.enterprise.concurrent package.The spec also defines how container context propagation and transaction management should behave for asynchronous tasks using the API. It also provides a mechanism to allow Java EE application components to receive notifications to keep track of the progress of asynchronous tasks.
A managed object is an object provided by Java EE product providers that implements one of the 4 new interfaces. The managed objects are in the package javax.enterprise.concurrent.They are for use by application components. Application code can get reference to them using JNDI lookup or by using resource injection.Configurable – each application server would provide some tools, such as GUI tools or command line interface, for configuration of these managed objects.There can be multiple configured managed objects of each type, each with different configuration properties.Configuration properties not defined by the spec. It is up to each Java EE container to decide what those properties are. However, the spec requires that application server must provide a preconfigured default instance of a managed object for each of the 4 types. They can be looked up using some standard JNDI names. For example, “java:comp/DefaultManagedThreadFactory” etc.A default instance for the specified resource type is injected if “lookup” is not specified in @Resource
ManagedThreadFactory provides a standard mechanism for Java EE applications to obtain a managed thread from the Java EE container. Most Java EE container discourage applications from creating plain java Threads. Those threads are not maintained by the Java EE container and may interfere with the proper operations of the container. Also, application context are not propagated to these threads. We will talk more about context propagation in a couple slides.Again, instead of reinventing the wheel, we simply extend from the ThreadFactory interface from the Java SE concurrent package, inheriting the same API for obtaining a thread. The ManagedThreadFactory is useful for obtaining threads to work with asynchronous servlets that was added to the Servlets 3.0 spec in Java EE 6. it is also useful in advanced use cases such as when the Java EE application needs to create custom executors with its own pool of threads obtained from the container.
The ManagableThread interface provides a means for the application to check whether a thread created by the thread factory is in the process of shutting down.For example, a ManagedThreadFactory may be used with the utility method Executors.newCachedThreadPool from SE API
ManagedExecutorService.isShutdown() throws IllegalStateException ??There is a utility method on the class ManagedExecutors.isCurrentThreadShutdown() to check whether the ManageableThread.isShutdown()
public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)In this example, the default instance of ManagedThreadFactory will be injected and is then used to create a ThreadPoolExecutor with the desired configuration.
public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)In this example, the default instance of ManagedThreadFactory will be injected and is then used to create a new thread on which to run the work of the async servlet. That work will run with the context of the servlet.
Tasks executed by the ManagedExecutorService are run in container managed threads with the context of the application that submitted the task.
It contains various forms of the execute, submit, invokeAll, and invokeAny APIs. Execute is used for submitting asynchronous tasks .Submit() methods are similar to execute(), except they return a handle, called Future, where the code can use to check for the execution status of the task, to cancel the task, or to wait for and retrieve the result of the task. InvokeAll and invokeAny methods allow submission of a collection of tasks, and provide a way to wait for and retrieve the results of either all tasks, or only the first task that completes.All of the APIs are inherited from the ExecutorService interface in the Java SE concurrent package. In fact, we did not introduce any new methods in ManagedExecutorService. This allows application developers to use APIs from Java SE concurrency package that they are already familiar with in their Java EE applications. The lifecycle of a ManagedExecutorService is managed by an application server. All lifecycle operations (like shutdown()) on the ManagedExecutorService interface will throw a java.lang.IllegalStateException exception.
In this example, the default instance of ManagedExecutorService will be injected and is then used to submit a task which will execute with the context of the application. The Future returned by submit() may be used to determine the status of the task and to access the results.
In this example, the default instance of ManagedExecutorService will be injected and is then used to submit an async servlet task which will execute with the context of the application. The Future returned by submit() may be used to determine the status of the task and to access the results.
A ManagedExecutorService instance is intended to be used by multiple components and applications. When the executor runs a task, the context of the thread is changed to match the component instance that submitted the task. The context is then restored when the task is complete.In the figure, a single ManagedExecutorService instance is used to run tasks (in blue) from multiple application components (each denoted in a different color). Each task, when submitted to the ManagedExecutorService automatically retains the context of the submitting component and it becomes a Contextual Task. When the ManagedExecutorService runs the task, the task would be run in the context of the submitting component (as noted by different colored boxes in the figure).ManagedExecutorService instances may be terminated or suspended by the application server when applications or components are stopped or the application server itself is shutting down.
The next interface that is provided by the managed objects is ManagedScheduledExecutorService.It is used for scheduling tasks to run after a given delay, to run periodically, or at some custom schedule that is controlled programmatically. Similar to ManagedExecutorService, these tasks are also run on threads that are provided by the Java EE container.
The ManagedScheduledExecutorService implements both ManagedExecutorService and ScheduledExecutorService APIs.
The first and second schedule() methods provide a means to execute a task once after a fixed delay.The scheduleAtFixedFate() method provides a means to schedule a task to run periodically either at specified period or at a specified delay after completion of the task
These schedule() methods provides a means to execute a task with a custom schedule as specified by the Trigger.
Instances of Triggers are not contextualized by default, but may be contextualized by using the ContextService.
skipRun: Return true if this run instance should be skipped.This is useful if the task shouldn't run because it is late or if the task is paused or suspended.Once this task is skipped, the state of it's Future's result will throw a SkippedException. Unchecked exceptions will be wrapped in a SkippedException.-------------------------getNextRunTime: Retrieve the next time that the task should run after.
This is an example of a trigger which executes a task at a specific time.The getNextRunTime() method calculates whether the specified time for the execution has already passed, and if so, will return null indicating that, otherwsie, it will return the specifc time at which to execute the task.The skipRun() method similarly simply calculates whether it is already past the time at which the task was scheduled to run. The LastExecution will either be null indicating the task hasn’t run or can be used to retrieve either the results or other info about the task.
Can be used to create dynamic proxy objects (as defined by java.lang.reflect.Proxy)
The only execution properties required by the spec are the IDENTITY_NAME, LONGRUNNING_HINT and TRANSACTION
More details on context propagation. It is important for tasks and methods from contextual proxy objects to be run under the same context supplied for the application by the container which is the same as that in the application where they are submitted from or created.The types of container context listed in the spec includes classloading, JNDI namespace, and security identity.Note that transactional context is not one of them.Configurable – Each MO can be configured to propagate different types of container context by an administrator. Extensible - The types of container context do not need to be restricted to the 3 types listed in this slides. The concurrency EE spec allows Java EE containers to support propagation of additional context types. However, the 3 types of container context listed here are required to be supported and propagated in the default managed objects provided by all Java EE containers.
When does context propagation happen?When using ManagedExecutorService or ManagedScheduledExecutorService to submit a task to be run asynchronously on a container managed thread, the Java EE container would capture such context information at the time of task submission, and reapply the context information on the container managed thread that is used for running the task just before the task is run. The result is that the task, even though it is most likely being run on a thread that is different from the thread where it is submitted from, would be able to load classes from the application that submitted the task, to perform JNDI lookup as if it is running in the same application as the one that submit the task, and to run under the same user identity that was logged in to the application when the task was submitted.In the case of ManagedThreadFactory, the container context would be captured when its newThread method is called to retrieve a managed thread. When the managed thread is started, the captured context would be applied to the thread before calling the run() method of the Runnable task that is passed into the newThread method.For ContextService, the container context are captured when a contextual proxy object is created, ie, when the createContextualProxy API is called. Later, when the proxy method is invoked, the captured context is imposed onto the thread even if the method is invoked on a thread that has a different container context. The context of that application component will be restored after the proxy method is completed.
The next feature that we would like to talk about is how transaction management is supported in the managed objects.When a task is run on a different thread from the one that submitted the task, as in the case in ManagedExecutorService, and ManagedSchduledExecutorService, or when a thread is obtained from ManagedThreadFactory, transaction is not propagated from the thread where the task is submitted or where the thread is obtained, to the managed thread where the task is run. However, transaction demarcation is still possible from within the task with the use of the UserTransaction interface from the Java Transaction API specification, or JTA. Java EE container are required to provide UserTransaction to the tasks so a task implementation can begin, commit, or rollback a transaction using the UserTransaction if it wanted to.For contextual proxy objects, the spec provides two choices for the application developers regarding transaction management. One option is to run the proxy method under the same transaction as the thread where the proxy method is invoked from. For example, if the proxy method is invoked from an application component with a transaction already started, any resources used by the contextual proxy object method will be enlisted into the same transaction, and will be committed or rolled back together along with the resources enlisted by the application component. (note: A UserTransaction will only be available if it is also available in the execution thread (for example, when the proxy method is invoked from a Servlet or Bean Managed Transaction EJB).Another option to run the contextual proxy object method under a different transaction. In this case, the transaction of the application component will be suspended, and the proxy method can use UserTransaction for transaction demarcation, and any work done within the proxy method will be committed or rolled back before the method returns. At the end of the method call, the transaction of the invoking application component will be restored. The choice of option can be specified programmatically when the contextual proxy object is created.
Spec supports notifications of lifecycle events for tasks submitted to MES or MSES with the use of MTL interfaceTask lifecycle events:- SubmittedAborted such as unable to start, perhaps disallowed by application server due to server resource constraint policy, or perhaps the application component that submitted the task has endedOr Cancelled – cancelled by applicationFor logging and monitoring of tasks progressRemedial actions – for example, a task that tries to retrieve some data from a remote service has timed out and failed. Upon getting a notification that the task has failed, the application can resubmit the task or perhaps send an email to the administrator about the failure.
Unspecified context by default for performance reasons - we don’t want application servers to incur the cost of setting up container context before calling the listener methods if it is not needed by the methods.
Note that each of the methods are passed with A Future object that was returned when the task was submitted. This can be used for checking the execution status of the task, whether it has been cancelled or completed. The Future can also be used for cancelling the taskAn executor which the task was submitted to. This can be used for resubmitting the task if necessaryThe original task that was submitted. Again this can be useful when the an application wants to resubmit the taskIn the taskAborted and taskDone methods, an exception object is also passed in to the methods to provide details about what has caused the task to be aborted or what caused the task to fail. For example, an instance of CancellationException would be passed if the task was cancelled by the application.
Examples showing how to associate a ManagedTaskListener with a Runnable task.One way is to have the task implement an interface called ManagedTask, in addition to implementing Runnable or Callable.The spec also provide a helper API to return a task that associates a ManagedTaskListener to a given task. Then you would submit the task that is returned by that helper method to the executor. This is useful for example, when the task implementation comes from a different library than the ManagedTaskListener.
Any task submitted to MES or MSES can optionally implement the ManagedTask interface.It allows applications to provide identifying information about a task, to provide an instance of ManagedTaskListener to get notification of lifecycle events of the task as we just discussed, or to provide additional execution properties.
Contains 2 APIs. One for returning the ManagedTaskListener, the other for returning the execution properties associated with the task.Execution properties allow application to provide additional information or hints to the application server about the task that is being submitted.Standard execution properties defined in the spec are located in the ManagedTask interface, which includes:LONGRUNNING_HINT – A hint telling whether the task could take a long time to complete. Java™ EE Containers may make use of this hint value to decide how to allocate thread resource for running this task.IDENTITY_NAME – provides a name or ID for the task so that the task can be easily identifiable through any management or monitoring utilities provided by the application serverTRANSACTION – tells the Java™ EE Container under which transaction should the proxy methods of a contextual proxy object be executed in, as we have discussed a few slides earlier.
isCurrentThreadShutdown() - Utility method for checking the isShutdown() value of the current thread if it is a ManageableThread created from ManagedThreadFactory.newThread() .
There are only 5 APIs in this utility class.First one for detecting whether the current thread is marked for shutdownThe remaining 4 are for associating a given Runnable or Callable with a ManangedTaskListener and execution properties. The first 2 of these methods are for use when the original task is a Runnable, one of which only associates a ManagedTaskListener to the Runnable whereas the other one also associates a Map containing execution properties to the Runnable task.The other 2 methods are similar but for use when the original task is a Callable.
Container context – propagation of context supplied for the application by the container so that tasks or proxy methods will be run under the proper container context.
JIRA issues from project website.Errata can be found thereNew features request welcome for next release – go to project website and file jira issue.Emphasize feedback email