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.openejb;
17:
18: import java.util.Collection;
19:
20: import org.apache.geronimo.gbean.GBeanInfo;
21: import org.apache.geronimo.gbean.GBeanInfoBuilder;
22: import org.apache.geronimo.gbean.GBeanLifecycle;
23: import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
24: import org.apache.geronimo.management.J2EEServer;
25: import org.apache.geronimo.management.J2EEApplication;
26: import org.apache.geronimo.management.EJB;
27: import org.apache.openejb.assembler.classic.EjbJarInfo;
28:
29: /**
30: * @version $Revision: 583409 $ $Date: 2007-10-10 02:38:51 -0700 (Wed, 10 Oct 2007) $
31: */
32: public final class EjbModuleImplGBean extends EjbModuleImpl implements
33: GBeanLifecycle {
34: public EjbModuleImplGBean(String objectName, J2EEServer server,
35: J2EEApplication application, String deploymentDescriptor,
36: Collection<? extends EJB> ejbs, ClassLoader classLoader,
37: OpenEjbSystem openEjbSystem, EjbJarInfo ejbJarInfo) {
38: super (objectName, server, application, deploymentDescriptor,
39: ejbs, classLoader, openEjbSystem, ejbJarInfo);
40: }
41:
42: public void doStart() throws Exception {
43: start();
44: }
45:
46: public void doStop() throws Exception {
47: stop();
48: }
49:
50: public void doFail() {
51: stop();
52: }
53:
54: public static final GBeanInfo GBEAN_INFO;
55:
56: static {
57: GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(
58: EjbModuleImplGBean.class, NameFactory.EJB_MODULE);
59: infoBuilder.addReference("J2EEServer", J2EEServer.class);
60: infoBuilder.addReference("J2EEApplication",
61: J2EEApplication.class);
62:
63: infoBuilder.addAttribute("deploymentDescriptor", String.class,
64: true);
65:
66: infoBuilder.addReference("EJBCollection", EJB.class);
67:
68: infoBuilder.addAttribute("classLoader", ClassLoader.class,
69: false);
70:
71: infoBuilder.addReference("OpenEjbSystem", OpenEjbSystem.class);
72: infoBuilder.addAttribute("ejbJarInfo", EjbJarInfo.class, true);
73:
74: infoBuilder.setConstructor(new String[] { "objectName",
75: "J2EEServer", "J2EEApplication",
76: "deploymentDescriptor", "EJBCollection", "classLoader",
77: "OpenEjbSystem", "ejbJarInfo" });
78:
79: GBEAN_INFO = infoBuilder.getBeanInfo();
80: }
81:
82: public static GBeanInfo getGBeanInfo() {
83: return GBEAN_INFO;
84: }
85: }
|