Package org.jboss.util.threadpool

Examples of org.jboss.util.threadpool.ThreadPool


      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


        
         // BasicThreadPool timeout mechanism depends on the interrupted status of
         // the running thread.
         Thread.interrupted();
        
         ThreadPool pool = getTimeoutThreadPool();
         WaitingTaskWrapper wrapper = new WaitingTaskWrapper(r, simulatedTimeout);
         if (log.isTraceEnabled()) log.trace("starting task in thread pool");
         pool.runTaskWrapper(wrapper);
         if (log.isTraceEnabled()) log.trace("task finished in thread pool");
        
         Object result = resultHolder.value;
         if (result == null)
         {
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

      Object realParam = objs[0];
      invocation.setParameter(realParam);

      final InvocationRequest newInvocation = invocation;

      ThreadPool executor = getOnewayThreadPool();
      Runnable onewayRun = new Runnable()
      {
         public void run()
         {
            try
            {
               invoke(newInvocation);
            }
            catch(Throwable e)
            {
               // throw away exception since can't get it back to original caller
               log.error("Error executing server oneway invocation request: " + newInvocation, e);
            }
         }
      };

      if(trace) { log.trace(this + " placing " + invocation + " in onewayThreadPool"); }
      executor.run(onewayRun);
   }
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

      Object realParam = objs[0];
      invocation.setParameter(realParam);

      final InvocationRequest newInvocation = invocation;

      ThreadPool executor = getOnewayThreadPool();
      Runnable onewayRun = new Runnable()
      {
         public void run()
         {
            try
            {
               invoke(newInvocation);
            }
            catch(Throwable e)
            {
               // throw away exception since can't get it back to original caller
               log.error("Error executing server oneway invocation request: " + newInvocation, e);
            }
         }
      };

      if(trace) { log.trace(this + " placing " + invocation + " in onewayThreadPool"); }
      executor.run(onewayRun);
   }
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

        
         // BasicThreadPool timeout mechanism depends on the interrupted status of
         // the running thread.
         Thread.interrupted();
        
         ThreadPool pool = getTimeoutThreadPool();
         WaitingTaskWrapper wrapper = new WaitingTaskWrapper(r, simulatedTimeout);
         if (log.isTraceEnabled()) log.trace("starting task in thread pool");
         pool.runTaskWrapper(wrapper);
         if (log.isTraceEnabled()) log.trace("task finished in thread pool");
        
         Object result = resultHolder.value;
         if (result == null)
         {
View Full Code Here

           
            // BasicThreadPool timeout mechanism depends on the interrupted status of
            // the running thread.
            Thread.interrupted();
           
            ThreadPool pool = getTimeoutThreadPool();
            WaitingTaskWrapper wrapper = new WaitingTaskWrapper(r, simulatedTimeout);
            if (log.isTraceEnabled()) log.trace("starting task in thread pool");
            pool.runTaskWrapper(wrapper);
            if (log.isTraceEnabled()) log.trace("task finished in thread pool");
           
            Object result = unmarshal(resultHolder.value, unmarshaller, metadata);
            if (result == null)
            {
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.