Git Product home page Git Product logo

javaeeconcurrency's Introduction

// Java EE terms

  • JNDI: API for directory services to look up data and resources, done through Initial Context API. Data and resources can come from flat file, database or an application server. Java RMI and JEE use JNDI to look up objects over network. Very common directory services like LDAP, DNS, etc. can be accessed using JNDI. If you want to do JNDI look-up in your Restful beans or EJB classes, there is an Initial Context API.
  • Stateless session bean: Bean used to perform independent operations. You can add a lot of business methods which do database interactions. Application server creates a pool of stateless session bean.
  • Global Xactions: When you have a distributed environment, you may have multiple resource managers on which you are trying to do Xactions. Multiple resources could be Databases, JMS Queues, application servers, etc. Whenever you do this distributed Xaction processing, it is absolutely important that the data integrity is ensured. Now XA or extended architecture, is an open standard which is defined for executing global transaction that accesses more than one backend datastore. This is the one which helps to define the interactions between the Xaction manager and the resource manager. The goal of XA is to allow multiple resources like databases, JMS Queues, Xactional caches, etc. to be accessed within the same Xaction, thereby preserving the ACID properties across applications.
  • Java Xaction API: List of interfaces between the Xaction manager and the parties involved in the Xaction. This Xaction API has specifications to perform transactions over a distributed network. The parties involved in the Xaction processing will be the resource manager, the application server and the application core. So JPA is going to specify the interface between the Xaction manager and all of these parties, gives you a way to do Xaction processing.

// Usecases and JEE concurrency APIs

  • Usecase: List of bank accounts and Xactions against those bank accounts. Generate a report for all the Xactions per bank account.
    • Using: ManagedExecutorService managedexecutorservice.png
  • Usecase: Health check for an application. Scheduled health checks.
    • Using: ManagedScheduledExecutorServicemanagedscheduledexecutorservice.png
  • ManagedThreadFactory & ThreadPoolExecutor - custom thread factory implemenation.
  • ContextService API
    • contextual objects: Java object which has a particular application component's container context associated with it.
    • contextual tasks: tasks submitted to managed resource. When a task instance is submitted to managed instance of executor service then the tasks becomes a contextual task. When the contextual task runs, the task behaves as if it was still running inside a container it was submitted with. When you have a application component like EJB, a servlet. Then we know that the thread that is running is going to have the contextual information associated with it.
    • ContextService API allows applications to create contextual objects without a managed executor. To understand it, if we create a thread using Java SE platform inside the enterprise environment we know that the contextual information is not guaranteed to be given to the thread. Because the container is not aware of the thread created using the Java SE. If you want to capture the container context, and run with that context may be on another instance of the server or restart. Then the ContextService API is the way to do it.
    • Basically it gives the context information to store it and run it later.
    • How? Uses the dynamic proxies capabilities to associate an application's container context with an object instance. This object now becomes a contextual object and whenever a method on the contextual object runs, then the method executes with the thread context of that associated application component instance.
    • Used in advanced scenarios

javaeeconcurrency's People

Contributors

ganesh-sadanala avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.