@Override public String getServiceName() { return getPortlet().getPortletName(); }
private PortletContext getPortletContext() { return getPortlet().getPortletContext(); }
/** * Gets the currently used Vaadin portlet. The current portlet is * automatically defined when processing requests related to the service * (see {@link ThreadLocal}) and in {@link VaadinSession#access(Runnable)} * and {@link UI#access(Runnable)}. In other cases, (e.g. from background * threads, the current service is not automatically defined. * * The current portlet is derived from the current service using * {@link VaadinService#getCurrent()} * * @return the current vaadin portlet instance if available, otherwise * <code>null</code> * * @since 7.0 */ public static VaadinPortlet getCurrent() { VaadinService vaadinService = CurrentInstance.get(VaadinService.class); if (vaadinService instanceof VaadinPortletService) { VaadinPortletService vps = (VaadinPortletService) vaadinService; return vps.getPortlet(); } else { return null; } }
/** * Gets the request type for the request. * * @param request * the request to get a request type for * @return the request type * * @deprecated As of 7.0. Will likely change or be removed in a future * version */ @Deprecated protected RequestType getRequestType(VaadinRequest request) { RequestType type = (RequestType) request .getAttribute(RequestType.class.getName()); if (type == null) { type = getPortlet().getRequestType((VaadinPortletRequest) request); request.setAttribute(RequestType.class.getName(), type); } return type; }
/** * Returns the JSR-286 portlet configuration that provides access to the * portlet context and init parameters. * * @return portlet configuration */ public PortletConfig getPortletConfig() { VaadinPortletResponse response = (VaadinPortletResponse) CurrentInstance .get(VaadinResponse.class); return response.getService().getPortlet().getPortletConfig(); }