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