01: package org.apache.ojb.otm.connector;
02:
03: /* Copyright 2003-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * 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: */
17:
18: import javax.resource.ResourceException;
19: import javax.resource.spi.ManagedConnectionMetaData;
20:
21: /**
22: *
23: * @author <a href="mailto:mattbaird@yahoo.com">Matthew Baird<a>
24: */
25:
26: public class OTMConnectionMetaData implements ManagedConnectionMetaData {
27:
28: private OTMJCAManagedConnection mc;
29:
30: public OTMConnectionMetaData(OTMJCAManagedConnection mc) {
31: System.out.println("In OTMConnectionMetaData.constructor");
32: this .mc = mc;
33: }
34:
35: public String getEISProductName() throws ResourceException {
36: Util.log("In OTMConnectionMetaData.getEISProductName");
37: return "Apache OJB";
38: }
39:
40: public String getEISProductVersion() throws ResourceException {
41: Util.log("In OTMConnectionMetaData.getEISProductVersion");
42: return "1.0";
43:
44: }
45:
46: public int getMaxConnections() throws ResourceException {
47: Util.log("In OTMConnectionMetaData.getMaxConnections");
48: return 50; //MBAIRD: Remove this hardcoding.
49: }
50:
51: public String getUserName() throws ResourceException {
52: return mc.getUserName();
53: }
54:
55: }
|