[ 
https://issues.apache.org/jira/browse/MYFACES-2986?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12965745#action_12965745
 ] 

Leonardo Uribe commented on MYFACES-2986:
-----------------------------------------

1) Ok, use ServiceProviderFinder sounds better, so I commited the necessary 
changes.

2) Well, in theory in the classpath there will not be multiple SPI 
implementations, because the idea is each server container provide its own 
implementations (note LifecycleProvider is an exception to this rule). Pick the 
first one is the same as commons-discovery does. About the ordering problem, we 
can't do too much, because it is a problem related to SPI itself. But anyway, 
we always provide two ways to override a SPI provider. For example, if someone 
wants to override AnnotationProvider it can create a custom one under this key:

META-INF/services/org.apache.myfaces.spi.AnnotationProvider

or he/she can override the factory to define a custom ordering or something 
else:

META-INF/services/org.apache.myfaces.spi.AnnotationProviderFactory

But maybe we should log an informative message indicating there are two 
possible SPI providers, instead prevent initialize myfaces.

> 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.

Reply via email to