001
014
015 package com.liferay.portal.kernel.management;
016
017 import com.liferay.portal.kernel.util.MethodHandler;
018 import com.liferay.portal.model.ClusterGroup;
019
020 import java.lang.reflect.Method;
021
022
025 public class PortalManagerUtil {
026
027 public static MethodHandler createManageActionMethodHandler(
028 ManageAction manageAction) {
029
030 return new MethodHandler(_manageMethod, manageAction);
031 }
032
033 public static void manage(
034 ClusterGroup clusterGroup, ManageAction manageAction)
035 throws ManageActionException {
036
037 ManageAction action = new ClusterManageActionWrapper(
038 clusterGroup, manageAction);
039
040 _portalManager.manage(action);
041 }
042
043 public static void manage(ManageAction manageAction)
044 throws ManageActionException {
045
046 _portalManager.manage(manageAction);
047 }
048
049 public void setPortalManager(PortalManager portalManager) {
050 _portalManager = portalManager;
051 }
052
053 private static Method _manageMethod;
054 private static PortalManager _portalManager;
055
056 static {
057 try {
058 _manageMethod = PortalManagerUtil.class.getDeclaredMethod(
059 "manage", ManageAction.class);
060 }
061 catch (Exception e) {
062 throw new ExceptionInInitializerError(e);
063 }
064 }
065
066 }