[
https://issues.apache.org/jira/browse/MYFACES-2986?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12965738#action_12965738
]
Jakob Korherr commented on MYFACES-2986:
----------------------------------------
The patch looks good! It is very great that we can finally get rid of
commons-discovery!
Two comments:
1) I don't really like the name "ServiceLoaderFinder". This would suggest a
class which finds "ServiceLoaders", but it actually finds ServiceProviders.
Thus I'd like to propose to change the name to "ServiceProviderFinder".
2) the patch always uses the first SPI class from the List:
if (classList != null && !classList.isEmpty())
{
return ClassUtils.newInstance(classList.get(0));
}
I think it would be better here to throw an Exception if there is more than one
fitting SPI implementation, because right now it is not really clear which one
will be used in this case ( --> does the default ServiceLoaderFinder always
return the service classes in the same order?).
WDYT?
> Provide an interface to override how to find spi interfaces
> -----------------------------------------------------------
>
> Key: MYFACES-2986
> URL: https://issues.apache.org/jira/browse/MYFACES-2986
> Project: MyFaces Core
> Issue Type: Improvement
> Components: JSR-314
> Affects Versions: 2.0.2
> Reporter: Leonardo Uribe
> Assignee: Leonardo Uribe
> Fix For: 2.0.3-SNAPSHOT
>
> Attachments: MYFACES-2986-2.patch
>
>
> This is the last step to solve MYFACES-2944 and MYFACES-2945 problem related
> to OSGi and SPI. Now it is possible to call
> ServiceLoaderFinderFactory.setServiceLoaderFinder(ExternalContext ectx,
> ServiceLoaderFinder slp)
> or
> ServiceLoaderFinderFactory.setServiceLoaderFinder(ServletContext ctx,
> ServiceLoaderFinder slp)
> Just before initialization to set a ServiceLoaderFinder that will be used
> later to locate SPI interfaces. In this way, it is possible to provide a code
> that looks SPI interfaces using OSGi bundles.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.