01: package hero.ra.loadclass;
02:
03: /**
04: *
05: * Bonita
06: * Copyright (C) 1999 Bull S.A.
07: * Bull 68 route de versailles 78434 Louveciennes Cedex France
08: * Further information: bonita@objectweb.org
09: *
10: * This library is free software; you can redistribute it and/or
11: * modify it under the terms of the GNU Lesser General Public
12: * License as published by the Free Software Foundation; either
13: * version 2.1 of the License, or any later version.
14: *
15: * This library is distributed in the hope that it will be useful,
16: * but WITHOUT ANY WARRANTY; without even the implied warranty of
17: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18: * Lesser General Public License for more details.
19: *
20: * You should have received a copy of the GNU Lesser General Public
21: * License along with this library; if not, write to the Free Software
22: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23: * USA
24: *
25: *
26: --------------------------------------------------------------------------
27: * $Id$
28: *
29: --------------------------------------------------------------------------
30: */
31:
32: import java.lang.reflect.Method;
33:
34: import hero.ra.BonitaService;
35: import hero.util.ServerType;
36:
37: public class LoadClass implements BonitaService, LoadClassMBean {
38: public void startService() throws Exception {
39: if (ServerType.isJonas()) {
40: /*
41: * Invoke dynamically the code referencing JOnAS classes to enable
42: * compilation with JBoss, which does not contain those classes.
43: */
44: Class clazz = Class
45: .forName("hero.ra.loadclass.LoadClassJonas");
46: Method method = clazz.getDeclaredMethod(
47: "modifyClassLoader", new Class[0]);
48: method.invoke(null, new Object[0]);
49: }
50: }
51:
52: public void stopService() {
53: }
54: }
|