@Override public void start(final StartContext context) throws StartException { if (this.asyncStart) { Runnable task = () -> { try { this.service.start(context); context.complete(); } catch (StartException e) { context.failed(e); } catch (Throwable e) { context.failed(new StartException(e)); } }; try { this.executor.get().execute(task); } catch (RejectedExecutionException e) { task.run(); } finally { context.asynchronous(); } } else { this.service.start(context); } }
@Override public void run() { try { startContext(); startContext.complete(); } catch (Throwable e) { startContext.failed(new StartException(e)); } } });
@Override public void start(final StartContext context) throws StartException { if (this.startAsynchronously) { Runnable task = () -> { try { this.service.start(context); context.complete(); } catch (StartException e) { context.failed(e); } catch (Throwable e) { context.failed(new StartException(e)); } }; try { this.executor.getValue().execute(task); } catch (RejectedExecutionException e) { task.run(); } finally { context.asynchronous(); } } else { this.service.start(context); } }
@Override public void run() { try { // TODO -- one of the 3 previous synchronous calls to this method don't had the TCCL set, // but the other two don't. I (BES 2013/10/21) intepret from that that setting the TCCL // was not necessary and in caller that had it set it was an artifact of WritableServiceBasedNamingStore.pushOwner(serviceName); unregisterAll(deploymentName); } finally { WritableServiceBasedNamingStore.popOwner(); context.failed(ConnectorLogger.ROOT_LOGGER.failedToStartRaDeployment(cause, deploymentName)); } } };
@Override public void run() { try { getValue().start(); context.complete(); } catch (Throwable e) { context.failed(new StartException(e)); } } };
@Override public void run() { try { invokeLifecycleMethod(startMethod, context); context.complete(); } catch (Throwable e) { context.failed(new StartException(SarLogger.ROOT_LOGGER.failedExecutingLegacyMethod("start()"), e)); } } };
@Override public void startJobRepository(final StartContext context) throws StartException { final ExecutorService service = executor.getValue(); final Runnable task = () -> { try { // Currently in jBeret tables are created in the constructor which is why this is done asynchronously jobRepository = new JdbcRepository(dataSourceValue.getValue()); context.complete(); } catch (Exception e) { context.failed(BatchLogger.LOGGER.failedToCreateJobRepository(e, "JDBC")); } }; try { service.execute(task); } catch (RejectedExecutionException e) { task.run(); } finally { context.asynchronous(); } }
@Override public void run() { try { injectDependencies(); invokeLifecycleMethod(createMethod, context); if (componentInstantiator != null) { managedReference = componentInstantiator.initializeInstance(mBeanInstance); } context.complete(); } catch (Throwable e) { uninjectDependencies(); context.failed(new StartException(SarLogger.ROOT_LOGGER.failedExecutingLegacyMethod("create()"), e)); } } };
@Override public void run() { ClassLoader old = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WritableServiceBasedNamingStore.pushOwner(duServiceName); WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(toUse); unregisterAll(deploymentName); } finally { try { context.failed(ConnectorLogger.ROOT_LOGGER.failedToStartRaDeployment(cause, deploymentName)); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(old); WritableServiceBasedNamingStore.popOwner(); } } } };
monitor.awaitStability(); } catch (InterruptedException ex) { context.failed(new StartException(ex)); Thread.currentThread().interrupt(); throw new RuntimeException(ex);
public void run() { try { BaseScheduledJob.this.start(); context.complete(); } catch (Exception e) { context.failed( new StartException( e ) ); } } });
@Override public void run() { try { getValue().start(); context.complete(); } catch (Throwable e) { context.failed(new StartException(e)); } } });
@Override public void run() { try { client.resolveBootUpdates(controller, future); context.complete(); } catch (Exception e) { future.failed(e); context.failed(new StartException(e)); } } };