provideConstructor = null;
}
Preconditions.checkArgument ((provideMethod != null) || (provideConstructor != null));
final ComponentCallbacks callbacks;
if (provideMethod != null) {
final CallbackProxy callbacksProxy;
Threading.setDefaultContext (context.threading);
try {
try {
callbacksProxy = (CallbackProxy) provideMethod.invoke (null, context);
} catch (final InvocationTargetException wrapper) {
context.exceptions.trace (ExceptionResolution.Handled, wrapper);
throw (wrapper.getCause ());
}
} catch (final Throwable exception) {
context.exceptions.trace (ExceptionResolution.Handled, exception);
throw (new IllegalArgumentException (String.format ("invalid callbacks provider class `%s` (error encountered while invocking)", this.clasz.getName ()), exception));
} finally {
Threading.setDefaultContext (null);
}
Preconditions.checkArgument (callbacksProxy != null, "invalid callbacks (is null)");
Preconditions.checkArgument (ComponentCallbacks.class.isInstance (callbacksProxy), "invalid callbacks proxy `%s` (not an instance of `ComponentCallbacks`)", callbacksProxy.getClass ().getName ());
Preconditions.checkArgument (CallbackProxy.class.isInstance (callbacksProxy), "invalid callbacks proxy `%s` (not an instance of `CallbackProxy`)", callbacksProxy.getClass ().getName ());
callbacks = (ComponentCallbacks) callbacksProxy;
} else if (provideConstructor != null) {
final CallbackHandler callbacksHandler;
Threading.setDefaultContext (context.threading);
try {