public void start(ExtensionPointRegistry registry) {
if (registry != null) {
TransactionManager transactionManager = registry.getExtensionPoint(TransactionManager.class);
if (transactionManager != null) {
// The transaction manage is provided by the hosting environment
RuntimeWireProcessorExtensionPoint wireProcessorExtensionPoint =
registry.getExtensionPoint(RuntimeWireProcessorExtensionPoint.class);
TransactionManagerHelper helper = new TransactionManagerHelper(transactionManager);
wireProcessorExtensionPoint.addWireProcessor(new TransactionRuntimeWireProcessor(helper));
return;
}
}
try {
wrapper = new TransactionManagerWrapper();
wrapper.start();
} catch (Exception e) {
throw new IllegalStateException(e);
}
if (registry != null) {
registry.addExtensionPoint(wrapper.getTransactionManager());
RuntimeWireProcessorExtensionPoint wireProcessorExtensionPoint =
registry.getExtensionPoint(RuntimeWireProcessorExtensionPoint.class);
TransactionManagerHelper helper = new TransactionManagerHelper(wrapper.getTransactionManager());
wireProcessorExtensionPoint.addWireProcessor(new TransactionRuntimeWireProcessor(helper));
}
}