forked from apache/jackrabbit-oak
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip - refactoring to official osgi annotations
warning: the current state may still not be semantically equivalent to the state before refactoring
- Loading branch information
Showing
49 changed files
with
1,095 additions
and
1,011 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Refactoring SCR Annotations | ||
=========================== | ||
|
||
Tools | ||
----- | ||
|
||
This branch contains a bash script `compare.sh`, which allows comparing the declarative services and metatype xml files of two jar files. | ||
|
||
It takes the Oak module (e.g. oak-core) and the version (e.g. 1.8-SNAPSHOT) as arguments. Optionally also a path that points to the location of an XML file inside the bundle. | ||
|
||
./compare.sh oak-core 1.8-SNAPSHOT OSGI-INF/org.apache.jackrabbit.oak.plugins.index.datastore.DataStoreTextProviderService.xml | ||
|
||
To better undertand what the script does you can run bash in debug mode: | ||
|
||
bash -x ./compare.sh oak-core 1.8-SNAPSHOT | ||
|
||
Any output of the script is written to `./comparison/` and cleared when the script is run the next time. | ||
|
||
The baseline jar file is looked up in the local maven repository (i.e. `~/.m2/repository`). | ||
|
||
Note | ||
---- | ||
|
||
There are some differences in the XML files that do not represent a semantic difference. Therefore the diff still needs to be manually inspected. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,13 +30,6 @@ | |
import javax.annotation.Nonnull; | ||
import javax.jcr.Value; | ||
|
||
import org.apache.felix.scr.annotations.Activate; | ||
import org.apache.felix.scr.annotations.Component; | ||
import org.apache.felix.scr.annotations.Deactivate; | ||
import org.apache.felix.scr.annotations.Reference; | ||
import org.apache.felix.scr.annotations.ReferenceCardinality; | ||
import org.apache.felix.scr.annotations.ReferencePolicy; | ||
import org.apache.felix.scr.annotations.Service; | ||
import org.apache.jackrabbit.commons.SimpleValueFactory; | ||
import org.apache.jackrabbit.oak.api.Descriptors; | ||
import org.apache.jackrabbit.oak.osgi.OsgiWhiteboard; | ||
|
@@ -46,6 +39,12 @@ | |
import org.apache.jackrabbit.oak.spi.state.NodeState; | ||
import org.osgi.framework.Version; | ||
import org.osgi.service.component.ComponentContext; | ||
import org.osgi.service.component.annotations.Activate; | ||
import org.osgi.service.component.annotations.Component; | ||
import org.osgi.service.component.annotations.Deactivate; | ||
import org.osgi.service.component.annotations.Reference; | ||
import org.osgi.service.component.annotations.ReferenceCardinality; | ||
import org.osgi.service.component.annotations.ReferencePolicy; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
|
@@ -136,8 +135,10 @@ | |
* | ||
* @see #OAK_DISCOVERYLITE_CLUSTERVIEW | ||
*/ | ||
@Component(immediate = true, name = DocumentDiscoveryLiteService.COMPONENT_NAME) | ||
@Service(value = { DocumentDiscoveryLiteService.class, Observer.class }) | ||
@Component( | ||
name = DocumentDiscoveryLiteService.COMPONENT_NAME, | ||
immediate = true, | ||
service = { DocumentDiscoveryLiteService.class, Observer.class }) | ||
public class DocumentDiscoveryLiteService implements ClusterStateChangeListener, Observer { | ||
|
||
static final String COMPONENT_NAME = "org.apache.jackrabbit.oak.plugins.document.DocumentDiscoveryLiteService"; | ||
|
@@ -287,8 +288,8 @@ public Value[] getValues(String key) { | |
* Require a static reference to the NodeStore. Note that this implies the | ||
* service is only active for documentNS | ||
**/ | ||
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY, policy = ReferencePolicy.STATIC) | ||
private volatile DocumentNodeStore nodeStore; | ||
@Reference | ||
private DocumentNodeStore nodeStore; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jsedding
Author
Owner
|
||
|
||
/** | ||
* inactive nodes that have been so for a while, ie they have no backlog | ||
|
Oops, something went wrong.
Why is volatile no longer needed?