[PORTLETSPEC3-16] Provide a mechanism to extend annnotation processing in GenericPortlet Created: 03/May/13 Updated: 30/Aug/13
|Component/s:||Ideas for JSR 362 Extensions|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
When extending GenericPortlet, there is currently no way to extend or reuse the
One use case would be to allow support for custom portlet modes.
|Comment by Neil Griffin [ 14/May/13 ]|
I think that the simplest way to achieve this goal would be to have the private maps in GenericPortlet could be exposed with getter methods, and the getter methods could be consulted rather than accessing the private variables directly. For example:
Also, it would be good to change the scope of the GenericPortlet.cacheAnnotatedMethods() method from private to protected so that it can be overridden.
|Comment by msnicklous [ 30/Aug/13 ]|
The map methods are not synchronized, and if we make them available, portlet programmers might be tempted to change them, which might not be so good.
Instead, I propose adding the following methods to GenericPortlet:
These methods allow some flexibility, since the annotation name used does not need to be an action parameter, an event name, or a portlet mode. An arbitrary string can be used.
For example, a developer could annotate a method and access it as follows:
If this proposal is found to be good, I will update GenericPortlet to use these methods internally, test the changes, and update the spec appropriately in order to resolve this issue.