[ 
https://issues.apache.org/jira/browse/CMIS-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041100#comment-13041100
 ] 

Florian Müller commented on CMIS-379:
-------------------------------------

There are use cases that have to create a session from a configuration file or 
something similar. If the session parameters would rely on Java objects that 
would not be possible anymore.

Direct injection would be possible for CmisBinding but not for Session since 
the session tries to connect to the repository immediately after creation. Any 
injection would be too late. Therefore it doesn't solve the problem for most 
users.

Release 0.4.0 introduces session.getBinding().getAuthenticationProvider(). If 
additional configuration is necessary (and deferred configuration is possible), 
this provides access to the authentication provider instance.

I will look into more flexible ways to configure a session.

(Not sure what you mean by "singleton stuff". There are no singletons.)


> Allow custom AuthenticationProvider's to be registered via dependency 
> injection
> -------------------------------------------------------------------------------
>
>                 Key: CMIS-379
>                 URL: https://issues.apache.org/jira/browse/CMIS-379
>             Project: Chemistry
>          Issue Type: Wish
>          Components: opencmis-client
>    Affects Versions: OpenCMIS 0.3.0
>         Environment: n/a
>            Reporter: Peter Monks
>
> As documented at 
> http://incubator.apache.org/chemistry/opencmis-client-bindings.html, the only 
> way to configure a custom AuthenticationProvider is to specify the 
> fully-qualified classname as a String entry in the Session parameters Map.  
> This is a crude approach that (amongst other things) makes it very difficult 
> to implement a custom AuthenticationProvider that itself has one or more 
> dependencies.
> The solution is to support (but not require, obviously) the dependency 
> injection of custom AuthenticationProviders, either directly (can be injected 
> directly into the CmisBindingFactory) or indirectly (can be injected into 
> custom client code, and than passed either as a Session parameter or whatever 
> to CmisBindingFactory).
> From a brief perusal it appears there are at least two ways of achieving this:
> # allow an *instance* of an AuthenticationProvider to be provided in the 
> Session parameters Map.  Note: this would require that the type of the Map is 
> modified from Map<String, String> to Map<String, Object>, but this is 
> probably a good idea anyway as it seems unlikely that all Session parameters, 
> now and in the future, will always be Strings.
> # add a setter to the CmisBindingFactory that allows the 
> AuthenticationProvider to be configured directly.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to