@Nullable protected Object execute( @Nonnull T callback ) { long start = System.currentTimeMillis(); Object returnValue; //noinspection CatchGenericClass try { returnValue = callbackCaller.call( callback ); } catch ( Throwable e ) { log.warn( "Got an exception", e ); returnValue = e; } long end = System.currentTimeMillis(); log.info( "Executing callback took " + ( end - start ) + "ms" ); return returnValue; } }
public void initializeWorker( @Nonnull CallbackCaller<T> callbackCaller ) { log.debug( "initializeWorker " + callbackCaller ); workerThread = new Thread( new AsyncWorker<T>( this, callbackCaller ), NAME_PREFIX + callbackCaller.getDescription() + ' ' + hashCode() ); workerThread.start(); initialized = true; }
public void initializeWorker( @NotNull CallbackCaller<T> callbackCaller ) { log.debug( "initializeWorker " + callbackCaller ); workerThread = new Thread( new AsyncWorker<T>( this, callbackCaller ), NAME_PREFIX + callbackCaller.getDescription() + ' ' + hashCode() ); workerThread.start(); initialized = true; }
@Nullable protected Object execute( @NotNull T callback ) { long start = System.currentTimeMillis(); Object returnValue; //noinspection CatchGenericClass try { returnValue = callbackCaller.call( callback ); } catch ( Throwable e ) { log.warn( "Got an exception", e ); returnValue = e; } long end = System.currentTimeMillis(); log.info( "Executing callback took " + ( end - start ) + "ms" ); return returnValue; } }