001
014
015 package com.liferay.portal.kernel.management.jmx;
016
017 import com.liferay.portal.kernel.management.ManageActionException;
018
019 import javax.management.MBeanServer;
020 import javax.management.ObjectName;
021
022
025 public class DoOperationAction extends BaseJMXManageAction {
026
027 public DoOperationAction(
028 ObjectName objectName, String operationName, Object[] parameters,
029 String[] signature) {
030
031 _objectName = objectName;
032 _operationName = operationName;
033 _parameters = parameters;
034 _signature = signature;
035 }
036
037 public void action() throws ManageActionException {
038 try {
039 MBeanServer mBeanServer = getMBeanServer();
040
041 _result = mBeanServer.invoke(
042 _objectName, _operationName, _parameters, _signature);
043
044 }
045 catch (Exception e) {
046 throw new ManageActionException(e);
047 }
048 }
049
050 public Object getResult() {
051 return _result;
052 }
053
054 private ObjectName _objectName;
055 private String _operationName;
056 private Object[] _parameters;
057 private Object _result;
058 private String[] _signature;
059
060 }