/// <summary> /// Creates a new job of the appropriate type given by JobDefinition passed in. /// </summary> /// <param name="specification">JobInvocationInfo defining the command.</param> /// <returns>Job2 object of the appropriate type specified by the definition.</returns> /// <exception cref="InvalidOperationException">If JobSourceAdapter type specified /// in definition is not registered.</exception> /// <exception cref="Exception">JobSourceAdapter implementation exception thrown on error. /// </exception> public Job2 NewJob(JobInvocationInfo specification) { if (specification == null) { throw new ArgumentNullException("specification"); } if (specification.Definition == null) { throw new ArgumentException(RemotingErrorIdStrings.NewJobSpecificationError, "specification"); } JobSourceAdapter sourceAdapter = GetJobSourceAdapter(specification.Definition); Job2 newJob = null; #pragma warning disable 56500 try { newJob = sourceAdapter.NewJob(specification); } catch (Exception exception) { // Since we are calling into 3rd party code // catching Exception is allowed. In all // other cases the appropriate exception // needs to be caught. // sourceAdapter.NewJob returned unknown error. _tracer.TraceException(exception); throw; } #pragma warning restore 56500 return(newJob); }
public Job2 NewJob(JobInvocationInfo specification) { if (specification == null) { throw new ArgumentNullException("specification"); } if (specification.Definition == null) { throw new ArgumentException(ResourceManagerCache.GetResourceString("RemotingErrorIdStrings", "NewJobSpecificationError"), "specification"); } JobSourceAdapter jobSourceAdapter = this.GetJobSourceAdapter(specification.Definition); Job2 job = null; try { job = jobSourceAdapter.NewJob(specification); } catch (Exception exception) { this.Tracer.TraceException(exception); CommandProcessorBase.CheckForSevereException(exception); throw; } return(job); }
/// <summary> /// Creates a new job of the appropriate type given by JobDefinition passed in. /// </summary> /// <param name="definition">JobDefinition defining the command.</param> /// <returns>Job2 object of the appropriate type specified by the definition.</returns> /// <exception cref="InvalidOperationException">If JobSourceAdapter type specified /// in definition is not registered.</exception> /// <exception cref="Exception">JobSourceAdapter implementation exception thrown on error. /// </exception> public Job2 NewJob(JobDefinition definition) { if (definition == null) { throw new ArgumentNullException(nameof(definition)); } JobSourceAdapter sourceAdapter = GetJobSourceAdapter(definition); Job2 newJob; #pragma warning disable 56500 try { newJob = sourceAdapter.NewJob(definition); } catch (Exception exception) { // Since we are calling into 3rd party code // catching Exception is allowed. In all // other cases the appropriate exception // needs to be caught. // sourceAdapter.NewJob returned unknown error. _tracer.TraceException(exception); throw; } #pragma warning restore 56500 return(newJob); }
public Job2 NewJob(JobDefinition definition) { Job2 job; if (definition == null) { throw new ArgumentNullException("definition"); } JobSourceAdapter jobSourceAdapter = this.GetJobSourceAdapter(definition); try { job = jobSourceAdapter.NewJob(definition); } catch (Exception exception) { this.Tracer.TraceException(exception); CommandProcessorBase.CheckForSevereException(exception); throw; } return(job); }