jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chetan Mehrotra (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-3201) Use static references in SecurityProviderImpl for composite services
Date Thu, 17 Sep 2015 06:37:46 GMT

    [ https://issues.apache.org/jira/browse/OAK-3201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14791662#comment-14791662

Chetan Mehrotra commented on OAK-3201:

Looks better!. Some more comments
* Setting immediate to true - That should not be required per se as DS can figure out that
there is a requirement of services of given type and those components would be then activated.
So some component would have dependency on SecurityProvider which in turn *expresses* its
dependency on various providers and thus DS would initialize them. So you can omit that change
* SecurityProviderRegistrationTest - Various stub class can possibly be removed with Mocks.

* Preconditions - areSatisfied - You can also use Guava Sets.difference there
* SecurityProviderRegistration
** createCompositePrincipalConfiguration, createCompositeTokenConfiguration - Given that by
the time SecurityProvider is being constructed all the dependencies are met you can just as
well populate the actual composites 
** createCompositeRestrictionProvider, createCompositeAuthorizableActionProvider - Here also
we just well initialize the composites with required instances. This would prevent unnecessary
garbage creation of a new list for every invocation
* getRequiredServicePids - It would be better to also pass a default value there and not rely
on metatype providing default values

> Use static references in SecurityProviderImpl for composite services
> --------------------------------------------------------------------
>                 Key: OAK-3201
>                 URL: https://issues.apache.org/jira/browse/OAK-3201
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>            Reporter: Francesco Mari
>            Assignee: Francesco Mari
>             Fix For: 1.3.7
>         Attachments: OAK-3201-01.patch, OAK-3201-02.patch, OAK-3201-03.patch, OAK-3201-04.patch,
OAK-3201-05.patch, OAK-3201-06.patch, OAK-3201-07.patch, OAK-3201-08.patch, mbean-test.log
> {{SecurityProviderImpl}} has dynamic references to many other services, like {{RestrictionProvider}},
that represent the configuration of this component.
> Being these services dynamic, the OSGi runtime has no clear dependency relationship between
the {{SecurityProviderImpl}} and the required services. Thus, it may happen that an instance
of {{SecurityProviderImpl}} is published before the services it requires are started, creating
a window where the {{SecurityProviderimpl}} is operating differently from the way it's configured.
> I suggest to turn the dynamic references in {{SecurityProviderImpl}} to static ones to
improve the consistency of the implementation.

This message was sent by Atlassian JIRA

View raw message