01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.geronimo.connector.mock;
17:
18: import javax.resource.ResourceException;
19: import javax.resource.spi.ActivationSpec;
20: import javax.resource.spi.BootstrapContext;
21: import javax.resource.spi.ResourceAdapter;
22: import javax.resource.spi.ResourceAdapterInternalException;
23: import javax.resource.spi.endpoint.MessageEndpointFactory;
24: import javax.transaction.xa.XAResource;
25:
26: /**
27: *
28: *
29: * @version $Rev: 476049 $ $Date: 2006-11-16 20:35:17 -0800 (Thu, 16 Nov 2006) $
30: *
31: * */
32: public class MockResourceAdapter implements ResourceAdapter {
33:
34: private BootstrapContext bootstrapContext;
35:
36: private String raStringProperty;
37:
38: public void start(BootstrapContext bootstrapContext)
39: throws ResourceAdapterInternalException {
40: assert this .bootstrapContext == null : "Attempting to restart adapter without stoppping";
41: assert bootstrapContext != null : "Null bootstrap context";
42: this .bootstrapContext = bootstrapContext;
43: }
44:
45: public void stop() {
46: bootstrapContext = null;
47: }
48:
49: public void endpointActivation(
50: MessageEndpointFactory endpointFactory, ActivationSpec spec)
51: throws ResourceException {
52: }
53:
54: public void endpointDeactivation(
55: MessageEndpointFactory endpointFactory, ActivationSpec spec) {
56: }
57:
58: public XAResource[] getXAResources(ActivationSpec[] specs)
59: throws ResourceException {
60: return new XAResource[0];
61: }
62:
63: public String getRAStringProperty() {
64: return raStringProperty;
65: }
66:
67: public void setRAStringProperty(String raStringProperty) {
68: this.raStringProperty = raStringProperty;
69: }
70:
71: }
|