Examples of DaemonThread


Examples of org.apache.jetspeed.daemon.DaemonThread

     * @param entry
     */
    private void start(DaemonEntry entry)
    {
        logger.info( "DaemonFactory:  start(): starting daemon -> " + entry.getName() );
        DaemonThread dt = new DaemonThread( entry );        
        this.threads.put( entry, dt );
        dt.start();
    }
View Full Code Here

Examples of org.apache.jetspeed.daemon.DaemonThread

    Kicks of processing of a Daemon.  Does the same thing as getDaemon() but
    also creates a thread and runs the daemon.
    */
    public void process( DaemonEntry entry ) throws DaemonException {

        DaemonThread dt = (DaemonThread)this.threads.get( entry );

        if (dt == null)
        {
            start(entry);
            dt = (DaemonThread) this.threads.get(entry);
        }
       
        //FIX ME:  get the status of this daemon before kicking it off again.
        int status = this.getStatus( entry );

        if (status != Daemon.STATUS_PROCESSING &&
            status != Daemon.STATUS_UNKNOWN &&
            dt != null) {
            //tell this thread to stop waiting and process immediately
            synchronized (dt) {
                dt.notify();
            }
           
        }

        if ( dt != null && dt.isAlive() == false ) {
            dt.start();
        }

    }
View Full Code Here

Examples of org.apache.jetspeed.daemon.DaemonThread

     * @param entry
     */
    private void start(DaemonEntry entry)
    {
        logger.info( "DaemonFactory:  start(): starting daemon -> " + entry.getName() );
        DaemonThread dt = new DaemonThread( entry );        
        this.threads.put( entry, dt );
        dt.start();
    }
View Full Code Here

Examples of org.apache.jetspeed.daemon.DaemonThread

    Kicks of processing of a Daemon.  Does the same thing as getDaemon() but
    also creates a thread and runs the daemon.
    */
    public void process( DaemonEntry entry ) throws DaemonException {

        DaemonThread dt = (DaemonThread)this.threads.get( entry );

        if (dt == null)
        {
            start(entry);
            dt = (DaemonThread) this.threads.get(entry);
        }
       
        //FIX ME:  get the status of this daemon before kicking it off again.
        int status = this.getStatus( entry );

        if (status != Daemon.STATUS_PROCESSING &&
            status != Daemon.STATUS_UNKNOWN &&
            dt != null) {
            //tell this thread to stop waiting and process immediately
            synchronized (dt) {
                dt.notify();
            }
           
        }

        if ( dt != null && dt.isAlive() == false ) {
            dt.start();
        }

    }
View Full Code Here

Examples of org.apache.jetspeed.daemon.DaemonThread

        for (int i = 0; i < entries.length; ++i) {

            //create Daemon threads for them and pa
            if( entries[i].onStartup() ) {
                Log.info( "DaemonFactory:  start(): starting daemon -> " + entries[i].getName() );
                DaemonThread dt = new DaemonThread( entries[i] );        
                this.threads.put( entries[i], dt );
                dt.start();
            }
           
        }
       
    }
View Full Code Here

Examples of org.apache.jetspeed.daemon.DaemonThread

    public void process( DaemonEntry entry ) throws DaemonException {

        //FIX ME:  get the status of this daemon before kicking it off again.
        int status = this.getStatus( entry );

        DaemonThread dt = (DaemonThread)this.threads.get( entry );
       
        if ( status != Daemon.STATUS_PROCESSING &&
             status != Daemon.STATUS_UNKNOWN ) {
                
            //tell this thread to stop waiting and process immediately
            synchronized (dt) {
                dt.notify();
            }
           
        }

        if ( dt.isAlive() == false ) {
            dt.start();
        }

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.