Liferay 启动过程分析13(2)

然后,它对参数中的每个portlet进行迭代,找出ResourceActions进行处理:

while (itr.hasNext()) {             Portlet portlet = itr.next();              List<String> portletActions =                 ResourceActionsUtil.getPortletResourceActions(portlet);              ResourceActionLocalServiceUtil.checkResourceActions(                 portlet.getPortletId(), portletActions);              List<String> modelNames =                 ResourceActionsUtil.getPortletModelResources(                     portlet.getPortletId());              for (String modelName : modelNames) {                 List<String> modelActions =                     ResourceActionsUtil.getModelResourceActions(modelName);                  ResourceActionLocalServiceUtil.checkResourceActions(                     modelName, modelActions);             }         } 

我们逐行分析。

分析04-05行:

在第04行,它调用ResourceActionsUtil的getPortletResourceActions方法来获取和某个portlet相关联的portletActions列表:

public static List<String> getPortletResourceActions(Portlet portlet) {         return getResourceActions().getPortletResourceActions(portlet);     } 

它会去委托ResourceActionImpl的getPortletResourceActions方法:

public List<String> getPortletResourceActions(Portlet portlet) {         List<String> actions = ListUtil.copy(             getPortletResourceActions(portlet.getPortletId()));          synchronized (this) {             checkPortletActions(portlet, actions);              setActions(                 _portletResourceActions, portlet.getPortletId(), actions);         }          return actions;     } 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/4d3527bb84ad6cbd1ad54c8f7d62d40b.html