Move to official OSGi annotations for package exports
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1784522 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 22de44c..a3ebbfe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -58,12 +58,6 @@
<extensions>true</extensions>
<configuration>
<instructions>
- <Export-Package>
- org.apache.sling.servlets.post;version=2.3.0
- </Export-Package>
- <Private-Package>
- org.apache.sling.servlets.post.impl.*
- </Private-Package>
<Sling-Bundle-Resources>
/system/sling.js
</Sling-Bundle-Resources>
@@ -74,7 +68,7 @@
sling=http://sling.apache.org/jcr/sling/1.0
</Sling-Namespaces>
<Sling-Nodetypes>
- SLING-INF/nodetypes/chunk.cnd,
+ SLING-INF/nodetypes/chunk.cnd
</Sling-Nodetypes>
</instructions>
</configuration>
@@ -168,11 +162,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.scr.annotations</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.testing</artifactId>
<version>2.0.10</version>
diff --git a/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java b/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
index ea18391..012d1ae 100644
--- a/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
+++ b/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
@@ -75,7 +75,6 @@
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -324,7 +323,7 @@
log.warn("given redirect target ({}) is not a valid uri: {}", result, e);
return null;
}
-
+
log.debug("redirect requested as [{}] for path [{}]", result, ctx.getPath());
// redirect to created/modified Resource
@@ -398,14 +397,13 @@
// ---------- SCR Integration ----------------------------------------------
@Activate
- protected void activate(final ComponentContext context,
+ protected void activate(final BundleContext bundleContext,
final Map<String, Object> configuration) {
// configure now
this.configure(configuration);
// other predefined operations
final ArrayList<ServiceRegistration> providedServices = new ArrayList<ServiceRegistration>();
- final BundleContext bundleContext = context.getBundleContext();
providedServices.add(registerOperation(bundleContext,
SlingPostConstants.OPERATION_MODIFY, modifyOperation));
providedServices.add(registerOperation(bundleContext,
diff --git a/src/main/java/org/apache/sling/servlets/post/impl/helper/ChunkCleanUpTask.java b/src/main/java/org/apache/sling/servlets/post/impl/helper/ChunkCleanUpTask.java
index a81b582..7eacc0d 100644
--- a/src/main/java/org/apache/sling/servlets/post/impl/helper/ChunkCleanUpTask.java
+++ b/src/main/java/org/apache/sling/servlets/post/impl/helper/ChunkCleanUpTask.java
@@ -36,7 +36,6 @@
import org.apache.sling.commons.osgi.OsgiUtil;
import org.apache.sling.jcr.api.SlingRepository;
import org.apache.sling.servlets.post.SlingPostConstants;
-import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -68,7 +67,7 @@
+ "of the format for this value."),
@Property(name = "service.description", value = "Periodic Chunk Cleanup Job", propertyPrivate = true),
@Property(name = "service.vendor", value = "The Apache Software Foundation", propertyPrivate = true),
- @Property(name = "scheduler.concurrent", label = "scheduler.concurrent", boolValue = false,
+ @Property(name = "scheduler.concurrent", label = "scheduler.concurrent", boolValue = false,
description = "Allow Chunk Cleanup Task to run concurrently (default: false).")})
public class ChunkCleanUpTask implements Runnable {
@@ -91,6 +90,7 @@
/**
* Executes the job. Is called for each triggered schedule point.
*/
+ @Override
public void run() {
log.debug("ChunkCleanUpTask: Starting cleanup");
cleanup();
@@ -175,8 +175,7 @@
}
@Activate
- protected void activate(final ComponentContext context,
- final Map<String, Object> configuration) {
+ protected void activate(final Map<String, Object> configuration) {
chunkCleanUpAge = OsgiUtil.toInteger(
configuration.get(CHUNK_CLEANUP_AGE), 1) * 60 * 1000;
log.info("scheduler config [{}], chunkGarbageTime [{}] ms",
diff --git a/src/main/java/org/apache/sling/servlets/post/package-info.java b/src/main/java/org/apache/sling/servlets/post/package-info.java
new file mode 100644
index 0000000..dd0a92f
--- /dev/null
+++ b/src/main/java/org/apache/sling/servlets/post/package-info.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+@Version("2.3.0")
+package org.apache.sling.servlets.post;
+
+import org.osgi.annotation.versioning.Version;
+