public UserTransactionWithContext() throws SchedulerException { try { context = new InitialContext(); } catch (Throwable t) { throw new SchedulerException( "UserTransactionHelper failed to create InitialContext to lookup/create UserTransaction.", t); } try { userTransaction = (UserTransaction)context.lookup(userTxURL); } catch (Throwable t) { closeContext(); throw new SchedulerException( "UserTransactionHelper could not lookup/create UserTransaction.", t); } if (userTransaction == null) { closeContext(); throw new SchedulerException( "UserTransactionHelper could not lookup/create UserTransaction from the InitialContext."); } }
/** * Close the InitialContext that was used to lookup/create the * underlying UserTransaction. */ public void closeContext() { try { if (context != null) { context.close(); } } catch (Throwable t) { getLog().warn("Failed to close InitialContext used to get a UserTransaction.", t); } context = null; }
public UserTransactionWithContext() throws SchedulerException { try { context = new InitialContext(); } catch (Throwable t) { throw new SchedulerException( "UserTransactionHelper failed to create InitialContext to lookup/create UserTransaction.", t); } try { userTransaction = (UserTransaction)context.lookup(userTxURL); } catch (Throwable t) { closeContext(); throw new SchedulerException( "UserTransactionHelper could not lookup/create UserTransaction.", t); } if (userTransaction == null) { closeContext(); throw new SchedulerException( "UserTransactionHelper could not lookup/create UserTransaction from the InitialContext."); } }
public UserTransactionWithContext() throws SchedulerException { try { context = new InitialContext(); } catch (Throwable t) { throw new SchedulerException( "UserTransactionHelper failed to create InitialContext to lookup/create UserTransaction.", t); } try { userTransaction = (UserTransaction)context.lookup(userTxURL); } catch (Throwable t) { closeContext(); throw new SchedulerException( "UserTransactionHelper could not lookup/create UserTransaction.", t); } if (userTransaction == null) { closeContext(); throw new SchedulerException( "UserTransactionHelper could not lookup/create UserTransaction from the InitialContext."); } }
/** * Close the InitialContext that was used to lookup/create the * underlying UserTransaction. */ public void closeContext() { try { if (context != null) { context.close(); } } catch (Throwable t) { getLog().warn("Failed to close InitialContext used to get a UserTransaction.", t); } context = null; }
/** * Close the InitialContext that was used to lookup/create the * underlying UserTransaction. */ public void closeContext() { try { if (context != null) { context.close(); } } catch (Throwable t) { getLog().warn("Failed to close InitialContext used to get a UserTransaction.", t); } context = null; }
/** * When we are being garbage collected, make sure we were properly * returned to the UserTransactionHelper. */ protected void finalize() throws Throwable { try { if (context != null) { getLog().warn("UserTransaction was never returned to the UserTransactionHelper."); closeContext(); } } finally { super.finalize(); } }
/** * When we are being garbage collected, make sure we were properly * returned to the UserTransactionHelper. */ protected void finalize() throws Throwable { try { if (context != null) { getLog().warn("UserTransaction was never returned to the UserTransactionHelper."); closeContext(); } } finally { super.finalize(); } }
/** * Return a UserTransaction that was retrieved via getUserTransaction(). * This will make sure that the InitalContext used to lookup/create the * UserTransaction is properly cleaned up. */ public static void returnUserTransaction(UserTransaction userTransaction) { if ((userTransaction != null) && (userTransaction instanceof UserTransactionWithContext)) { UserTransactionWithContext userTransactionWithContext = (UserTransactionWithContext)userTransaction; userTransactionWithContext.closeContext(); } }
/** * Return a UserTransaction that was retrieved via getUserTransaction(). * This will make sure that the InitalContext used to lookup/create the * UserTransaction is properly cleaned up. */ public static void returnUserTransaction(UserTransaction userTransaction) { if ((userTransaction != null) && (userTransaction instanceof UserTransactionWithContext)) { UserTransactionWithContext userTransactionWithContext = (UserTransactionWithContext)userTransaction; userTransactionWithContext.closeContext(); } }
/** * Create/Lookup a UserTransaction in the InitialContext via the * name set in setUserTxLocation(). */ public static UserTransaction lookupUserTransaction() throws SchedulerException { return new UserTransactionWithContext(); }
/** * Create/Lookup a UserTransaction in the InitialContext via the * name set in setUserTxLocation(). */ public static UserTransaction lookupUserTransaction() throws SchedulerException { return new UserTransactionWithContext(); }
public UserTransactionWithContext() throws SchedulerException { try { context = new InitialContext(); } catch (Throwable t) { throw new SchedulerException( "UserTransactionHelper failed to create InitialContext to lookup/create UserTransaction.", t); } try { userTransaction = (UserTransaction)context.lookup(userTxURL); } catch (Throwable t) { closeContext(); throw new SchedulerException( "UserTransactionHelper could not lookup/create UserTransaction.", t); } if (userTransaction == null) { closeContext(); throw new SchedulerException( "UserTransactionHelper could not lookup/create UserTransaction from the InitialContext."); } }
/** * When we are being garbage collected, make sure we were properly * returned to the UserTransactionHelper. */ @Override protected void finalize() throws Throwable { try { if (context != null) { getLog().warn("UserTransaction was never returned to the UserTransactionHelper."); closeContext(); } } finally { super.finalize(); } }
/** * When we are being garbage collected, make sure we were properly * returned to the UserTransactionHelper. */ @Override protected void finalize() throws Throwable { try { if (context != null) { getLog().warn("UserTransaction was never returned to the UserTransactionHelper."); closeContext(); } } finally { super.finalize(); } }
/** * Close the InitialContext that was used to lookup/create the * underlying UserTransaction. */ public void closeContext() { try { if (context != null) { context.close(); } } catch (Throwable t) { getLog().warn("Failed to close InitialContext used to get a UserTransaction.", t); } context = null; }
/** * Create/Lookup a UserTransaction in the InitialContext via the * name set in setUserTxLocation(). */ public static UserTransaction lookupUserTransaction() throws SchedulerException { return new UserTransactionWithContext(); }
/** * Return a UserTransaction that was retrieved via getUserTransaction(). * This will make sure that the InitalContext used to lookup/create the * UserTransaction is properly cleaned up. */ public static void returnUserTransaction(UserTransaction userTransaction) { if ((userTransaction != null) && (userTransaction instanceof UserTransactionWithContext)) { UserTransactionWithContext userTransactionWithContext = (UserTransactionWithContext)userTransaction; userTransactionWithContext.closeContext(); } }
/** * Create/Lookup a UserTransaction in the InitialContext via the * name set in setUserTxLocation(). */ public static UserTransaction lookupUserTransaction() throws SchedulerException { return new UserTransactionWithContext(); }
/** * Return a UserTransaction that was retrieved via getUserTransaction(). * This will make sure that the InitalContext used to lookup/create the * UserTransaction is properly cleaned up. */ public static void returnUserTransaction(UserTransaction userTransaction) { if ((userTransaction != null) && (userTransaction instanceof UserTransactionWithContext)) { UserTransactionWithContext userTransactionWithContext = (UserTransactionWithContext)userTransaction; userTransactionWithContext.closeContext(); } }