Using programmatic API for accessing PLM data

WebSphere Portal Server V 7.0 provides API's that you can use to access the PLM related data. I wanted to try it so i built sample portlet that will query all the portlets installed on portal server and get list of PLM related data for it. You can download it from here

In the HelloPLM portlet i am using AdminPortletModel get list of portlets on my server then i am iterating through each portlet, checking if portlet load monitoring is turned on for it (PortletLoadMetrics object is not null). If the plm is turned on for the portlet then i am reading values like if it is enabled, what is maximum allowed response time and maximum concurrent requests for the portlet

package com.wpcertification.wp70.plm;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.portlet.GenericPortlet;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;


public class HelloPLMPortlet extends GenericPortlet{

PortletLoadMetricsService portletLoadMetricService = null;
PortletModelHome portletModelHome;
public void init() throws PortletException {
try {
InitialContext context = new InitialContext();
portletLoadMetricService =
portletModelHome = (PortletModelHome)context.lookup(PortletModelHome.JNDI_NAME);
} catch (NamingException e) {

protected void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException {
System.out.println("Entering HelloPLMPortlet.doView()");

try {
List plmDtoList = new ArrayList();
AdminPortletModel adminPortletModel =
(ServletResponse) response);
PortletDefinitionList portletDefList = adminPortletModel.getPortletDefinitionList();
Iterator portletDefListIt = portletDefList.iterator();
PortletDefinition portletDefinition = (PortletDefinition);
ObjectID portletDefObjectID = portletDefinition.getObjectID();
PLMDto plmDto =getPLMDTO(portletDefObjectID);
if(plmDto.getIsEnabled() != null)
request.setAttribute("PLMDtoList", plmDtoList);
getPortletContext().getRequestDispatcher("/index.jsp").include(request, response);
} catch (ModelException e) {
System.out.println("Exiting HelloPLMPortlet.doView()");

private PLMDto getPLMDTO(ObjectID objectID ){
PLMDto plmDto = new PLMDto();
PortletLoadMetrics portletLoadMetrics =
System.out.println("Portlet Load Metrics " + portletLoadMetrics);
if(portletLoadMetrics == null)
return plmDto;
return plmDto;

When i tried accessing this portlet on my local machine i noticed that the PortletLoadMetrics object is null for all the portlets except for which i set either the max allowed response time or max no of concurrent request.

In my case only HelloPLM portlet has one of the PLM related preference so this is the output that i get


srjwebsolutions said...

We are leading responsive website designing and development company in Noida.
We are offering mobile friendly responsive website designing, website development, e-commerce website, seo service and sem services in Noida.

Responsive Website Designing Company in Noida
Website Designing Company in Noida
SEO Services in Noida
SMO Services in Noida

EG MEDI said... is online medical store pharmacy in laxmi nagar Delhi. You can Order prescription/OTC medicines online.
Cash on Delivery available. Free Home Delivery

Online Pharmacy in Delhi
Buy Online medicine in Delhi
Online Pharmacy in laxmi nagar
Buy Online medicine in laxmi nagar
Onine Medical Store in Delhi
Online Medical store in laxmi nagar
Online medicine store in delhi
online medicine store in laxmi nagar
Purchase Medicine Online
Online Pharmacy India
Online Medical Store