01: package net.sourceforge.jaxor.example.pico;
02:
03: import net.sourceforge.jaxor.api.JaxorContext;
04: import org.picocontainer.lifecycle.Stoppable;
05:
06: /**
07: * Created By: Mike
08: * Date: Jan 15, 2004
09: * Time: 8:28:18 PM
10: *
11: * Last Checkin: $Author: mrettig $
12: * Date: $Date: 2004/01/21 04:09:51 $
13: * Revision: $Revision: 1.6 $
14: */
15: public class JaxorContainer implements Stoppable {
16:
17: private final JaxorContext _jaxorContext;
18:
19: public JaxorContainer(JaxorContext jaxorContext) {
20: _jaxorContext = jaxorContext;
21: }
22:
23: public JaxorContext getContext() {
24: return _jaxorContext;
25: }
26:
27: /**
28: * Commits and closes the jaxor context. Called by the pico container.
29: */
30: public void stop() {
31: try {
32: _jaxorContext.commit();
33: } finally {
34: _jaxorContext.end();
35: }
36: }
37:
38: }
|