avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: jakarta-avalon-apps/infomover/src/java/org/apache/infomover/jobmanager/impl JobImpl.java JobRunner.java
Date Mon, 09 Sep 2002 21:11:01 GMT
bloritsch    2002/09/09 14:11:01

  Modified:    infomover/src/java/org/apache/infomover/jobmanager/impl
                        JobImpl.java JobRunner.java
  Log:
  adjust the JobRunner, and add everything except for creating and destroying components and
reading the configurations
  
  Revision  Changes    Path
  1.3       +33 -12    jakarta-avalon-apps/infomover/src/java/org/apache/infomover/jobmanager/impl/JobImpl.java
  
  Index: JobImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/infomover/src/java/org/apache/infomover/jobmanager/impl/JobImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JobImpl.java	9 Sep 2002 20:06:46 -0000	1.2
  +++ JobImpl.java	9 Sep 2002 21:11:01 -0000	1.3
  @@ -70,10 +70,12 @@
       private Configuration m_config;
       private ServiceManager m_manager;
   
  +    private boolean m_isScheduled;
       private int m_transactionCount;
       private int m_successfulTransactionCount;
       private long m_lastRun;
  -    private boolean m_isRunning;
  +
  +    private JobRunner m_runner;
   
       /**
        * Set up a JobImpl with the basic state
  @@ -83,7 +85,6 @@
           m_transactionCount = 0;
           m_successfulTransactionCount = 0;
           m_lastRun = -1;
  -        m_isRunning = false;
       }
   
       /**
  @@ -92,7 +93,7 @@
        */
       public long getLastRun()
       {
  -        throw new UnsupportedOperationException();
  +        return m_lastRun;
       }
   
       /**
  @@ -100,7 +101,12 @@
        */
       public boolean isRunning()
       {
  -        return m_isRunning;
  +        if ( null != m_runner )
  +        {
  +            return m_runner.isRunning();
  +        }
  +
  +        return false;
       }
   
       /**
  @@ -108,7 +114,7 @@
        */
       public void cancel()
       {
  -        throw new UnsupportedOperationException();
  +        if ( null != m_runner ) m_runner.cancel();
       }
   
       /**
  @@ -119,6 +125,11 @@
        */
       public int transactionCount()
       {
  +        if ( ! m_isScheduled && null != m_runner )
  +        {
  +            return m_runner.transactionCount();
  +        }
  +
           return m_transactionCount;
       }
   
  @@ -130,7 +141,12 @@
        */
       public int successfulTransactionCount()
       {
  -        throw new UnsupportedOperationException();
  +        if ( ! m_isScheduled && null != m_runner )
  +        {
  +            return m_runner.successfulTransactionCount();
  +        }
  +
  +        return m_successfulTransactionCount;
       }
   
       public void configure( Configuration config )
  @@ -152,30 +168,35 @@
   
       public void suspend()
       {
  -        throw new UnsupportedOperationException();
  +        m_runner.suspend();
       }
   
       public void resume()
       {
  -        throw new UnsupportedOperationException();
  +        m_runner.resume();
       }
   
       public void start()
       {
  -        m_transactionCount = 0;
  -        m_successfulTransactionCount = 0;
           m_lastRun = System.currentTimeMillis();
  -        m_isRunning = true;
   
           // Get the resources needed to process
  +        m_runner = new JobRunner( null, null, null, null );
  +
           throw new UnsupportedOperationException();
       }
   
       public void stop()
       {
  -        m_isRunning = false;
  +        m_transactionCount = m_runner.transactionCount();
  +        m_successfulTransactionCount = m_runner.successfulTransactionCount();
  +
  +        if ( m_runner.isRunning() ) m_runner.cancel();
   
           // Release the resources needed to process
  +
  +        m_runner = null;
  +
           throw new UnsupportedOperationException();
       }
   }
  
  
  
  1.2       +20 -0     jakarta-avalon-apps/infomover/src/java/org/apache/infomover/jobmanager/impl/JobRunner.java
  
  Index: JobRunner.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/infomover/src/java/org/apache/infomover/jobmanager/impl/JobRunner.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JobRunner.java	9 Sep 2002 20:06:46 -0000	1.1
  +++ JobRunner.java	9 Sep 2002 21:11:01 -0000	1.2
  @@ -220,5 +220,25 @@
               m_semaphore.notifyAll();
           }
       }
  +
  +    public Input getInput()
  +    {
  +        return m_input;
  +    }
  +
  +    public Manipulator[] getManipulators()
  +    {
  +        return m_manipulators;
  +    }
  +
  +    public Output getOutput()
  +    {
  +        return m_output;
  +    }
  +
  +    public Notifier getNotifier()
  +    {
  +        return m_notifier;
  +    }
   }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message