BTM
  1. BTM
  2. BTM-25

add shutdown support for app servers

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.3.1
    • Labels:
      None
    • Number of attachments :
      0

      Description

      add shutdown support for app servers

        Activity

        Hide
        Arnaud Cogoluegnes added a comment -

        for jetty 6.1

        package bitronix.tm.utils;

        import org.mortbay.component.AbstractLifeCycle;

        import bitronix.tm.TransactionManagerServices;

        public class BitronixLifeCycle extends AbstractLifeCycle {

        @Override
        protected void doStart() throws Exception

        { TransactionManagerServices.getTransactionManager(); }

        @Override
        protected void doStop() throws Exception

        { TransactionManagerServices.getTransactionManager().shutdown(); }

        }

        for tomcat 6.0

        package bitronix.tm.utils;

        import org.apache.catalina.Lifecycle;
        import org.apache.catalina.LifecycleEvent;
        import org.apache.catalina.LifecycleListener;

        import bitronix.tm.TransactionManagerServices;

        public class BitronixLifecycleListener implements LifecycleListener {

        public void lifecycleEvent(LifecycleEvent event) {
        if (Lifecycle.START_EVENT.equals(event.getType()))

        { TransactionManagerServices.getTransactionManager(); }

        else if (Lifecycle.STOP_EVENT.equals(event.getType()))

        { TransactionManagerServices.getTransactionManager().shutdown(); }

        }

        }

        Show
        Arnaud Cogoluegnes added a comment - for jetty 6.1 package bitronix.tm.utils; import org.mortbay.component.AbstractLifeCycle; import bitronix.tm.TransactionManagerServices; public class BitronixLifeCycle extends AbstractLifeCycle { @Override protected void doStart() throws Exception { TransactionManagerServices.getTransactionManager(); } @Override protected void doStop() throws Exception { TransactionManagerServices.getTransactionManager().shutdown(); } } for tomcat 6.0 package bitronix.tm.utils; import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleListener; import bitronix.tm.TransactionManagerServices; public class BitronixLifecycleListener implements LifecycleListener { public void lifecycleEvent(LifecycleEvent event) { if (Lifecycle.START_EVENT.equals(event.getType())) { TransactionManagerServices.getTransactionManager(); } else if (Lifecycle.STOP_EVENT.equals(event.getType())) { TransactionManagerServices.getTransactionManager().shutdown(); } } }
        Hide
        Ludovic Orban added a comment -

        See: http://www.nabble.com/BTM-1.3-final-released-to19024619.html#a19034462

        The Tomcat LifecycleListener and the Jetty LifeCycle should be part of the distribution.

        Show
        Ludovic Orban added a comment - See: http://www.nabble.com/BTM-1.3-final-released-to19024619.html#a19034462 The Tomcat LifecycleListener and the Jetty LifeCycle should be part of the distribution.
        Hide
        Ludovic Orban added a comment -

        Both Jetty and Tomcat helper classes have been added to the distribution as binary JAR files.

        Show
        Ludovic Orban added a comment - Both Jetty and Tomcat helper classes have been added to the distribution as binary JAR files.

          People

          • Assignee:
            Ludovic Orban
            Reporter:
            Arnaud Cogoluegnes
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: