<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">no there is not (because there was no need to expose such internal things until we work out this integration).<div><br></div><div>you should add a Filter getFilter() on the class that returns the instance.<div><br><div><div>On Apr 11, 2013, at 6:03 PM, Ken Finnigan &lt;<a href="mailto:kfinniga@redhat.com">kfinniga@redhat.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><div>That's fine, initially it didn't seem like the same listener instances would be applied to all deployments, not a problem.</div><div><br></div><div>In terms of retrieving the portlet filter instance to actually perform injection on, is there a cleaner way to get it than this:</div><div><br></div><div><p>filterClasses.add(ActionFilter.class);<br> filterClasses.add(EventFilter.class);<br> filterClasses.add(RenderFilter.class);<br> filterClasses.add(ResourceFilter.class);</p></div><div><p>ManagedPortletFilter managedPortletFilter = (ManagedPortletFilter) managedObject;<span style="font-size: 12pt;"></span></p><p><span style="font-size: 12pt;">PortletFilterImpl portletFilterImpl = (PortletFilterImpl) managedPortletFilter.getPortletFilter();</span></p><p> PortletFilter portletFilterInstance;</p><p>for (Class type : filterClasses) {<br> &nbsp;&nbsp;&nbsp;&nbsp;portletFilterInstance = (PortletFilter) portletFilterImpl.instance(type);</p><p><span style="font-size: 12pt;">&nbsp; &nbsp; // If not null, then use it and skip rest of loop</span></p><p><span style="font-size: 12pt;">}</span></p></div><div><br></div><div>Thanks</div><div>Ken</div><div><br></div><hr id="zwchr"><blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt; " data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Julien Viet" &lt;<a href="mailto:julien@julienviet.com">julien@julienviet.com</a>&gt;<br><b>To: </b>"Ken Finnigan" &lt;<a href="mailto:kfinniga@redhat.com">kfinniga@redhat.com</a>&gt;<br><b>Cc: </b><a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a><br><b>Sent: </b>Tuesday, April 9, 2013 8:12:20 PM<br><b>Subject: </b>Re: [gatein-dev] PortletApplicationDeployer listeners<br><div><br></div>Yes it is expected.<div><br></div><div>The listener may want to be aware of all deployments (for maintaining a registry of all portlets with a single listener instead of adding/removing N listeners where N is the number of deployments).<br><div><br></div><div>This is similar to the JMX JMImplementation MBean that send notifications about MBean life cycle for any MBean added/removed from the MBeanServer as the intent is originally the same.</div><div><br></div><div>What is wrong with having a single listener if you can associate the CDI meta data with the deployed portlets ?</div><div><br></div><div>I would proceed in two steps :&nbsp;</div><div><br></div><div>1/ upon deployment : prepare the CDI info for all portlets and add to a map a list of portlet id -&gt; cdi meta data for the portlet (injection etc…)</div><div>2/ upon portlet created event : lookup for cdi work to do from portlet id and if it exists then honour the cdi integration</div><div><br></div><div><br><div><br><div><div>On Apr 9, 2013, at 10:14 PM, Ken Finnigan &lt;<a href="mailto:kfinniga@redhat.com" target="_blank" data-mce-href="mailto:kfinniga@redhat.com">kfinniga@redhat.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote><div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; " data-mce-style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div>All,</div><div><br></div><div>In implementing CDI injection into GenericPortlet and PortletFilter instances, I had assumed that I could add a&nbsp;ManagedObjectRegistryEventListener, specifically for CDI processing, and add it to the broadcaster in PortletApplicationDeployer for only those PortletApplicationDeployment's that needed CDI injection. ie. the listener would be added before creating a PortletApplicationDeployment and then removed straight afterwards to ensure that portlet deployments that had nothing to do with CDI, were not calling the listener for all event notifications for no reason.</div><div><br></div><div>An unexpected consequence of this is that I've discovered the broadcaster list of listeners is the exact same instance across all PortletApplicationDeployment instances. So when I removed the CDI listener from broadcaster on PortletApplicationDeployer, it also removed that listener from the PortletApplicationDeployment that had just been created.</div><div><br></div><div>Is that expected? I'd find it unusual that its not possible to add a listener specific to a deployment that should not be applied to all of them.</div><div><br></div><div>Wondering if ManagedObjectRegistryEventBroadcaster needs to support cloning to facilitate this functionality?</div><div><br></div><div>Any other thoughts on a better way to do this are appreciated, as I certainly feel it unnecessary to defensively code my listener for all types of portlets it can be attached to when it doesn't need to.</div><div><br></div><div>Ken</div><div><span></span>========================<br>Senior Software Engineer / JBoss Enterprise Middleware Red Hat, Inc.<span></span><br></div><div><br></div></div></div>_______________________________________________<br>gatein-dev mailing list<br><a href="mailto:gatein-dev@lists.jboss.org" target="_blank" data-mce-href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/gatein-dev</blockquote></div><br></div></div></div></blockquote><div><br></div></div></blockquote></div><br></div></div></body></html>