}
};
} else if (GERONIMO_TM.equalsIgnoreCase(property)){
System.out.println("Transaction manager used: Geronimo");
final String lookup = GeronimoTransactionManagerLookup.class.getName();
final GeronimoTransactionManagerLookup instance = new GeronimoTransactionManagerLookup();
operations = new Operations() {
@Override
public UserTransaction getUserTransaction() {
try {
return instance.getUserTransaction();
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
@Override
public void cleanup() {
}
@Override
public String getLookup() {
return lookup;
}
@Override
public TransactionManagerLookup lookup() {
return instance;
}
@Override
public TransactionManager getManager() {
try {
return instance.getTransactionManager();
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
};
} else {
System.out.println("Transaction manager used: JBossTM");
final String lookup = JBossStandaloneJTAManagerLookup.class.getName();
final JBossStandaloneJTAManagerLookup instance = new JBossStandaloneJTAManagerLookup();
operations = new Operations() {
@Override
public UserTransaction getUserTransaction() {
try {
return instance.getUserTransaction();
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
@Override
public void cleanup() {
}
@Override
public String getLookup() {
return lookup;
}
@Override
public TransactionManagerLookup lookup() {
return instance;
}
@Override
public TransactionManager getManager() {
try {
return instance.getTransactionManager();
}
catch (Exception e) {
throw new RuntimeException(e);
}
}