@@ -81,51 +81,43 @@ internal void RegisterJobSourceAdapter(Type jobSourceAdapterType)
81
81
Dbg . Assert ( jobSourceAdapterType != null , "JobSourceAdapterType should never be called with null value." ) ;
82
82
object instance = null ;
83
83
84
- if ( jobSourceAdapterType . FullName != null && jobSourceAdapterType . FullName . EndsWith ( "WorkflowJobSourceAdapter" , StringComparison . OrdinalIgnoreCase ) )
84
+ ConstructorInfo constructor = jobSourceAdapterType . GetConstructor ( Type . EmptyTypes ) ;
85
+ if ( ! constructor . IsPublic )
85
86
{
86
- MethodInfo method = jobSourceAdapterType . GetMethod ( "GetInstance" ) ;
87
- instance = method . Invoke ( null , null ) ;
87
+ string message = string . Format ( CultureInfo . CurrentCulture ,
88
+ RemotingErrorIdStrings . JobManagerRegistrationConstructorError ,
89
+ jobSourceAdapterType . FullName ) ;
90
+ throw new InvalidOperationException ( message ) ;
88
91
}
89
- else
90
- {
91
- ConstructorInfo constructor = jobSourceAdapterType . GetConstructor ( Type . EmptyTypes ) ;
92
- if ( ! constructor . IsPublic )
93
- {
94
- string message = string . Format ( CultureInfo . CurrentCulture ,
95
- RemotingErrorIdStrings . JobManagerRegistrationConstructorError ,
96
- jobSourceAdapterType . FullName ) ;
97
- throw new InvalidOperationException ( message ) ;
98
- }
99
92
100
- try
101
- {
102
- instance = constructor . Invoke ( null ) ;
103
- }
104
- catch ( MemberAccessException exception )
105
- {
106
- _tracer . TraceException ( exception ) ;
107
- throw ;
108
- }
109
- catch ( TargetInvocationException exception )
110
- {
111
- _tracer . TraceException ( exception ) ;
112
- throw ;
113
- }
114
- catch ( TargetParameterCountException exception )
115
- {
116
- _tracer . TraceException ( exception ) ;
117
- throw ;
118
- }
119
- catch ( NotSupportedException exception )
120
- {
121
- _tracer . TraceException ( exception ) ;
122
- throw ;
123
- }
124
- catch ( SecurityException exception )
125
- {
126
- _tracer . TraceException ( exception ) ;
127
- throw ;
128
- }
93
+ try
94
+ {
95
+ instance = constructor . Invoke ( null ) ;
96
+ }
97
+ catch ( MemberAccessException exception )
98
+ {
99
+ _tracer . TraceException ( exception ) ;
100
+ throw ;
101
+ }
102
+ catch ( TargetInvocationException exception )
103
+ {
104
+ _tracer . TraceException ( exception ) ;
105
+ throw ;
106
+ }
107
+ catch ( TargetParameterCountException exception )
108
+ {
109
+ _tracer . TraceException ( exception ) ;
110
+ throw ;
111
+ }
112
+ catch ( NotSupportedException exception )
113
+ {
114
+ _tracer . TraceException ( exception ) ;
115
+ throw ;
116
+ }
117
+ catch ( SecurityException exception )
118
+ {
119
+ _tracer . TraceException ( exception ) ;
120
+ throw ;
129
121
}
130
122
131
123
if ( instance != null )
0 commit comments