You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by "Neil Griffin (JIRA)" <ji...@apache.org> on 2018/04/19 00:05:00 UTC
[jira] [Closed] (PLUTO-702) Portlet classes in PortletHubDemo are
not annotated with @ApplicationScoped
[ https://issues.apache.org/jira/browse/PLUTO-702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Neil Griffin closed PLUTO-702.
------------------------------
Resolution: Fixed
Fixed in commit [47ae53c51e9625dac38204cb0efe75d9e385b1ae|https://github.com/apache/portals-pluto/commit/47ae53c51e9625dac38204cb0efe75d9e385b1ae]
> Portlet classes in PortletHubDemo are not annotated with @ApplicationScoped
> ---------------------------------------------------------------------------
>
> Key: PLUTO-702
> URL: https://issues.apache.org/jira/browse/PLUTO-702
> Project: Pluto
> Issue Type: Bug
> Components: demo portlets
> Affects Versions: 3.0.0
> Reporter: Neil Griffin
> Assignee: Neil Griffin
> Priority: Major
> Fix For: 3.0.1
>
>
> Section 20.1 of the Portlet 3.0 Specification states:
> {quote}
> When the portlet container uses the CDI container to instantiate the portlets, it must respect
> any scope annotations on the portlet beans. Generally, portlets should be @ApplicationScoped in order to avoid unnecessary object creation and destruction.
> It should be noted that regardless of the bean scope, the Portlet interface init(PortletConfig) method will only be called a single time when the portlet is taken into service. If the portlet bean scope is other than @ApplicationScoped or @Dependent, this can potentially lead to unintended effects. Portlets that do not directly or indirectly implement the Portlet interface can use the CDI @PostConstruct and @PreDestroy annotations to properly handle bean initialization and tear down. A PortletConfig object can be injected as necessary.{quote}
> Since all of the portlet classes annotated with {{@PortletConfiguration}} in the PortletHubDemo extends {{GenericPortlet}}, they indirectly implement the {{Portlet}} interface. This means that the "unintended effects" can happen in various portlet containers.
> Because of this, it is necessary to annotated each of these classes with the {{@ApplicationScoped}} annotation.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)