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.mgmt;
17:
18: import javax.annotation.security.RolesAllowed;
19: import javax.ejb.RemoteHome;
20: import javax.ejb.Stateless;
21: import javax.management.Attribute;
22: import javax.management.AttributeList;
23: import javax.management.AttributeNotFoundException;
24: import javax.management.InstanceNotFoundException;
25: import javax.management.InvalidAttributeValueException;
26: import javax.management.MBeanException;
27: import javax.management.ObjectName;
28: import javax.management.ReflectionException;
29:
30: import org.apache.openejb.mgmt.MEJBBean;
31:
32: /**
33: * MEJB represents the management EJB defined by JSR 77
34: * MEJBBean extends javax.ejb.Statetless and has @RemoteHome(ManagementHome.class)
35: *
36: * @version $Rev: 579616 $ $Date: 2007-09-26 04:54:00 -0700 (Wed, 26 Sep 2007) $
37: */
38:
39: @Stateless(name="ejb/mgmt/MEJB")
40: //JNDI name will be java:comp/env/ejb/mgmt/MEJB
41: @RolesAllowed({"mejbadmin","mejbuser"})
42: @RemoteHome(javax.management.j2ee.ManagementHome.class)
43: public class MEJB extends MEJBBean {
44:
45: @Override
46: @RolesAllowed("mejbadmin")
47: public void setAttribute(ObjectName objName, Attribute attrib)
48: throws InstanceNotFoundException,
49: AttributeNotFoundException, InvalidAttributeValueException,
50: MBeanException, ReflectionException {
51: super .setAttribute(objName, attrib);
52: }
53:
54: @Override
55: @RolesAllowed("mejbadmin")
56: public AttributeList setAttributes(ObjectName objName,
57: AttributeList attribList) throws InstanceNotFoundException,
58: ReflectionException {
59: return super .setAttributes(objName, attribList);
60: }
61:
62: @Override
63: @RolesAllowed("mejbadmin")
64: public Object invoke(ObjectName objName, String str,
65: Object[] objects, String[] strings)
66: throws InstanceNotFoundException, MBeanException,
67: ReflectionException {
68: return super.invoke(objName, str, objects, strings);
69: }
70: }
|