Example usage for java.lang Thread NORM_PRIORITY

List of usage examples for java.lang Thread NORM_PRIORITY

Introduction

In this page you can find the example usage for java.lang Thread NORM_PRIORITY.

Prototype

int NORM_PRIORITY

To view the source code for java.lang Thread NORM_PRIORITY.

Click Source Link

Document

The default priority that is assigned to a thread.

Usage

From source file:org.apache.axis2.util.threadpool.ThreadPool.java

public ThreadPool() {
    setExecutor(createDefaultExecutor("Axis2 Task", Thread.NORM_PRIORITY, true));
}

From source file:org.apache.streams.threaded.controller.ThreadingController.java

/**
 * Use for very low priority items... The thread-pool that runs this runs at priority
 * (Thread.NORM_PRIORITY - 2) = 3//w  w w . ja v  a  2s . c om
 * @return
 * The threading controller
 */
public static ThreadingController getInstanceLowPriority() {
    synchronized (ThreadingController.class) {
        if (instanceLowPriority == null) {
            instanceLowPriority = new ThreadingController("Apache Streams [low]", NUM_PROCESSORS,
                    NUM_PROCESSORS * 2, Thread.NORM_PRIORITY - 2);
        }
        return instanceLowPriority;
    }
}

From source file:org.parosproxy.paros.core.spider.SpiderThread.java

SpiderThread(Spider parent) {
    this.parent = parent;
    queue = parent.getQueue();//from w  w  w . j a va 2  s .  c o m
    collector = new Collector(this);
    this.setDaemon(true);
    this.setPriority(Thread.NORM_PRIORITY - 2);
}

From source file:me.hypertesto.questeasy.ui.ImagePagerFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fr_image_pager, container, false);
    ViewPager pager = (ViewPager) rootView.findViewById(R.id.pagerV2);

    //Default settings for imageLoader
    imageLoader = ImageLoader.getInstance();
    ImageLoaderConfiguration defaultconfiguration = new ImageLoaderConfiguration.Builder(
            getActivity().getApplicationContext()).threadPriority(Thread.NORM_PRIORITY - 2)
                    .denyCacheImageMultipleSizesInMemory()
                    .diskCacheFileNameGenerator(new Md5FileNameGenerator())
                    .tasksProcessingOrder(QueueProcessingType.LIFO).build();

    //imageLoader.init(ImageLoaderConfiguration.createDefault(getActivity().getApplicationContext()));
    imageLoader.init(defaultconfiguration);
    pager.setAdapter(new ImageAdapter(getActivity(), imageLoader, this.uriStrings));
    pager.setCurrentItem(0);/*from   w ww .ja v  a2s .c om*/
    return rootView;
}

From source file:org.apache.axis2.util.threadpool.ThreadPool.java

public ThreadPool(int corePoolSize, int maxPoolSize) {
    this.corePoolSize = corePoolSize;
    this.maxPoolSize = maxPoolSize;
    setExecutor(createDefaultExecutor("Axis2 Task", Thread.NORM_PRIORITY, true));
}

From source file:net.sf.j2ep.servers.ServerStatusChecker.java

/**
 * Basic constructor sets the listener to notify when
 * servers goes down/up. Also sets the polling time
 * which decides how long we wait between doing checks.
 * /*w  w w  . j a  v  a  2  s .com*/
 * @param listener The listener
 * @param pollingTime The time we wait between checks, in milliseconds
 */
public ServerStatusChecker(ServerStatusListener listener, long pollingTime) {
    this.listener = listener;
    this.pollingTime = Math.max(30 * 1000, pollingTime);
    setPriority(Thread.NORM_PRIORITY - 1);
    setDaemon(true);

    online = new LinkedList();
    offline = new LinkedList();
    httpClient = new HttpClient();
    httpClient.getParams().setBooleanParameter(HttpClientParams.USE_EXPECT_CONTINUE, false);
    httpClient.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
}

From source file:org.parosproxy.paros.core.scanner.Scanner.java

public void start(SiteNode startNode) {
    isStop = false;/*from w ww.  ja  v  a  2  s .  com*/
    log.info("scanner started");
    startTimeMillis = System.currentTimeMillis();
    this.startNode = startNode;
    Thread thread = new Thread(this);
    thread.setPriority(Thread.NORM_PRIORITY - 2);
    thread.start();
}

From source file:burstcoin.jminer.core.CoreConfig.java

/**
 * Network pool.//from   ww w  .  j  a v a  2 s  . c om
 *
 * @return the thread pool task executor
 */
@Bean(name = "networkPool")
public ThreadPoolTaskExecutor networkPool() {
    ThreadPoolTaskExecutor pool = new ThreadPoolTaskExecutor();
    pool.setMaxPoolSize(2);
    pool.setThreadPriority(Thread.NORM_PRIORITY + 1);
    return pool;
}

From source file:com.common.app.MyApplication.java

public static void initImageLoader(Context context) {
    // This configuration tuning is custom. You can tune every option, you may tune some of them,
    // or you can create default configuration by
    //  ImageLoaderConfiguration.createDefault(this);
    // method.// www. j  ava2 s  .co  m
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
            .threadPriority(Thread.NORM_PRIORITY - 2).denyCacheImageMultipleSizesInMemory()
            .discCacheFileNameGenerator(new Md5FileNameGenerator())
            .tasksProcessingOrder(QueueProcessingType.LIFO).writeDebugLogs() // Remove for release app
            .build();
    // Initialize ImageLoader with configuration.
    ImageLoader.getInstance().init(config);
}

From source file:org.apache.lens.server.EventServiceImpl.java

@Override
public synchronized void init(HiveConf hiveConf) {
    int numProcs = Runtime.getRuntime().availableProcessors();
    ThreadFactory factory = new BasicThreadFactory.Builder().namingPattern("Event_Service_Thread-%d")
            .daemon(false).priority(Thread.NORM_PRIORITY).build();
    eventHandlerPool = Executors.newFixedThreadPool(
            hiveConf.getInt(LensConfConstants.EVENT_SERVICE_THREAD_POOL_SIZE, numProcs), factory);
    super.init(hiveConf);
}