ManagedExecutorService JNDI configuration in REDHAT JBoss Enterprise Application Platform

This blog will cover the JNDI configuration of ManagedExecutorService in Redhat JBoss EAP.

Login to the JBoss Admin Console
Go to Configuration >> Subsystems >> EE and click on Views.
This will take you to Executor configuration Screen. You will find default configuration for Executor service. JNDI Name is configured as "java:jboss/ee/concurrency/executor/default".
Now, you are set start consuming this JNDI name to consume Executor service.

  
     try {
 javax.naming.InitialContext context = new javax.naming.InitialContext();
 javax.enterprise.concurrent.ManagedExecutorService service = 
                      (javax.enterprise.concurrent.ManagedExecutorService)context.lookup("java:jboss/ee/concurrency/executor/default");
 Future f = service.submit(new ThreadProcessor());         //ThreadProcessor is callable or runnable thread
     } catch (NamingException e1) {
 e1.printStackTrace();
     }


Comments

Popular posts from this blog

How to do AJAX using XMLHttpRequest for large data

Caching mechanisms in modern world browser

Polymorphism in Java OOP