[ 
https://issues.apache.org/jira/browse/PLUTO-702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Neil Griffin updated PLUTO-702:
-------------------------------
    Description: 
Initial commits of the PortletHubDemo indicate that it was developed when 
Pluto's scanning for Portlet 3.0 annotations such as {{@PortletConfiguration}} 
relied on CDI. Since then, Pluto was refactored so that it did not rely on CDI.

Because of this, the src/main/webapp/WEB-INF/beans.xml descriptor should not be 
included in the Pluto deployment.

  was:
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 extend {{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.


> Remove beans.xml from PortletHubDemo since it doesn't require CDI
> -----------------------------------------------------------------
>
>                 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
>
>
> Initial commits of the PortletHubDemo indicate that it was developed when 
> Pluto's scanning for Portlet 3.0 annotations such as 
> {{@PortletConfiguration}} relied on CDI. Since then, Pluto was refactored so 
> that it did not rely on CDI.
> Because of this, the src/main/webapp/WEB-INF/beans.xml descriptor should not 
> be included in the Pluto deployment.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to