You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2013/12/13 02:14:58 UTC

svn commit: r1550608 - in /felix/trunk/coordinator: pom.xml src/main/java/org/apache/felix/coordinator/impl/CoordinationMgr.java src/main/java/org/apache/felix/jmx/service/coordinator/CoordinatorMBean.java

Author: cziegeler
Date: Fri Dec 13 01:14:58 2013
New Revision: 1550608

URL: http://svn.apache.org/r1550608
Log:
FELIX-2647 : Implement Coordinator Service - disable jmx support for now

Modified:
    felix/trunk/coordinator/pom.xml
    felix/trunk/coordinator/src/main/java/org/apache/felix/coordinator/impl/CoordinationMgr.java
    felix/trunk/coordinator/src/main/java/org/apache/felix/jmx/service/coordinator/CoordinatorMBean.java

Modified: felix/trunk/coordinator/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/coordinator/pom.xml?rev=1550608&r1=1550607&r2=1550608&view=diff
==============================================================================
--- felix/trunk/coordinator/pom.xml (original)
+++ felix/trunk/coordinator/pom.xml Fri Dec 13 01:14:58 2013
@@ -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>

Modified: felix/trunk/coordinator/src/main/java/org/apache/felix/coordinator/impl/CoordinationMgr.java
URL: http://svn.apache.org/viewvc/felix/trunk/coordinator/src/main/java/org/apache/felix/coordinator/impl/CoordinationMgr.java?rev=1550608&r1=1550607&r2=1550608&view=diff
==============================================================================
--- felix/trunk/coordinator/src/main/java/org/apache/felix/coordinator/impl/CoordinationMgr.java (original)
+++ felix/trunk/coordinator/src/main/java/org/apache/felix/coordinator/impl/CoordinationMgr.java Fri Dec 13 01:14:58 2013
@@ -28,13 +28,9 @@ import java.util.Stack;
 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 class CoordinationMgr implements 
 
     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 @@ public class CoordinationMgr implements 
             }
         }
         return td;
+*/
     }
 
     public CompositeData getCoordination(long id) throws IOException
     {
+        return null;
+        /*
         Coordination c = getCoordinationById(id);
         if (c != null)
         {
@@ -288,6 +289,7 @@ public class CoordinationMgr implements 
             }
         }
         throw new IOException("No such Coordination " + id);
+        */
     }
 
     public boolean fail(long id, String reason)
@@ -308,11 +310,12 @@ public class CoordinationMgr implements 
             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() });
     }
+    */
 }

Modified: felix/trunk/coordinator/src/main/java/org/apache/felix/jmx/service/coordinator/CoordinatorMBean.java
URL: http://svn.apache.org/viewvc/felix/trunk/coordinator/src/main/java/org/apache/felix/jmx/service/coordinator/CoordinatorMBean.java?rev=1550608&r1=1550607&r2=1550608&view=diff
==============================================================================
--- felix/trunk/coordinator/src/main/java/org/apache/felix/jmx/service/coordinator/CoordinatorMBean.java (original)
+++ felix/trunk/coordinator/src/main/java/org/apache/felix/jmx/service/coordinator/CoordinatorMBean.java Fri Dec 13 01:14:58 2013
@@ -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 @@ package org.apache.felix.jmx.service.coo
 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 @@ public interface CoordinatorMBean
      * 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 @@ public interface CoordinatorMBean
      * 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 @@ public interface CoordinatorMBean
      * 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 @@ public interface CoordinatorMBean
 
     /**
      * 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 @@ public interface CoordinatorMBean
      * 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 @@ public interface CoordinatorMBean
 
     /**
      * 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 @@ public interface CoordinatorMBean
 
     /**
      * 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 @@ public interface CoordinatorMBean
 
     /**
      * 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