Package com.sun.enterprise.web.connector.grizzly

Examples of com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl


     */
    private static class HeapMemoryRulePipeline extends LinkedListPipeline{
               
        public void initPipeline(){
            workerThreads = new WorkerThreadImpl[1];
            WorkerThreadImpl workerThread = new WorkerThreadImpl(this,
                    "HeapMemoryRuleThread"){
               
                public void run(){
                    while (true) {
                        try{
                            ReadTask t =
                                (ReadTask)HeapMemoryRulePipeline.this.getTask();
                            if ( t != null){
                                long current = usedMemory();
                                t.run();   
                                long usage = usedMemory() - current;
                                if ( usage > 0){
                                    String token =
                                       contextRootyCache.get(t);
                                    appMemoryUsage.put(token,usage);
                                    pipelines.remove(token);
                                }                                 
                            }
                        } catch (Throwable t) {
                            SelectorThread.logger().log(Level.SEVERE,
                                    "workerThread.httpException",t);
                        }
                    }
                }                             
            };
            workerThread.setPriority(priority);
            workerThreads[0] = workerThread;
            threadCount++;
       
View Full Code Here


     * Create new <code>WorkerThreadImpl</code>. This method must be invoked
     * from a synchronized block.
     */
    @Override
    protected void increaseWorkerThread(int increment, boolean startThread){       
        WorkerThreadImpl workerThread;
       
        if (threadCount >= minThreads) return;
       
        maxThreads = maxThreads - minThreads;   
       
        for (int i=0; i < minThreads; i++){
            workerThread = new WorkerThreadImpl(this,
                    name + "WorkerThread-"  + port + "-" + i);
            workerThread.setPriority(priority);
           
            if (startThread)
                workerThread.start();
           
            workerThreads[i] = workerThread;
            threadCount++;
        }
    }
View Full Code Here

     * Create new <code>WorkerThreadImpl</code>. This method must be invoked
     * from a synchronized block.
     */
    @Override
    protected void increaseWorkerThread(int increment, boolean startThread){       
        WorkerThreadImpl workerThread;
       
        if (threadCount >= minThreads) return;
       
        maxThreads = maxThreads - minThreads;   
       
        for (int i=0; i < minThreads; i++){
            workerThread = new WorkerThreadImpl(this,
                    name + "WorkerThread-"  + port + "-" + i);
            workerThread.setPriority(priority);
           
            if (startThread)
                workerThread.start();
           
            workerThreads[i] = workerThread;
            threadCount++;
        }
    }
View Full Code Here

    private static class HeapMemoryRulePipeline extends LinkedListPipeline{
               
        @Override
        public void initPipeline(){
            workerThreads = new WorkerThreadImpl[1];
            WorkerThreadImpl workerThread = new WorkerThreadImpl(this,
                    "HeapMemoryRuleThread"){
               
                @Override
                public void run(){
                    while (true) {
                        try{
                            ReadTask t =
                                (ReadTask)HeapMemoryRulePipeline.this.getTask();
                            if ( t != null){
                                long current = usedMemory();
                                t.run();   
                                long usage = usedMemory() - current;
                                if ( usage > 0){
                                    String token =
                                       contextRootyCache.get(t);
                                    appMemoryUsage.put(token,usage);
                                    pipelines.remove(token);
                                }                                 
                            }
                        } catch (Throwable t) {
                            SelectorThread.logger().log(Level.SEVERE,
                                    "workerThread.httpException",t);
                        }
                    }
                }                             
            };
            workerThread.setPriority(priority);
            workerThreads[0] = workerThread;
            threadCount++;
       
View Full Code Here

TOP

Related Classes of com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl

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.