View Javadoc

1   /**
2    *
3    * Copyright 2005 The Apache Software Foundation
4    *
5    *  Licensed under the Apache License, Version 2.0 (the "License");
6    *  you may not use this file except in compliance with the License.
7    *  You may obtain a copy of the License at
8    *
9    *     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  package org.apache.geronimo.connector.outbound;
18  
19  import org.apache.geronimo.connector.ResourceAdapterWrapper;
20  import org.apache.geronimo.gbean.GBeanInfo;
21  import org.apache.geronimo.gbean.GBeanInfoBuilder;
22  import org.apache.geronimo.gbean.AbstractName;
23  import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
24  import org.apache.geronimo.kernel.Kernel;
25  import org.apache.geronimo.transaction.manager.ResourceManager;
26  import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
27  
28  /**
29   *
30   * @version $Revision: 396206 $
31   */
32  public class ManagedConnectionFactoryWrapperGBean {
33  
34      public static final GBeanInfo GBEAN_INFO;
35  
36      static {
37          GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(ManagedConnectionFactoryWrapperGBean.class, ManagedConnectionFactoryWrapper.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
38  
39          infoFactory.addAttribute("managedConnectionFactoryClass", String.class, true);
40          infoFactory.addAttribute("connectionFactoryInterface", String.class, true);
41          infoFactory.addAttribute("implementedInterfaces", String[].class, true);
42          infoFactory.addAttribute("connectionFactoryImplClass", String.class, true);
43          infoFactory.addAttribute("connectionInterface", String.class, true);
44          infoFactory.addAttribute("connectionImplClass", String.class, true);
45          infoFactory.addAttribute("kernel", Kernel.class, false);
46          infoFactory.addAttribute("abstractName", AbstractName.class, false);
47          infoFactory.addAttribute("objectName", String.class, false);
48          infoFactory.addAttribute("classLoader", ClassLoader.class, false);
49  
50          infoFactory.addOperation("$getResource");
51          infoFactory.addOperation("$getConnectionFactory");
52          infoFactory.addOperation("$getManagedConnectionFactory");
53  
54          infoFactory.addInterface(ResourceManager.class);
55          infoFactory.addInterface(JCAManagedConnectionFactory.class);
56  
57          infoFactory.addReference("ResourceAdapterWrapper", ResourceAdapterWrapper.class, NameFactory.RESOURCE_ADAPTER);
58          infoFactory.addReference("ConnectionManagerContainer", ConnectionManagerContainer.class, NameFactory.JCA_CONNECTION_MANAGER);
59  
60          infoFactory.setConstructor(new String[]{
61              "managedConnectionFactoryClass",
62              "connectionFactoryInterface",
63              "implementedInterfaces",
64              "connectionFactoryImplClass",
65              "connectionInterface",
66              "connectionImplClass",
67              "ResourceAdapterWrapper",
68              "ConnectionManagerContainer",
69              "kernel",
70              "abstractName",
71              "objectName",
72              "classLoader"});
73  
74          GBEAN_INFO = infoFactory.getBeanInfo();
75      }
76  
77      public static GBeanInfo getGBeanInfo() {
78          return GBEAN_INFO;
79      }
80  
81  }