FELIX-2647 : Implement Coordinator Service - disable jmx support for now
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1550608 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/coordinator/pom.xml b/coordinator/pom.xml
index 2fcf1fb..8d9056a 100644
--- a/coordinator/pom.xml
+++ b/coordinator/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.felix</groupId>
<artifactId>felix-parent</artifactId>
- <version>1.2.0</version>
+ <version>2.1</version>
<relativePath>../pom/pom.xml</relativePath>
</parent>
@@ -66,7 +66,6 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>2.0.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
@@ -78,12 +77,10 @@
http://felix.apache.org/site/apache-felix-coordination-service.html
</Bundle-DocURL>
<Export-Package>
- org.apache.felix.jmx.service.coordinator;
- org.apache.felix.service.coordinator;
- version=1.0;
- mandatory:="status"; status="provisional"
+ org.osgi.service.coordinator
</Export-Package>
<Private-Package>
+ org.apache.felix.jmx.service.coordinator,
org.apache.felix.coordinator.impl.*
</Private-Package>
<Bundle-Activator>
diff --git a/coordinator/src/main/java/org/apache/felix/coordinator/impl/CoordinationMgr.java b/coordinator/src/main/java/org/apache/felix/coordinator/impl/CoordinationMgr.java
index 7de4ad5..93dd4af 100644
--- a/coordinator/src/main/java/org/apache/felix/coordinator/impl/CoordinationMgr.java
+++ b/coordinator/src/main/java/org/apache/felix/coordinator/impl/CoordinationMgr.java
@@ -28,13 +28,9 @@
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.atomic.AtomicLong;
-import java.util.regex.Pattern;
import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.OpenDataException;
import javax.management.openmbean.TabularData;
-import javax.management.openmbean.TabularDataSupport;
import org.apache.felix.jmx.service.coordinator.CoordinatorMBean;
import org.osgi.service.coordinator.Coordination;
@@ -254,6 +250,8 @@
public TabularData listCoordinations(String regexFilter)
{
+ return null;
+/*
Pattern p = Pattern.compile(regexFilter);
TabularData td = new TabularDataSupport(COORDINATIONS_TYPE);
for (CoordinationImpl c : coordinations.values())
@@ -271,10 +269,13 @@
}
}
return td;
+*/
}
public CompositeData getCoordination(long id) throws IOException
{
+ return null;
+ /*
Coordination c = getCoordinationById(id);
if (c != null)
{
@@ -288,6 +289,7 @@
}
}
throw new IOException("No such Coordination " + id);
+ */
}
public boolean fail(long id, String reason)
@@ -308,11 +310,12 @@
c.extendTimeout(timeout);
}
}
-
+/*
private CompositeData fromCoordination(final CoordinationImpl c) throws OpenDataException
{
return new CompositeDataSupport(COORDINATION_TYPE, new String[]
{ ID, NAME, TIMEOUT }, new Object[]
{ c.getId(), c.getName(), c.getDeadLine() });
}
+ */
}
diff --git a/coordinator/src/main/java/org/apache/felix/jmx/service/coordinator/CoordinatorMBean.java b/coordinator/src/main/java/org/apache/felix/jmx/service/coordinator/CoordinatorMBean.java
index 0bb069b..61e3ce4 100644
--- a/coordinator/src/main/java/org/apache/felix/jmx/service/coordinator/CoordinatorMBean.java
+++ b/coordinator/src/main/java/org/apache/felix/jmx/service/coordinator/CoordinatorMBean.java
@@ -1,12 +1,12 @@
/*
* Copyright (c) OSGi Alliance (2004, 2010). All Rights Reserved.
- *
+ *
* Licensed 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.
@@ -18,16 +18,13 @@
import java.io.IOException;
import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.SimpleType;
import javax.management.openmbean.TabularData;
-import javax.management.openmbean.TabularType;
-import org.osgi.jmx.Item;
+import org.osgi.service.coordinator.Coordination;
/**
* This MBean provides the management interface to the OSGi Coordinator Service
- *
+ *
* @ThreadSafe
* @Provisional
*/
@@ -49,7 +46,7 @@
* The item for the user name for an authorization object. The key is NAME
* and the type is SimpleType.STRING.
*/
- public static final org.osgi.jmx.Item NAME_ITEM = new Item(NAME, null, SimpleType.STRING, (String[]) null);
+// public static final org.osgi.jmx.Item NAME_ITEM = new Item(NAME, null, SimpleType.STRING, (String[]) null);
/**
* The key ID, used in ID_ITEM.
@@ -62,7 +59,7 @@
* unique Coordination (which should no be pinned in memory because of
* this).
*/
- public static final org.osgi.jmx.Item ID_ITEM = new Item(ID, null, SimpleType.LONG, (String[]) null);
+// public static final org.osgi.jmx.Item ID_ITEM = new Item(ID, null, SimpleType.LONG, (String[]) null);
/**
* The key TIMEOUT, used in TIMEOUT_ITEM.
@@ -73,7 +70,7 @@
* The item for the id of an Coordination object. The key is TIMEOUT and the
* type is SimpleType.LONG.
*/
- public static final org.osgi.jmx.Item TIMEOUT_ITEM = new Item(TIMEOUT, null, SimpleType.LONG, (String[]) null);
+// public static final org.osgi.jmx.Item TIMEOUT_ITEM = new Item(TIMEOUT, null, SimpleType.LONG, (String[]) null);
/**
* The key COORDINATION, used in COORDINATION_TYPE
@@ -82,9 +79,9 @@
/**
* Interface Coordination
- */
public static final CompositeType COORDINATION_TYPE = Item
.compositeType("", null, ID_ITEM, NAME_ITEM, TIMEOUT_ITEM);
+ */
/**
* The key COORDINATIONS, used in COORDINATIONS_TYPE
@@ -100,14 +97,14 @@
* fmeschbe note: The draft 2 spec defines this to be ArrayType but to use
* it for {@link #listCoordinations(String)} this constant must be a
* <code>TabularType</code>.
- */
public static final TabularType COORDINATIONS_TYPE = Item.tabularType(COORDINATIONS, null, COORDINATION_TYPE, ID,
NAME, TIMEOUT);
+ */
/**
* List the current coordinations. The Composite Data is typed by
* COORDINATIONS_TYPE.
- *
+ *
* @param regexFilter a regular expression filter on the coordination name
* @return the Coordinations typed by COORDINATIONS_TYPE.
* @throws IOException if the operation fails
@@ -116,7 +113,7 @@
/**
* Get a Coordination. The Composite Data is typed by COORDINATION_TYPE.
- *
+ *
* @param id The id of a Coordination
* @return the Coordinations typed by COORDINATION_TYPE.
* @throws IOException if the operation fails
@@ -125,7 +122,7 @@
/**
* Fail a Coordination.
- *
+ *
* @param id The id of the coordination to be failed.
* @param reason The reason the coordination should be failed. The
* implementation of the MBean should create a
@@ -140,7 +137,7 @@
/**
* Set/Change the timeout of a Coordination.
- *
+ *
* @param id The id of the Coordination
* @param timeout The nr of milliseconds for the next timeout.
* @throws IOException