[jboss-dev-forums] [Design of JBoss Portal] - Portlet runtime meta data extension

julien@jboss.com do-not-reply at jboss.com
Wed Mar 12 07:17:39 EDT 2008


I would like to avoid to have to extend the Container*Info classes for its usage in 2.7, for several reasons:

1/ minimize the coupling (would not survive refactors)
2/ would require to introduce factories (so the builder creates the proper implementation subclass)

It will be more appropriate to use an extension mechanism based on composition by adding on CorePortletInfo a notion of attachment/payload, basically an hashmap using generics to more convenience.


  | public interface PortletInfo
  | {
  |    /**
  |     * Returns a generic attachment on the portlet info.
  |     *
  |     * @param type the parameter type
  |     * @return the attachment or null
  |     * @throws IllegalArgumentException if the parameter type is null
  |     */
  |    <T> T getAttachment(Class<T> type) throws IllegalArgumentException;
  | 
  |    ...
  | 
  | }
  | 

There is a setAttachment on the ContainerPortletInfo implementation that allows to attach payload during the phase where the deployer builds the runtime meta data from the descriptor meta data.

The deployer extension will be able to add payload for the core info extensions.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135880#4135880

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135880



More information about the jboss-dev-forums mailing list