Bureaucrat Job Class, Seriously

I was looking through some code and found this class recently.  It almost reminds me of a class I saw called a speed up loop.  This however, is obviously more important to the grand scheme of politics eh!

public class BureaucratJob : IJob
{
    readonly ITradeReconciler reconciler;
    readonly ICalculationQueue queue;
    ILog log;
        
    public BureaucratJob(ITradeReconciler reconciler, ICalculationQueue queue)
    {
        this.reconciler = reconciler;
        this.queue = queue;
    }

    public void RedTape(object[] formsInTriplicate)
    {
        // intentionally doing nothing, just like any good ol American Bureaucrat!
    }

    public void Execute(JobExecutionContext context)
    {
        RedTape(new[] { "formsInTriplicate", "formsInTriplicate", "formsInTriplicate" });

        log = LogManager.GetLogger(typeof(BureaucratJob));
        log.Info(string.Format("Job Executing, it's currently {0} and all is well", DateTime.Now));

        log.Info("Reconciliation is starting.");
            
        var work = IoC.Resolve<IUnitOfWorkManager>();

        work.Begin();
            
        reconciler.Go();

        log.Info("Reconciliation has finished.  Calculation queue is now processing.");

        queue.Process();

        work.Commit();
        work.Complete();

        log.Info("Calculation queue is queued out n' done.");
    }
}

Hope you enjoyed the code read. :) Cheers!

Shout it

One thought on “Bureaucrat Job Class, Seriously

  1. DotNetShoutout

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s