Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,51 +81,43 @@ internal void RegisterJobSourceAdapter(Type jobSourceAdapterType)
Dbg.Assert(jobSourceAdapterType != null, "JobSourceAdapterType should never be called with null value.");
object instance = null;

if (jobSourceAdapterType.FullName != null && jobSourceAdapterType.FullName.EndsWith("WorkflowJobSourceAdapter", StringComparison.OrdinalIgnoreCase))
ConstructorInfo constructor = jobSourceAdapterType.GetConstructor(Type.EmptyTypes);
if (!constructor.IsPublic)
{
MethodInfo method = jobSourceAdapterType.GetMethod("GetInstance");
instance = method.Invoke(null, null);
string message = string.Format(CultureInfo.CurrentCulture,
RemotingErrorIdStrings.JobManagerRegistrationConstructorError,
jobSourceAdapterType.FullName);
throw new InvalidOperationException(message);
}
else
{
ConstructorInfo constructor = jobSourceAdapterType.GetConstructor(Type.EmptyTypes);
if (!constructor.IsPublic)
{
string message = string.Format(CultureInfo.CurrentCulture,
RemotingErrorIdStrings.JobManagerRegistrationConstructorError,
jobSourceAdapterType.FullName);
throw new InvalidOperationException(message);
}

try
{
instance = constructor.Invoke(null);
}
catch (MemberAccessException exception)
{
_tracer.TraceException(exception);
throw;
}
catch (TargetInvocationException exception)
{
_tracer.TraceException(exception);
throw;
}
catch (TargetParameterCountException exception)
{
_tracer.TraceException(exception);
throw;
}
catch (NotSupportedException exception)
{
_tracer.TraceException(exception);
throw;
}
catch (SecurityException exception)
{
_tracer.TraceException(exception);
throw;
}
try
{
instance = constructor.Invoke(null);
}
catch (MemberAccessException exception)
{
_tracer.TraceException(exception);
throw;
}
catch (TargetInvocationException exception)
{
_tracer.TraceException(exception);
throw;
}
catch (TargetParameterCountException exception)
{
_tracer.TraceException(exception);
throw;
}
catch (NotSupportedException exception)
{
_tracer.TraceException(exception);
throw;
}
catch (SecurityException exception)
{
_tracer.TraceException(exception);
throw;
}

if (instance != null)
Expand Down