01: /**
02: * JOnAS : Java(TM) OpenSource Application Server
03: * Copyright (C) 2005 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: JAXRResourceAdapter.java 7251 2005-08-17 13:13:45Z sauthieg $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas.jaxr.scout;
25:
26: import javax.resource.ResourceException;
27: import javax.resource.spi.ActivationSpec;
28: import javax.resource.spi.BootstrapContext;
29: import javax.resource.spi.ResourceAdapter;
30: import javax.resource.spi.ResourceAdapterInternalException;
31: import javax.resource.spi.endpoint.MessageEndpointFactory;
32: import javax.transaction.xa.XAResource;
33: import org.objectweb.jonas.common.Log;
34: import org.objectweb.util.monolog.api.BasicLevel;
35: import org.objectweb.util.monolog.api.Logger;
36:
37: /**
38: * This is a very simple ResourceAdapter just used to display traces.
39: *
40: * @author Guillaume Sauthier
41: */
42: public class JAXRResourceAdapter implements ResourceAdapter {
43:
44: /**
45: * Logger for this ra
46: */
47: private static Logger logger = null;
48:
49: /**
50: * Display Info log at JAXR Connector start.
51: * @see javax.resource.spi.ResourceAdapter#start(javax.resource.spi.BootstrapContext)
52: */
53: public void start(BootstrapContext bCtx)
54: throws ResourceAdapterInternalException {
55: logger = Log.getLogger(Log.JONAS_JAXR_PREFIX);
56: logger.log(BasicLevel.INFO, "Starting Scout ResourceAdapter");
57: }
58:
59: /**
60: * Display Info log at JAXR Connector stop.
61: * @see javax.resource.spi.ResourceAdapter#stop()
62: */
63: public void stop() {
64: logger.log(BasicLevel.INFO, "Stopping Scout ResourceAdapter");
65: logger = null;
66: }
67:
68: /**
69: * Not used.
70: * @see javax.resource.spi.ResourceAdapter#endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec)
71: */
72: public void endpointActivation(MessageEndpointFactory mef,
73: ActivationSpec as) throws ResourceException {
74: // NA
75: }
76:
77: /**
78: * Not used.
79: * @see javax.resource.spi.ResourceAdapter#endpointDeactivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec)
80: */
81: public void endpointDeactivation(MessageEndpointFactory mef,
82: ActivationSpec as) {
83: // NA
84: }
85:
86: /**
87: * Not used.
88: * @see javax.resource.spi.ResourceAdapter#getXAResources(javax.resource.spi.ActivationSpec[])
89: */
90: public XAResource[] getXAResources(ActivationSpec[] as)
91: throws ResourceException {
92: // NA
93: return null;
94: }
95: }
|