Author: cziegeler
Date: Wed Aug 18 07:12:09 2010
New Revision: 986583
URL: http://svn.apache.org/viewvc?rev=986583&view=rev
Log:
SLING-1560 : Remove statistics interface; it is not used anymore
Added:
sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/BundleStartRetriesTest.java
(contents, props changed)
- copied, changed from r986237,
sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStartRetriesTest.java
sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/WorkerThreadIdleTest.java
(contents, props changed)
- copied, changed from r986237,
sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/WorkerThreadIdleTest.java
Removed:
sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/OsgiInstallerStatistics.java
Modified:
sling/trunk/installer/jcr/jcrinstall/pom.xml
sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockOsgiInstaller.java
sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/Activator.java
sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerThread.java
sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceImpl.java
Modified: sling/trunk/installer/jcr/jcrinstall/pom.xml
URL:
http://svn.apache.org/viewvc/sling/trunk/installer/jcr/jcrinstall/pom.xml?rev=986583&r1=986582&r2=986583&view=diff
==============================================================================
--- sling/trunk/installer/jcr/jcrinstall/pom.xml (original)
+++ sling/trunk/installer/jcr/jcrinstall/pom.xml Wed Aug 18 07:12:09 2010
@@ -55,6 +55,11 @@
<extensions>true</extensions>
<configuration>
<instructions>
+ <!-- As we're using JCR 2.0 for testing we explicitly have to
+ import version 1.0 here -->
+ <Import-Package>
+ javax.jcr.*;version=1.0,*
+ </Import-Package>
<Private-Package>org.apache.sling.jcr.jcrinstall.impl.*</Private-Package>
<Sling-Nodetypes>SLING-INF/nodetypes/osgiconfig.cnd</Sling-Nodetypes>
<Sling-Namespaces>sling=http://sling.apache.org/jcr/sling/1.0</Sling-Namespaces>
@@ -91,6 +96,7 @@
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
+ <version>2.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Modified:
sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockOsgiInstaller.java
URL:
http://svn.apache.org/viewvc/sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockOsgiInstaller.java?rev=986583&r1=986582&r2=986583&view=diff
==============================================================================
---
sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockOsgiInstaller.java
(original)
+++
sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockOsgiInstaller.java
Wed Aug 18 07:12:09 2010
@@ -28,12 +28,9 @@ import java.util.Set;
import org.apache.sling.osgi.installer.InstallableResource;
import org.apache.sling.osgi.installer.OsgiInstaller;
-import org.apache.sling.osgi.installer.OsgiInstallerStatistics;
-class MockOsgiInstaller implements OsgiInstaller, OsgiInstallerStatistics {
-
- private final long [] counters = new
long[OsgiInstallerStatistics.COUNTERS_SIZE];
+class MockOsgiInstaller implements OsgiInstaller {
static class InstallableResourceComparator implements
Comparator<InstallableResource> {
public int compare(InstallableResource a, InstallableResource b) {
@@ -56,10 +53,6 @@ class MockOsgiInstaller implements OsgiI
recordCall("add", scheme, d);
}
- public long[] getCounters() {
- return counters;
- }
-
/**
* @see
org.apache.sling.osgi.installer.OsgiInstaller#registerResources(java.lang.String,
java.util.Collection)
*/
Modified:
sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/Activator.java
URL:
http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/Activator.java?rev=986583&r1=986582&r2=986583&view=diff
==============================================================================
---
sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/Activator.java
(original)
+++
sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/Activator.java
Wed Aug 18 07:12:09 2010
@@ -21,7 +21,6 @@ package org.apache.sling.osgi.installer.
import java.util.Hashtable;
import org.apache.sling.osgi.installer.OsgiInstaller;
-import org.apache.sling.osgi.installer.OsgiInstallerStatistics;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
@@ -64,8 +63,7 @@ public class Activator implements Bundle
this.osgiControllerService.setDaemon(true);
this.osgiControllerService.start();
final String [] serviceInterfaces = {
- OsgiInstaller.class.getName(),
- OsgiInstallerStatistics.class.getName()
+ OsgiInstaller.class.getName()
};
osgiControllerServiceReg = context.registerService(serviceInterfaces,
osgiControllerService, props);
}
Modified:
sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerThread.java
URL:
http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerThread.java?rev=986583&r1=986582&r2=986583&view=diff
==============================================================================
---
sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerThread.java
(original)
+++
sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerThread.java
Wed Aug 18 07:12:09 2010
@@ -32,7 +32,6 @@ import java.util.TreeSet;
import org.apache.sling.osgi.installer.InstallableResource;
import org.apache.sling.osgi.installer.OsgiInstaller;
-import org.apache.sling.osgi.installer.OsgiInstallerStatistics;
import org.apache.sling.osgi.installer.impl.config.ConfigTaskCreator;
import org.apache.sling.osgi.installer.impl.tasks.BundleTaskCreator;
import org.osgi.framework.BundleContext;
@@ -52,7 +51,7 @@ import org.osgi.framework.FrameworkListe
public class OsgiInstallerThread
extends Thread
implements BundleListener, FrameworkListener,
- OsgiInstaller, OsgiInstallerStatistics, OsgiInstallerContext {
+ OsgiInstaller, OsgiInstallerContext {
private final BundleContext ctx;
private final List<RegisteredResource> newResources = new
LinkedList<RegisteredResource>();
@@ -71,8 +70,6 @@ public class OsgiInstallerThread
private final BundleTaskCreator bundleTaskCreator;
private final ConfigTaskCreator configTaskCreator;
- private long [] counters = new long[COUNTERS_SIZE];
-
OsgiInstallerThread(final BundleContext ctx) {
this.ctx = ctx;
// listen to framework and bundle events
@@ -97,21 +94,6 @@ public class OsgiInstallerThread
}
}
- /**
- * @see
org.apache.sling.osgi.installer.OsgiInstallerStatistics#getCounters()
- */
- public long [] getCounters() {
- return counters;
- }
-
- public void incrementCounter(int index) {
- counters[index]++;
- }
-
- public void setCounter(int index, long value) {
- counters[index] = value;
- }
-
@Override
public void run() {
while (active) {
@@ -125,15 +107,12 @@ public class OsgiInstallerThread
cleanupInstallableResources();
Logger.logDebug("No tasks to process, going idle");
-
this.setCounter(OsgiInstallerStatistics.WORKER_THREAD_IS_IDLE_COUNTER, 1);
-
this.incrementCounter(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER);
synchronized (newResources) {
try {
newResources.wait();
} catch (InterruptedException ignore) {}
}
Logger.logDebug("Notified of new resources, back to work");
-
this.setCounter(OsgiInstallerStatistics.WORKER_THREAD_IS_IDLE_COUNTER, 0);
continue;
}
@@ -355,11 +334,7 @@ public class OsgiInstallerThread
t = tasks.first();
tasks.remove(t);
}
- final OsgiInstallerTask.Result result = t.execute(this);
- switch (result) {
- case SUCCESS:
this.incrementCounter(OsgiInstallerStatistics.OSGI_TASKS_COUNTER);
- break;
- }
+ t.execute(this);
counter++;
}
return counter;
@@ -395,10 +370,6 @@ public class OsgiInstallerThread
registeredResources.remove(key);
}
- this.setCounter(OsgiInstallerStatistics.REGISTERED_RESOURCES_COUNTER,
resourceCount);
- this.setCounter(OsgiInstallerStatistics.REGISTERED_GROUPS_COUNTER,
registeredResources.size());
-
this.incrementCounter(OsgiInstallerStatistics.INSTALLER_CYCLES_COUNTER);
-
// List of resources might have changed
persistentList.save();
}
Modified:
sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceImpl.java
URL:
http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceImpl.java?rev=986583&r1=986582&r2=986583&view=diff
==============================================================================
---
sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceImpl.java
(original)
+++
sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceImpl.java
Wed Aug 18 07:12:09 2010
@@ -100,7 +100,7 @@ public class RegisteredResourceImpl
}
} else if (
resourceType.equals(InstallableResource.TYPE_CONFIG)) {
this.dataFile = null;
- final ConfigurationPid pid = new ConfigurationPid(this.getURL());
+ final ConfigurationPid pid = new ConfigurationPid(scheme + ':' +
input.getId());
entity = ENTITY_CONFIG_PREFIX + pid.getCompositePid();
attributes.put(CONFIG_PID_ATTRIBUTE, pid);
} else {
Copied:
sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/BundleStartRetriesTest.java
(from r986237,
sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStartRetriesTest.java)
URL:
http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/BundleStartRetriesTest.java?p2=sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/BundleStartRetriesTest.java&p1=sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStartRetriesTest.java&r1=986237&r2=986583&rev=986583&view=diff
==============================================================================
---
sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStartRetriesTest.java
(original)
+++
sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/BundleStartRetriesTest.java
Wed Aug 18 07:12:09 2010
@@ -1,20 +1,27 @@
-package org.apache.sling.osgi.installer.it;
+/*
+ * 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.
+ */
+package org.apache.sling.osgi.installer.impl;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import org.apache.sling.osgi.installer.OsgiInstallerStatistics;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.Bundle;
/** Test the bundle start retries logic of SLING-1042 */
-...@runwith(JUnit4TestRunner.class)
-public class BundleStartRetriesTest extends OsgiInstallerTestBase {
+public abstract class BundleStartRetriesTest {
+ /*
@org.ops4j.pax.exam.junit.Configuration
public static Option[] configuration() {
return defaultConfiguration();
@@ -59,5 +66,5 @@ public class BundleStartRetriesTest exte
waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER,
1);
waitForInstallerAction(OsgiInstallerStatistics.OSGI_TASKS_COUNTER, 1);
}
-
+*/
}
Propchange:
sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/BundleStartRetriesTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/BundleStartRetriesTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision Rev URL
Copied:
sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/WorkerThreadIdleTest.java
(from r986237,
sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/WorkerThreadIdleTest.java)
URL:
http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/WorkerThreadIdleTest.java?p2=sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/WorkerThreadIdleTest.java&p1=sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/WorkerThreadIdleTest.java&r1=986237&r2=986583&rev=986583&view=diff
==============================================================================
---
sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/WorkerThreadIdleTest.java
(original)
+++
sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/WorkerThreadIdleTest.java
Wed Aug 18 07:12:09 2010
@@ -1,35 +1,26 @@
/*
- * 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
+ * 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
+ * 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.
+ * 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.
*/
-package org.apache.sling.osgi.installer.it;
+package org.apache.sling.osgi.installer.impl;
-import static org.junit.Assert.assertNull;
-
-import org.apache.sling.osgi.installer.OsgiInstallerStatistics;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.Bundle;
-
-...@runwith(JUnit4TestRunner.class)
-public class WorkerThreadIdleTest extends OsgiInstallerTestBase {
+public abstract class WorkerThreadIdleTest {
+/*
@org.ops4j.pax.exam.junit.Configuration
public static Option[] configuration() {
return defaultConfiguration();
@@ -60,5 +51,5 @@ public class WorkerThreadIdleTest extend
waitForInstallerAction("Worker thread should become idle after
installing bundle",
OsgiInstallerStatistics.WORKER_THREAD_IS_IDLE_COUNTER, -1);
- }
+ }*/
}
\ No newline at end of file
Propchange:
sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/WorkerThreadIdleTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/WorkerThreadIdleTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision Rev URL