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/ServiceUsageMBeanProxyImpl.java


1   package com.opencloud.sleetck.lib.testutils.jmx.impl;
2   
3   import javax.management.InstanceNotFoundException;
4   import javax.management.MBeanException;
5   import javax.management.ObjectName;
6   import javax.management.ReflectionException;
7   import javax.management.RuntimeMBeanException;
8   import javax.slee.InvalidArgumentException;
9   import javax.slee.SbbID;
10  import javax.slee.ServiceID;
11  import javax.slee.UnrecognizedSbbException;
12  import javax.slee.management.ManagementException;
13  import javax.slee.management.UsageParameterSetNameAlreadyExistsException;
14  import javax.slee.usage.UnrecognizedUsageParameterSetNameException;
15  
16  import com.opencloud.sleetck.lib.TCKTestErrorException;
17  import com.opencloud.sleetck.lib.infra.jmx.NotificationBroadcasterProxyImpl;
18  import com.opencloud.sleetck.lib.testutils.jmx.MBeanFacade;
19  import com.opencloud.sleetck.lib.testutils.jmx.ServiceUsageMBeanProxy;
20  
21  /**
22   * Defines a proxy implementation for javax.slee.management.ServiceUsageMBean
23   *
24   * In addition to the Exceptions declared by each proxied method, 
25   * each proxy method can throw a TCKTestErrorException - for commication failures, 
26   * and to wrap InstanceNotFoundExceptions and ReflectionExceptions generated by the 
27   * MBeanServer.invoke() method, and unchecked Exceptions other than RuntimeExceptions. 
28   * RuntimeExceptions generated by the MBean are rethrown by the proxy.
29   * 
30   * This class was generated by the ProxyGenerator tool - Tue Jan 20 14:34:10 NZDT 2004
31   * Command line args: -n -a javax.slee.management.ServiceUsageMBean 
32   */
33  public class ServiceUsageMBeanProxyImpl extends NotificationBroadcasterProxyImpl implements ServiceUsageMBeanProxy {
34  
35     public ServiceUsageMBeanProxyImpl(ObjectName objName, MBeanFacade facade) {
36        super(objName,facade);
37        this.objName = objName;
38        this.facade = facade;
39     }
40  
41     public ObjectName getSbbUsageMBean(SbbID p0) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, ManagementException, TCKTestErrorException { 
42        try {
43           return (ObjectName)facade.invoke(objName,"getSbbUsageMBean",new Object[]{p0},new String[]{"javax.slee.SbbID"});
44        } catch(InstanceNotFoundException ie) {
45           throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
46        } catch(ReflectionException re) {
47           throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
48        } catch(MBeanException e) {
49           Exception enclosed = e.getTargetException();
50           if(enclosed instanceof UnrecognizedSbbException) throw (UnrecognizedSbbException)enclosed;
51           if(enclosed instanceof InvalidArgumentException) throw (InvalidArgumentException)enclosed;
52           if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
53           if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
54           throw new TCKTestErrorException("Caught undeclared exception",enclosed);
55        } catch(RuntimeMBeanException e) {
56           Exception enclosed = e.getTargetException();
57           if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
58           throw new TCKTestErrorException("Caught undeclared exception",enclosed);
59        }
60     }
61  
62     public void close() throws ManagementException, TCKTestErrorException { 
63        try {
64           facade.invoke(objName,"close",EmptyArrays.EMPTY_OBJECT_ARRAY,EmptyArrays.EMPTY_STRING_ARRAY);
65        } catch(InstanceNotFoundException ie) {
66           throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
67        } catch(ReflectionException re) {
68           throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
69        } catch(MBeanException e) {
70           Exception enclosed = e.getTargetException();
71           if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
72           if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
73           throw new TCKTestErrorException("Caught undeclared exception",enclosed);
74        } catch(RuntimeMBeanException e) {
75            Exception enclosed = e.getTargetException();
76            if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
77            throw new TCKTestErrorException("Caught undeclared exception",enclosed);
78         }
79     }
80  
81     public ServiceID getService() throws ManagementException, TCKTestErrorException { 
82        try {
83           return (ServiceID)facade.invoke(objName,"getService",EmptyArrays.EMPTY_OBJECT_ARRAY,EmptyArrays.EMPTY_STRING_ARRAY);
84        } catch(InstanceNotFoundException ie) {
85           throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
86        } catch(ReflectionException re) {
87           throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
88        } catch(MBeanException e) {
89           Exception enclosed = e.getTargetException();
90           if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
91           throw new TCKTestErrorException("Caught undeclared exception",enclosed);
92        } catch(RuntimeMBeanException e) {
93            Exception enclosed = e.getTargetException();
94            if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
95            throw new TCKTestErrorException("Caught undeclared exception",enclosed);
96         }
97     }
98  
99     public void removeUsageParameterSet(SbbID p0, String p1) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, UnrecognizedUsageParameterSetNameException, ManagementException, TCKTestErrorException { 
100       try {
101          facade.invoke(objName,"removeUsageParameterSet",new Object[]{p0,p1},new String[]{"javax.slee.SbbID","java.lang.String"});
102       } catch(InstanceNotFoundException ie) {
103          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
104       } catch(ReflectionException re) {
105          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
106       } catch(MBeanException e) {
107          Exception enclosed = e.getTargetException();
108          if(enclosed instanceof UnrecognizedSbbException) throw (UnrecognizedSbbException)enclosed;
109          if(enclosed instanceof InvalidArgumentException) throw (InvalidArgumentException)enclosed;
110          if(enclosed instanceof UnrecognizedUsageParameterSetNameException) throw (UnrecognizedUsageParameterSetNameException)enclosed;
111          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
112          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
113       } catch(RuntimeMBeanException e) {
114           Exception enclosed = e.getTargetException();
115           if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
116           throw new TCKTestErrorException("Caught undeclared exception",enclosed);
117        }
118    }
119 
120    public void createUsageParameterSet(SbbID p0, String p1) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, UsageParameterSetNameAlreadyExistsException, ManagementException, TCKTestErrorException { 
121       try {
122          facade.invoke(objName,"createUsageParameterSet",new Object[]{p0,p1},new String[]{"javax.slee.SbbID","java.lang.String"});
123       } catch(InstanceNotFoundException ie) {
124          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
125       } catch(ReflectionException re) {
126          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
127       } catch(MBeanException e) {
128          Exception enclosed = e.getTargetException();
129          if(enclosed instanceof UnrecognizedSbbException) throw (UnrecognizedSbbException)enclosed;
130          if(enclosed instanceof InvalidArgumentException) throw (InvalidArgumentException)enclosed;
131          if(enclosed instanceof UsageParameterSetNameAlreadyExistsException) throw (UsageParameterSetNameAlreadyExistsException)enclosed;
132          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
133          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
134       } catch(RuntimeMBeanException e) {
135           Exception enclosed = e.getTargetException();
136           if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
137           throw new TCKTestErrorException("Caught undeclared exception",enclosed);
138        }
139    }
140 
141    public ObjectName getSbbUsageMBean(SbbID p0, String p1) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, UnrecognizedUsageParameterSetNameException, ManagementException, TCKTestErrorException { 
142       try {
143          return (ObjectName)facade.invoke(objName,"getSbbUsageMBean",new Object[]{p0,p1},new String[]{"javax.slee.SbbID","java.lang.String"});
144       } catch(InstanceNotFoundException ie) {
145          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
146       } catch(ReflectionException re) {
147          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
148       } catch(MBeanException e) {
149          Exception enclosed = e.getTargetException();
150          if(enclosed instanceof UnrecognizedSbbException) throw (UnrecognizedSbbException)enclosed;
151          if(enclosed instanceof InvalidArgumentException) throw (InvalidArgumentException)enclosed;
152          if(enclosed instanceof UnrecognizedUsageParameterSetNameException) throw (UnrecognizedUsageParameterSetNameException)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 String[] getUsageParameterSets(SbbID p0) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, ManagementException, TCKTestErrorException { 
163       try {
164          return (String[])facade.invoke(objName,"getUsageParameterSets",new Object[]{p0},new String[]{"javax.slee.SbbID"});
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 UnrecognizedSbbException) throw (UnrecognizedSbbException)enclosed;
172          if(enclosed instanceof InvalidArgumentException) throw (InvalidArgumentException)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 void resetAllUsageParameters(SbbID p0) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, ManagementException, TCKTestErrorException { 
183       try {
184          facade.invoke(objName,"resetAllUsageParameters",new Object[]{p0},new String[]{"javax.slee.SbbID"});
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 UnrecognizedSbbException) throw (UnrecognizedSbbException)enclosed;
192          if(enclosed instanceof InvalidArgumentException) throw (InvalidArgumentException)enclosed;
193          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
194          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
195       } catch(RuntimeMBeanException e) {
196           Exception enclosed = e.getTargetException();
197           if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
198           throw new TCKTestErrorException("Caught undeclared exception",enclosed);
199        }
200    }
201 
202    public void resetAllUsageParameters() throws ManagementException, TCKTestErrorException { 
203       try {
204          facade.invoke(objName,"resetAllUsageParameters",EmptyArrays.EMPTY_OBJECT_ARRAY,EmptyArrays.EMPTY_STRING_ARRAY);
205       } catch(InstanceNotFoundException ie) {
206          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",ie);
207       } catch(ReflectionException re) {
208          throw new TCKTestErrorException("Caught Exception while calling MBeanServer.invoke()",re);
209       } catch(MBeanException e) {
210          Exception enclosed = e.getTargetException();
211          if(enclosed instanceof ManagementException) throw (ManagementException)enclosed;
212          throw new TCKTestErrorException("Caught undeclared exception",enclosed);
213       } catch(RuntimeMBeanException e) {
214           Exception enclosed = e.getTargetException();
215           if(enclosed instanceof RuntimeException) throw (RuntimeException)enclosed;
216           throw new TCKTestErrorException("Caught undeclared exception",enclosed);
217        }
218    }
219 
220    private ObjectName objName;
221    private MBeanFacade facade;
222 
223 }