Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/opencloud/sleetck/lib/testutils/jmx/impl/DeploymentMBeanProxyImpl.java


1   package com.opencloud.sleetck.lib.testutils.jmx.impl;
2   
3   import com.opencloud.sleetck.lib.TCKTestErrorException;
4   import com.opencloud.sleetck.lib.testutils.jmx.DeploymentMBeanProxy;
5   import com.opencloud.sleetck.lib.testutils.jmx.MBeanFacade;
6   import com.opencloud.sleetck.lib.testutils.jmx.impl.EmptyArrays;
7   import java.net.MalformedURLException;
8   import javax.management.InstanceNotFoundException;
9   import javax.management.MBeanException;
10  import javax.management.ObjectName;
11  import javax.management.ReflectionException;
12  import javax.management.RuntimeMBeanException;
13  import javax.slee.ComponentID;
14  import javax.slee.EventTypeID;
15  import javax.slee.InvalidStateException;
16  import javax.slee.SbbID;
17  import javax.slee.ServiceID;
18  import javax.slee.UnrecognizedComponentException;
19  import javax.slee.management.ComponentDescriptor;
20  import javax.slee.management.DependencyException;
21  import javax.slee.management.DeployableUnitDescriptor;
22  import javax.slee.management.DeployableUnitID;
23  import javax.slee.management.DeploymentException;
24  import javax.slee.management.ManagementException;
25  import javax.slee.management.UnrecognizedDeployableUnitException;
26  import javax.slee.profile.ProfileSpecificationID;
27  import javax.slee.resource.ResourceAdaptorID;
28  import javax.slee.resource.ResourceAdaptorTypeID;
29  
30  /**
31   * Defines a proxy implementation for javax.slee.management.DeploymentMBean
32   *
33   * In addition to the Exceptions declared by each proxied method, 
34   * each proxy method can throw a TCKTestErrorException - for commication failures, 
35   * and to wrap InstanceNotFoundExceptions and ReflectionExceptions generated by the 
36   * MBeanServer.invoke() method, and unchecked Exceptions other than RuntimeExceptions. 
37   * RuntimeExceptions generated by the MBean are rethrown by the proxy.
38   * 
39   * This class was generated by the ProxyGenerator tool - Tue Jan 20 14:34:07 NZDT 2004
40   * Command line args: -a javax.slee.management.DeploymentMBean 
41   */
42  public class DeploymentMBeanProxyImpl implements DeploymentMBeanProxy {
43  
44     public DeploymentMBeanProxyImpl(ObjectName objName, MBeanFacade facade) {
45        this.objName = objName;
46        this.facade = facade;
47     }
48  
49     public DeployableUnitDescriptor getDescriptor(DeployableUnitID p0) throws NullPointerException, UnrecognizedDeployableUnitException, ManagementException, TCKTestErrorException { 
50        try {
51           return (DeployableUnitDescriptor)facade.invoke(objName,"getDescriptor",new Object[]{p0},new String[]{"javax.slee.management.DeployableUnitID"});
52        } catch(InstanceNotFoundException ie) {
53           throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
54        } catch(ReflectionException re) {
55           throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
56        } catch(MBeanException e) {
57           Exception enclosed = e.getTargetException();
58           if(enclosed instanceof UnrecognizedDeployableUnitException) throw (UnrecognizedDeployableUnitException)enclosed;
59           if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
60           throw new TCKTestErrorException("Caught undeclared exception",enclosed);
61      } catch(RuntimeMBeanException e) {
62         Exception enclosed = e.getTargetException();
63         if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
64         throw new TCKTestErrorException("Caught undeclared exception",enclosed);
65      }
66     }
67  
68     public ResourceAdaptorID[] getResourceAdaptors() throws ManagementException, TCKTestErrorException { 
69        try {
70           return (ResourceAdaptorID[])facade.invoke(objName,"getResourceAdaptors",EmptyArrays.EMPTY_OBJECT_ARRAY,EmptyArrays.EMPTY_STRING_ARRAY);
71        } catch(InstanceNotFoundException ie) {
72           throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
73        } catch(ReflectionException re) {
74           throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
75        } catch(MBeanException e) {
76           Exception enclosed = e.getTargetException();
77           if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
78           throw new TCKTestErrorException("Caught undeclared exception",enclosed);
79      } catch(RuntimeMBeanException e) {
80         Exception enclosed = e.getTargetException();
81         if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
82         throw new TCKTestErrorException("Caught undeclared exception",enclosed);
83      }
84     }
85  
86     public void uninstall(DeployableUnitID p0) throws NullPointerException, UnrecognizedDeployableUnitException, DependencyException, InvalidStateException, ManagementException, TCKTestErrorException { 
87        try {
88           facade.invoke(objName,"uninstall",new Object[]{p0},new String[]{"javax.slee.management.DeployableUnitID"});
89        } catch(InstanceNotFoundException ie) {
90           throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
91        } catch(ReflectionException re) {
92           throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
93        } catch(MBeanException e) {
94           Exception enclosed = e.getTargetException();
95           if(enclosed instanceof UnrecognizedDeployableUnitException) throw (UnrecognizedDeployableUnitException)enclosed;
96           if(enclosed instanceof DependencyException) throw (DependencyException)enclosed;
97           if(enclosed instanceof InvalidStateException) throw (InvalidStateException)enclosed;
98           if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
99           throw new TCKTestErrorException("Caught undeclared exception",enclosed);
100     } catch(RuntimeMBeanException e) {
101        Exception enclosed = e.getTargetException();
102        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
103        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
104     }
105    }
106 
107    public EventTypeID[] getEventTypes() throws ManagementException, TCKTestErrorException { 
108       try {
109          return (EventTypeID[])facade.invoke(objName,"getEventTypes",EmptyArrays.EMPTY_OBJECT_ARRAY,EmptyArrays.EMPTY_STRING_ARRAY);
110       } catch(InstanceNotFoundException ie) {
111          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
112       } catch(ReflectionException re) {
113          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
114       } catch(MBeanException e) {
115          Exception enclosed = e.getTargetException();
116          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
117          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
118     } catch(RuntimeMBeanException e) {
119        Exception enclosed = e.getTargetException();
120        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
121        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
122     }
123    }
124 
125    public ComponentDescriptor[] getDescriptors(ComponentID[] p0) throws NullPointerException, ManagementException, TCKTestErrorException { 
126       try {
127          return (ComponentDescriptor[])facade.invoke(objName,"getDescriptors",new Object[]{p0},new String[]{"[Ljavax.slee.ComponentID;"});
128       } catch(InstanceNotFoundException ie) {
129          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
130       } catch(ReflectionException re) {
131          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
132       } catch(MBeanException e) {
133          Exception enclosed = e.getTargetException();
134          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
135          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
136     } catch(RuntimeMBeanException e) {
137        Exception enclosed = e.getTargetException();
138        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
139        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
140     }
141    }
142 
143    public ComponentID[] getReferringComponents(ComponentID p0) throws NullPointerException, UnrecognizedComponentException, ManagementException, TCKTestErrorException { 
144       try {
145          return (ComponentID[])facade.invoke(objName,"getReferringComponents",new Object[]{p0},new String[]{"javax.slee.ComponentID"});
146       } catch(InstanceNotFoundException ie) {
147          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
148       } catch(ReflectionException re) {
149          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
150       } catch(MBeanException e) {
151          Exception enclosed = e.getTargetException();
152          if(enclosed instanceof UnrecognizedComponentException) throw (UnrecognizedComponentException)enclosed;
153          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
154          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
155     } catch(RuntimeMBeanException e) {
156        Exception enclosed = e.getTargetException();
157        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
158        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
159     }
160    }
161 
162    public DeployableUnitID install(String p0) throws NullPointerException, MalformedURLException, DeploymentException, ManagementException, TCKTestErrorException { 
163       try {
164          return (DeployableUnitID)facade.invoke(objName,"install",new Object[]{p0},new String[]{"java.lang.String"});
165       } catch(InstanceNotFoundException ie) {
166          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
167       } catch(ReflectionException re) {
168          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
169       } catch(MBeanException e) {
170          Exception enclosed = e.getTargetException();
171          if(enclosed instanceof MalformedURLException) throw (MalformedURLException)enclosed;
172          if(enclosed instanceof DeploymentException) throw (DeploymentException)enclosed;
173          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
174          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
175     } catch(RuntimeMBeanException e) {
176        Exception enclosed = e.getTargetException();
177        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
178        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
179     }
180    }
181 
182    public SbbID[] getSbbs() throws ManagementException, TCKTestErrorException { 
183       try {
184          return (SbbID[])facade.invoke(objName,"getSbbs",EmptyArrays.EMPTY_OBJECT_ARRAY,EmptyArrays.EMPTY_STRING_ARRAY);
185       } catch(InstanceNotFoundException ie) {
186          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
187       } catch(ReflectionException re) {
188          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
189       } catch(MBeanException e) {
190          Exception enclosed = e.getTargetException();
191          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
192          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
193     } catch(RuntimeMBeanException e) {
194        Exception enclosed = e.getTargetException();
195        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
196        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
197     }
198    }
199 
200    public DeployableUnitID[] getDeployableUnits() throws ManagementException, TCKTestErrorException { 
201       try {
202          return (DeployableUnitID[])facade.invoke(objName,"getDeployableUnits",EmptyArrays.EMPTY_OBJECT_ARRAY,EmptyArrays.EMPTY_STRING_ARRAY);
203       } catch(InstanceNotFoundException ie) {
204          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
205       } catch(ReflectionException re) {
206          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
207       } catch(MBeanException e) {
208          Exception enclosed = e.getTargetException();
209          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
210          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
211     } catch(RuntimeMBeanException e) {
212        Exception enclosed = e.getTargetException();
213        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
214        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
215     }
216    }
217 
218    public ProfileSpecificationID[] getProfileSpecifications() throws ManagementException, TCKTestErrorException { 
219       try {
220          return (ProfileSpecificationID[])facade.invoke(objName,"getProfileSpecifications",EmptyArrays.EMPTY_OBJECT_ARRAY,EmptyArrays.EMPTY_STRING_ARRAY);
221       } catch(InstanceNotFoundException ie) {
222          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
223       } catch(ReflectionException re) {
224          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
225       } catch(MBeanException e) {
226          Exception enclosed = e.getTargetException();
227          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
228          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
229     } catch(RuntimeMBeanException e) {
230        Exception enclosed = e.getTargetException();
231        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
232        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
233     }
234    }
235 
236    public ComponentDescriptor getDescriptor(ComponentID p0) throws NullPointerException, UnrecognizedComponentException, ManagementException, TCKTestErrorException { 
237       try {
238          return (ComponentDescriptor)facade.invoke(objName,"getDescriptor",new Object[]{p0},new String[]{"javax.slee.ComponentID"});
239       } catch(InstanceNotFoundException ie) {
240          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
241       } catch(ReflectionException re) {
242          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
243       } catch(MBeanException e) {
244          Exception enclosed = e.getTargetException();
245          if(enclosed instanceof UnrecognizedComponentException) throw (UnrecognizedComponentException)enclosed;
246          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
247          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
248     } catch(RuntimeMBeanException e) {
249        Exception enclosed = e.getTargetException();
250        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
251        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
252     }
253    }
254 
255    public ResourceAdaptorTypeID[] getResourceAdaptorTypes() throws ManagementException, TCKTestErrorException { 
256       try {
257          return (ResourceAdaptorTypeID[])facade.invoke(objName,"getResourceAdaptorTypes",EmptyArrays.EMPTY_OBJECT_ARRAY,EmptyArrays.EMPTY_STRING_ARRAY);
258       } catch(InstanceNotFoundException ie) {
259          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
260       } catch(ReflectionException re) {
261          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
262       } catch(MBeanException e) {
263          Exception enclosed = e.getTargetException();
264          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
265          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
266     } catch(RuntimeMBeanException e) {
267        Exception enclosed = e.getTargetException();
268        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
269        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
270     }
271    }
272 
273    public DeployableUnitID getDeployableUnit(String p0) throws NullPointerException, UnrecognizedDeployableUnitException, ManagementException, TCKTestErrorException { 
274       try {
275          return (DeployableUnitID)facade.invoke(objName,"getDeployableUnit",new Object[]{p0},new String[]{"java.lang.String"});
276       } catch(InstanceNotFoundException ie) {
277          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
278       } catch(ReflectionException re) {
279          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
280       } catch(MBeanException e) {
281          Exception enclosed = e.getTargetException();
282          if(enclosed instanceof UnrecognizedDeployableUnitException) throw (UnrecognizedDeployableUnitException)enclosed;
283          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
284          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
285     } catch(RuntimeMBeanException e) {
286        Exception enclosed = e.getTargetException();
287        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
288        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
289     }
290    }
291 
292    public ServiceID[] getServices() throws ManagementException, TCKTestErrorException { 
293       try {
294          return (ServiceID[])facade.invoke(objName,"getServices",EmptyArrays.EMPTY_OBJECT_ARRAY,EmptyArrays.EMPTY_STRING_ARRAY);
295       } catch(InstanceNotFoundException ie) {
296          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
297       } catch(ReflectionException re) {
298          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
299       } catch(MBeanException e) {
300          Exception enclosed = e.getTargetException();
301          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
302          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
303     } catch(RuntimeMBeanException e) {
304        Exception enclosed = e.getTargetException();
305        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
306        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
307     }
308    }
309 
310    public boolean isInstalled(DeployableUnitID p0) throws NullPointerException, ManagementException, TCKTestErrorException { 
311       try {
312          Boolean rValue = (Boolean)facade.invoke(objName,"isInstalled",new Object[]{p0},new String[]{"javax.slee.management.DeployableUnitID"});
313          return rValue.booleanValue();
314       } catch(InstanceNotFoundException ie) {
315          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
316       } catch(ReflectionException re) {
317          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
318       } catch(MBeanException e) {
319          Exception enclosed = e.getTargetException();
320          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
321          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
322     } catch(RuntimeMBeanException e) {
323        Exception enclosed = e.getTargetException();
324        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
325        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
326     }
327    }
328 
329    public boolean isInstalled(ComponentID p0) throws NullPointerException, ManagementException, TCKTestErrorException { 
330       try {
331          Boolean rValue = (Boolean)facade.invoke(objName,"isInstalled",new Object[]{p0},new String[]{"javax.slee.ComponentID"});
332          return rValue.booleanValue();
333       } catch(InstanceNotFoundException ie) {
334          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
335       } catch(ReflectionException re) {
336          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
337       } catch(MBeanException e) {
338          Exception enclosed = e.getTargetException();
339          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
340          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
341     } catch(RuntimeMBeanException e) {
342        Exception enclosed = e.getTargetException();
343        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
344        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
345     }
346    }
347 
348    public DeployableUnitDescriptor[] getDescriptors(DeployableUnitID[] p0) throws NullPointerException, ManagementException, TCKTestErrorException { 
349       try {
350          return (DeployableUnitDescriptor[])facade.invoke(objName,"getDescriptors",new Object[]{p0},new String[]{"[Ljavax.slee.management.DeployableUnitID;"});
351       } catch(InstanceNotFoundException ie) {
352          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
353       } catch(ReflectionException re) {
354          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
355       } catch(MBeanException e) {
356          Exception enclosed = e.getTargetException();
357          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
358          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
359     } catch(RuntimeMBeanException e) {
360        Exception enclosed = e.getTargetException();
361        if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
362        throw new TCKTestErrorException("Caught undeclared exception",enclosed);
363     }
364    }
365 
366    private ObjectName objName;
367    private MBeanFacade facade;
368 
369 }