Package org.jboss.util.threadpool

Examples of org.jboss.util.threadpool.ThreadPool


   // 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

    */
   public void invokeOneway(final Object param, final Map sendPayload, boolean clientSide) throws Throwable
   {
      if(clientSide)
      {
         ThreadPool threadPool = getOnewayThreadPool();
         Runnable onewayRun = new Runnable()
         {
            public void run()
            {
               try
               {
                  invoke(param, sendPayload);
               }
               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, sendPayload);
View Full Code Here

      this.onewayThreadPool = pool;
   }

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

      // The oneway invocation should contain the real param as it's only param in parameter array
      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);
            }
         }
      };
      executor.run(onewayRun);
   }
View Full Code Here

      return httpThreadPool;
   }

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

   {
      if(!running)
      {
         try
         {
            ThreadPool httpThreadPool = getHTTPThreadPool();
            InetAddress bindAddress = InetAddress.getByName(getServerBindAddress());
            serverSocket = createServerSocket(getServerBindPort(), backlog, bindAddress);

            // prime the pool by starting up max
            for(int t = 0; t < maxPoolSize; t++)
            {
               httpThreadPool.run(this);
            }

            running = true;

         }
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

      return httpThreadPool;
   }

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

   {
      if(!running)
      {
         try
         {
            ThreadPool httpThreadPool = getHTTPThreadPool();
            InetAddress bindAddress = InetAddress.getByName(getServerBindAddress());
            serverSocket = createServerSocket(getServerBindPort(), backlog, bindAddress);

            // prime the pool by starting up max
            for(int t = 0; t < maxPoolSize; t++)
            {
               httpThreadPool.run(this);
            }

            running = true;

         }
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.