01: /*
02: * JFolder, Copyright 2001-2006 Gary Steinmetz
03: *
04: * Distributable under LGPL license.
05: * See terms of license at gnu.org.
06: */
07:
08: package org.jfolder.services.base;
09:
10: //base classes
11: import java.net.URL;
12:
13: //project specific classes
14:
15: //other classes
16:
17: public abstract class AbstractBaseServiceCallerBean implements
18: BaseServiceCaller {
19:
20: private URL address = null;
21:
22: protected AbstractBaseServiceCallerBean(URL inAddress) {
23: this .address = inAddress;
24: }
25:
26: //protected boolean isAddressPresent() {
27: // return (this.address != null);
28: //}
29:
30: protected URL getAddress() {
31: return this .address;
32: }
33:
34: /*public abstract class AbstractBaseServiceCallerBean {
35:
36: public final static String GOVERNOR_SERVICE_NAME =
37: "JFolder:type=GovernorService";
38:
39: private static MBeanServer mbs = null;
40:
41: protected AbstractBaseServiceCallerBean() {
42: }
43:
44: public final static void setMBeanServer(MBeanServer inMbs) {
45: synchronized (AbstractBaseServiceCallerBean.class) {
46: if (AbstractBaseServiceCallerBean.mbs != null) {
47: throw new UnexpectedSystemException(
48: "MBeanServer can only be set once");
49: }
50: else {
51: AbstractBaseServiceCallerBean.mbs = inMbs;
52: }
53: }
54: }
55:
56: //public final static void getMBeanServerCount() {
57: // MiscHelper.println("Remove This");
58: // MiscHelper.println(
59: // AbstractBaseServiceCallerBean.mbs.getMBeanCount());
60: //}
61:
62: public final static Object invoke(
63: String inFunction, Object inParamValues[], String inParamTypes[]) {
64:
65: try {
66: Object outValue = null;
67:
68: MiscHelper.println("AbstractBaseServiceCallerBean.mbs count = "
69: + AbstractBaseServiceCallerBean.mbs.getMBeanCount());
70: MiscHelper.println("calling " + inFunction);
71: ObjectName on = new ObjectName(GOVERNOR_SERVICE_NAME);
72: outValue = AbstractBaseServiceCallerBean.mbs.invoke(
73: on, inFunction, inParamValues, inParamTypes);
74:
75: return outValue;
76: }
77: catch (MalformedObjectNameException mone) {
78: throw new UnexpectedSystemException(mone);
79: }
80: catch (InstanceNotFoundException infe) {
81: throw new UnexpectedSystemException(infe);
82: }
83: catch (MBeanException mbe) {
84: throw new UnexpectedSystemException(mbe);
85: }
86: catch (ReflectionException re) {
87: throw new UnexpectedSystemException(re);
88: }
89:
90: }
91:
92: }*/
93:
94: }
|