View Javadoc

1   /*
2    * Copyright 2000-2001,2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.apache.jetspeed.services.threadpool;
18  
19  import org.apache.turbine.services.TurbineServices;
20  
21  /***
22   * This is a simple static accessor class to the access the common     
23   * methods of JetspeedThreadPoolService 
24   *
25   * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
26   * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
27   * @version $Id: ThreadPool.java,v 1.4 2004/02/23 03:51:31 jford Exp $
28   */
29  public class ThreadPool
30  {
31      
32      /***
33       * @see org.apache.jetspeed.services.threadpool.JetspeedThreadPoolService#process( Runnable runnable )
34       */
35      public static void process( Runnable runnable )  {
36          
37          JetspeedThreadPoolService service = 
38              (JetspeedThreadPoolService) TurbineServices
39              .getInstance()
40              .getService( ThreadPoolService.SERVICE_NAME );
41              
42          service.process( runnable );
43          
44      }
45      
46      /***
47       * @see org.apache.jetspeed.services.threadpool.JetspeedThreadPoolService#process( Runnable runnable, int priority )
48       */
49      public static void process( Runnable runnable, int priority ) {
50          
51          JetspeedThreadPoolService service = 
52              (JetspeedThreadPoolService) TurbineServices
53              .getInstance()
54              .getService( ThreadPoolService.SERVICE_NAME );
55              
56          service.process( runnable, priority );
57          
58      }
59  
60  }