Code/SifCommonFramework/Systemic.Sif.Framework/Agent/BaseAgent.cs
/// <summary>
/// This method will run the SIF Agent. Only the first call to this method will be recognised; subsequent
/// calls will be ignored.
/// </summary>
This method will run the SIF Agent. Only the first call to this method will be recognised; subsequent
calls will be ignored.
This method will run the SIF Agent . Only the first call to this method will be recognised ; subsequent calls will be ignored .
public void Run()
        {
            try
            {
                Initialize();
                Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType + " is running (press Ctrl-C to stop)...");
                AdkConsoleWait adkConsoleWait = new AdkConsoleWait();
                adkConsoleWait.Exiting += delegate { Shutdown(ProvisioningFlags.Unprovide); };
                adkConsoleWait.WaitForExit();
            }
            catch (AdkConfigException e)
            {
                if (log.IsErrorEnabled) log.Error("Unable to find the associated configuration file for this SIF Agent.", e);
                throw;
            }
            catch (AdkException e)
            {
                if (log.IsErrorEnabled) log.Error("ADK could not be initialised or error running the SIF Agent.", e);
                throw;
            }
            catch (IOException e)
            {
                if (log.IsErrorEnabled) log.Error("IO error occurred.", e);
                throw;
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled) log.Error("SIF Agent failed with an unexpected error.", e);
                throw;
            }
            finally
            {
                Shutdown(ProvisioningFlags.Unprovide);
            }
        }
public void Run ( ) { try { Initialize ( ) ; Console . WriteLine ( System . Reflection . MethodBase . GetCurrentMethod ( ) . DeclaringType + " " ) ; AdkConsoleWait adkConsoleWait = new AdkConsoleWait ( ) ; adkConsoleWait . Exiting += delegate { Shutdown ( ProvisioningFlags . Unprovide ) ; } ; adkConsoleWait . WaitForExit ( ) ; } catch ( AdkConfigException e ) { if ( log . IsErrorEnabled ) log . Error ( " " , e ) ; throw ; } catch ( AdkException e ) { if ( log . IsErrorEnabled ) log . Error ( " " , e ) ; throw ; } catch ( IOException e ) { if ( log . IsErrorEnabled ) log . Error ( " " , e ) ; throw ; } catch ( Exception e ) { if ( log . IsErrorEnabled ) log . Error ( " " , e ) ; throw ; } finally { Shutdown ( ProvisioningFlags . Unprovide ) ; } }
This method will run the SIF Agent.
This method will run the SIF Agent .