public static V1GetPortletDescription createGetPortletDescription(V1RegistrationContext registrationContext,
org.gatein.pc.api.PortletContext portletContext)
{
ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "portlet context");
V1PortletContext wsrpPC = createPortletContext(portletContext.getId());
if (portletContext instanceof StatefulPortletContext)
{
StatefulPortletContext context = (StatefulPortletContext)portletContext;
if (PortletStateType.OPAQUE.equals(context.getType()))
{
wsrpPC.setPortletState(((StatefulPortletContext<byte[]>)context).getState());
}
}
V1GetPortletDescription getPortletDescription = new V1GetPortletDescription();
getPortletDescription.setRegistrationContext(registrationContext);