Package org.jboss.util.threadpool

Examples of org.jboss.util.threadpool.ThreadPool


/*      */   }
/*      */
/*      */   private ThreadPool createThreadPoolProxy(ObjectName objName)
/*      */   {
/* 1599 */     MBeanServer server = getMBeanServer();
/*      */     ThreadPool pool;
/* 1600 */     if (server != null)
/*      */     {
/* 1602 */       ThreadPoolMBean poolMBean = (ThreadPoolMBean)MBeanServerInvocationHandler.newProxyInstance(server, objName, ThreadPoolMBean.class, false);
/*      */
/* 1605 */       pool = poolMBean.getInstance();
/*      */     }
/*      */     else
/*      */     {
/* 1609 */       throw new RuntimeException("Can not register MBean ThreadPool as the ServerInvoker has not been registered with a MBeanServer.");
/*      */     }
/*      */     ThreadPool pool;
/* 1612 */     return pool;
/*      */   }
View Full Code Here


/* 1729 */     Object realParam = objs[0];
/* 1730 */     invocation.setParameter(realParam);
/*      */
/* 1732 */     InvocationRequest newInvocation = invocation;
/*      */
/* 1734 */     ThreadPool executor = getOnewayThreadPool();
/* 1735 */     Runnable onewayRun = new Runnable(newInvocation) {
/*      */       private final InvocationRequest val$newInvocation;
/*      */
/*      */       public void run() {
/*      */         try {
/* 1741 */           ServerInvoker.this.invoke(this.val$newInvocation);
/*      */         }
/*      */         catch (Throwable e)
/*      */         {
/* 1746 */           ServerInvoker.log.error("Error executing server oneway invocation request: " + this.val$newInvocation, e);
/*      */         }
/*      */       }
/*      */     };
/* 1751 */     if (trace) log.trace(this + " placing " + invocation + " in onewayThreadPool");
/* 1752 */     executor.run(onewayRun);
/*      */   }
View Full Code Here

/*  572 */     Map internalSendPayload = sendPayload == null ? new HashMap() : sendPayload;
/*  573 */     internalSendPayload.put("oneway", "true");
/*      */
/*  575 */     if (clientSide)
/*      */     {
/*  577 */       ThreadPool threadPool = getOnewayThreadPool();
/*  578 */       Runnable onewayRun = new Runnable(param, internalSendPayload) {
/*      */         private final Object val$param;
/*      */         private final Map val$internalSendPayload;
/*      */
/*      */         public void run() { try { Client.this.invoke(this.val$param, this.val$internalSendPayload);
/*      */           }
/*      */           catch (Throwable e)
/*      */           {
/*  589 */             Client.log.error("Error executing client oneway invocation request: " + this.val$param, e);
/*      */           }
/*      */         }
/*      */       };
/*  593 */       threadPool.run(onewayRun);
/*      */     }
/*      */     else
/*      */     {
/*  597 */       OnewayInvocation invocation = new OnewayInvocation(param);
/*  598 */       invoke(invocation, internalSendPayload);
View Full Code Here

/* 64 */     createFactory();
/*    */   }
/*    */
/*    */   private void createFactory()
/*    */   {
/* 75 */     ThreadPool threadPool = new BasicThreadPool("Messaging Timeout");
/* 76 */     this.factory = new TimeoutFactory(threadPool);
/*    */   }
View Full Code Here

/*     */   }
/*     */
/*     */   private ThreadPool createThreadPoolProxy(ObjectName objName)
/*     */   {
/* 230 */     MBeanServer server = getMBeanServer();
/*     */     ThreadPool pool;
/* 231 */     if (server != null)
/*     */     {
/* 233 */       ThreadPoolMBean poolMBean = (ThreadPoolMBean)MBeanServerInvocationHandler.newProxyInstance(server, objName, ThreadPoolMBean.class, false);
/*     */
/* 238 */       pool = poolMBean.getInstance();
/*     */     }
/*     */     else
/*     */     {
/* 242 */       throw new RuntimeException("Can not register MBean ThreadPool as the ServerInvoker has not been registered with a MBeanServer.");
/*     */     }
/*     */     ThreadPool pool;
/* 244 */     return pool;
/*     */   }
View Full Code Here

/*     */   {
/* 256 */     if (!this.running)
/*     */     {
/*     */       try
/*     */       {
/* 260 */         ThreadPool httpThreadPool = getHTTPThreadPool();
/* 261 */         InetAddress bindAddress = InetAddress.getByName(getServerBindAddress());
/* 262 */         this.serverSocket = createServerSocket(getServerBindPort(), this.backlog, bindAddress);
/*     */
/* 265 */         for (int t = 0; t < this.maxPoolSize; t++)
/*     */         {
/* 267 */           httpThreadPool.run(this);
/*     */         }
/*     */
/* 270 */         this.running = true;
/*     */       }
/*     */       catch (IOException e)
View Full Code Here

/*  89 */     return this.namingBean.getNamingInstance();
/*     */   }
/*     */
/*     */   public void setLookupPool(BasicThreadPoolMBean poolMBean)
/*     */   {
/* 100 */     ThreadPool lookupPool = poolMBean.getInstance();
/* 101 */     this.namingMain.setLookupPool(lookupPool);
/*     */   }
View Full Code Here

   // Private --------------------------------------------------------------------------------------

   private void createFactory()
   {
      ThreadPool threadPool = new BasicThreadPool("Messaging Timeout");
      factory = new TimeoutFactory(threadPool);
   }
View Full Code Here

      final Map internalSendPayload = sendPayload == null ? new HashMap() : sendPayload;
      internalSendPayload.put(ONEWAY_FLAG, "true");

      if (clientSide)
      {
         ThreadPool threadPool = getOnewayThreadPool();
         Runnable onewayRun = new Runnable()
         {
            public void run()
            {
               try
               {
                  invoke(param, internalSendPayload);
               }
               catch (Throwable e)
               {
                  // throw away exception since can't get it back to original caller
                  log.error("Error executing client oneway invocation request: " + param, e);
               }
            }
         };
         threadPool.run(onewayRun);
      }
      else
      {
         OnewayInvocation invocation = new OnewayInvocation(param);
         invoke(invocation, internalSendPayload);
View Full Code Here

   // Private --------------------------------------------------------------------------------------

   private ThreadPool createThreadPoolProxy(ObjectName objName)
   {
      ThreadPool pool;
      MBeanServer server = getMBeanServer();
      if(server != null)
      {
         ThreadPoolMBean poolMBean = (ThreadPoolMBean)MBeanServerInvocationHandler.
            newProxyInstance(server, objName, ThreadPoolMBean.class, false);
View Full Code Here

TOP

Related Classes of org.jboss.util.threadpool.ThreadPool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.