threadDemo/src/main/java/com/sxd/demo/PreProcessor.java
/**
     * If this thread was constructed using a separate
     * <code>Runnable</code> run object, then that
     * <code>Runnable</code> object's <code>run</code> method is called;
     * otherwise, this method does nothing and returns.
     * <p>
     * Subclasses of <code>Thread</code> should override this method.
     *
     * @see #start()
     * @see #stop()
     * @see #Thread(ThreadGroup, Runnable, String)
     */
If this thread was constructed using a separate
Runnable run object, then that
Runnable object's run method is called;
otherwise, this method does nothing and returns.

Subclasses of Thread should override this method.


If this thread was constructed using a separate Runnable run object then that Runnable object ' s run method is called ; otherwise this method does nothing and returns . Subclasses of Thread should override this method .
@Override
    public void run() {
        while (!isFinish) {
            try {
                Request request = requests.take();
                System.out.println("PreProcessor:" + request);
                if (nextProcessor != null) {
                    nextProcessor.processer(request);
                }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
@ Override public void run ( ) { while ( ! isFinish ) { try { Request request = requests . take ( ) ; System . out . println ( "PreProcessor:" + request ) ; if ( nextProcessor != null ) { nextProcessor . processer ( request ) ; } } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } }
If this thread was constructed using a separate
 <code>Runnable</code> run object, then that
 <code>Runnable</code> object's <code>run</code> method is called;
 otherwise, this method does nothing and returns.
If this thread was constructed using a separate <code > Runnable< / code > run object then that <code > Runnable< / code > object ' s <code > run< / code > method is called ; otherwise this method does nothing and returns .