JobExecutionException.cs :  » Business-Application » Quartz-Enterprise-Scheduler » Quartz » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Business Application » Quartz Enterprise Scheduler 
Quartz Enterprise Scheduler » Quartz » JobExecutionException.cs
/* 
* Copyright 2004-2009 James House 
* 
* Licensed under the Apache License, Version 2.0 (the "License"); you may not 
* use this file except in compliance with the License. You may obtain a copy 
* of the License at 
* 
*   http://www.apache.org/licenses/LICENSE-2.0 
*   
* Unless required by applicable law or agreed to in writing, software 
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
* License for the specific language governing permissions and limitations 
* under the License.
* 
*/

/*
* Previously Copyright (c) 2001-2004 James House
*/
using System;
using System.Globalization;
using System.Runtime.Serialization;

namespace Quartz{
  /// <summary>
  /// An exception that can be thrown by a <see cref="IJob" />
  /// to indicate to the Quartz <see cref="IScheduler" /> that an error
  /// occured while executing, and whether or not the <see cref="IJob" /> requests
  /// to be re-fired immediately (using the same <see cref="JobExecutionContext" />,
  /// or whether it wants to be unscheduled.
    /// </summary>
  /// <remarks>
  /// Note that if the flag for 'refire immediately' is set, the flags for
  /// unscheduling the Job are ignored.
  /// </remarks>
  /// <seealso cref="IJob" />
  /// <seealso cref="JobExecutionContext" />
  /// <seealso cref="SchedulerException" />
  /// <author>James House</author>
  [Serializable]
  public class JobExecutionException : SchedulerException
  {
    private bool refire = false;
    private bool unscheduleTrigg = false;
    private bool unscheduleAllTriggs = false;

    /// <summary>
    /// Gets or sets a value indicating whether to unschedule firing trigger.
    /// </summary>
    /// <value>
    ///   <c>true</c> if firing trigger should be unscheduled; otherwise, <c>false</c>.
    /// </value>
    public virtual bool UnscheduleFiringTrigger
    {
      set { unscheduleTrigg = value; }
      get { return unscheduleTrigg; }
    }

    /// <summary>
    /// Gets or sets a value indicating whether to unschedule all triggers.
    /// </summary>
    /// <value>
    ///   <c>true</c> if all triggers should be unscheduled; otherwise, <c>false</c>.
    /// </value>
    public virtual bool UnscheduleAllTriggers
    {
      set { unscheduleAllTriggs = value; }
      get { return unscheduleAllTriggs; }
    }


    /// <summary>
    /// Create a JobExcecutionException, with the 're-fire immediately' flag set
    /// to <see langword="false" />.
    /// </summary>
    public JobExecutionException()
    {
    }

    /// <summary>
    /// Create a JobExcecutionException, with the given cause.
    /// </summary>
    /// <param name="cause">The cause.</param>
    public JobExecutionException(Exception cause) : base(cause)
    {
    }

    /// <summary>
    /// Create a JobExcecutionException, with the given message.
    /// </summary>
    public JobExecutionException(string msg) : base(msg)
    {
    }

    /// <summary>
    /// Initializes a new instance of the <see cref="JobExecutionException"/> class.
    /// </summary>
    /// <param name="msg">The message.</param>
    /// <param name="cause">The original cause.</param>
    public JobExecutionException(string msg, Exception cause) : base(msg, cause)
    {
    }

    /// <summary>
    /// Create a JobExcecutionException with the 're-fire immediately' flag set
    /// to the given value.
    /// </summary>
    public JobExecutionException(bool refireImmediately)
    {
      refire = refireImmediately;
    }

    /// <summary>
    /// Create a JobExcecutionException with the given underlying exception, and
    /// the 're-fire immediately' flag set to the given value.
    /// </summary>
    public JobExecutionException(Exception cause, bool refireImmediately) : base(cause)
    {
      refire = refireImmediately;
    }

    /// <summary>
    /// Create a JobExcecutionException with the given message, and underlying
    /// exception, and the 're-fire immediately' flag set to the given value.
    /// </summary>
    public JobExecutionException(string msg, Exception cause, bool refireImmediately) : base(msg, cause)
    {
      refire = refireImmediately;
    }

        /// <summary>
        /// Initializes a new instance of the <see cref="JobExecutionException"/> class.
        /// </summary>
        /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"></see> that holds the serialized object data about the exception being thrown.</param>
        /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"></see> that contains contextual information about the source or destination.</param>
        /// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult"></see> is zero (0). </exception>
        /// <exception cref="T:System.ArgumentNullException">The info parameter is null. </exception>
        public JobExecutionException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }

    /// <summary>
    /// Gets or sets a value indicating whether to refire immediately.
    /// </summary>
    /// <value><c>true</c> if to refire immediately; otherwise, <c>false</c>.</value>
    public virtual bool RefireImmediately
    {
      get { return refire; }
            set { refire = value; }
    }

        /// <summary>
        /// Creates and returns a string representation of the current exception.
        /// </summary>
        /// <returns>
        /// A string representation of the current exception.
        /// </returns>
        /// <PermissionSet><IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" PathDiscovery="*AllFiles*"/></PermissionSet>
      public override string ToString()
      {
            return
                string.Format(CultureInfo.InvariantCulture,
                    "Parameters: refire = {0}, unscheduleFiringTrigger = {1}, unscheduleAllTriggers = {2} \n {3}",
                    RefireImmediately, UnscheduleFiringTrigger, UnscheduleAllTriggers, base.ToString());
      }
  }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.