context.getRuntimeContext().setRuntimeTask(new RuntimeTask() {
public void execute(RuntimeTaskContext context) throws OperationFailedException {
ServiceTarget serviceTarget = context.getServiceTarget();
WorkManager wm = new WorkManagerImpl();
final WorkManagerService wmService = new WorkManagerService(wm);
serviceTarget
.addService(ConnectorServices.WORKMANAGER_SERVICE, wmService)
.addDependency(ThreadsServices.EXECUTOR.append(shortRunningThreadPool), Executor.class,
wmService.getExecutorShortInjector())
.addDependency(ThreadsServices.EXECUTOR.append(longRunningThreadPool), Executor.class,
wmService.getExecutorLongInjector())
.addDependency(TxnServices.JBOSS_TXN_XA_TERMINATOR, JBossXATerminator.class,
wmService.getXaTerminatorInjector()).setInitialMode(Mode.ACTIVE).install();
CloneableBootstrapContext ctx = new BaseCloneableBootstrapContext();
final DefaultBootStrapContextService defaultBootCtxService = new DefaultBootStrapContextService(ctx);
serviceTarget
.addService(ConnectorServices.DEFAULT_BOOTSTRAP_CONTEXT_SERVICE, defaultBootCtxService)