[
https://issues.apache.org/jira/browse/SLING-4235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Munteanu updated SLING-4235:
-----------------------------------
Description:
Some content which should find its way to
http://sling.apache.org/documentation/the-sling-engine/adapters.html :
# Adapters are meant primarily for request-time usage ; it's recommended , if
at all possible, to depend on OSGi services when working in other OSGi services
# If the bundle that registers an adapter factory has been wired to the bundle
consuming the adapter, it does not mean that the adapter factory is
registered(!), since the providing bundle can be in the RESOLVED state.
# If you want to be certain that a certain adapter factory is registered, you
can subscribe to OSGi events fired by the AdapterManager or ( since 2.1.4)
declare a dependency on the virtual Adaption service.
# It's not recommended to register unexported classes as adapters. They will
not be visible outside your bundle ; if you need to use such a pattern it's
much simpler to have a factory method or a constructor which handles the
'adaption'
was:
Some content which should find its way to
http://sling.apache.org/documentation/the-sling-engine/adapters.html :
1. Adapters are meant primarily for request-time usage ; it's recommended , if
at all possible, to depend on OSGi services when working in other OSGi services
2. If the bundle that registers an adapter factory has been wired to the bundle
consuming the adapter, it does not mean that the adapter factory is
registered(!), since the providing bundle can be in the RESOLVED state.
3. If you want to be certain that a certain adapter factory is registered, you
can subscribe to OSGi events fired by the AdapterManager or ( since 2.1.4)
declare a dependency on the virtual Adaption service.
Summary: Update adapters documentation with some best practices (was:
Update adaters documentation with some best practices)
> Update adapters documentation with some best practices
> ------------------------------------------------------
>
> Key: SLING-4235
> URL: https://issues.apache.org/jira/browse/SLING-4235
> Project: Sling
> Issue Type: Task
> Components: Documentation
> Reporter: Robert Munteanu
> Assignee: Robert Munteanu
>
> Some content which should find its way to
> http://sling.apache.org/documentation/the-sling-engine/adapters.html :
> # Adapters are meant primarily for request-time usage ; it's recommended , if
> at all possible, to depend on OSGi services when working in other OSGi
> services
> # If the bundle that registers an adapter factory has been wired to the
> bundle consuming the adapter, it does not mean that the adapter factory is
> registered(!), since the providing bundle can be in the RESOLVED state.
> # If you want to be certain that a certain adapter factory is registered, you
> can subscribe to OSGi events fired by the AdapterManager or ( since 2.1.4)
> declare a dependency on the virtual Adaption service.
> # It's not recommended to register unexported classes as adapters. They will
> not be visible outside your bundle ; if you need to use such a pattern it's
> much simpler to have a factory method or a constructor which handles the
> 'adaption'
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)