use of net.jini.core.transaction.server.TransactionManager in project camel by apache.
the class TransactionHelper method findTransactionManager.
private TransactionManager findTransactionManager(String uri) throws IOException, ClassNotFoundException {
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
// Creating service template to find transaction manager service by matching fields.
Class<?>[] classes = new Class<?>[] { net.jini.core.transaction.server.TransactionManager.class };
// Name sn = new Name("*");
ServiceTemplate tmpl = new ServiceTemplate(null, classes, new Entry[] {});
// Creating a lookup locator
LookupLocator locator = new LookupLocator(uri);
ServiceRegistrar sr = locator.getRegistrar();
TransactionManager tm = (TransactionManager) sr.lookup(tmpl);
return tm;
}
Aggregations