Index: oak-core/src/main/java/org/apache/jackrabbit/oak/util/AbstractCheckpointMBean.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/util/AbstractCheckpointMBean.java (revision 1718560) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/util/AbstractCheckpointMBean.java (working copy) @@ -34,7 +34,6 @@ import javax.management.openmbean.TabularType; import org.apache.jackrabbit.oak.api.jmx.CheckpointMBean; -import org.apache.jackrabbit.oak.plugins.segment.SegmentCheckpointMBean; /** * Abstract base class for {@code CheckpointMBean} implementations. @@ -49,8 +48,6 @@ private static final OpenType[] FIELD_TYPES = new OpenType[] { STRING, STRING, STRING, createStringArrayType()}; - private static final CompositeType TYPE = createCompositeType(); - private static ArrayType createStringArrayType() { try { return new ArrayType(STRING, false); @@ -59,10 +56,9 @@ } } - private static CompositeType createCompositeType() { + private CompositeType createCompositeType() { try { - return new CompositeType(SegmentCheckpointMBean.class.getName(), - "Checkpoints", FIELD_NAMES, FIELD_DESCRIPTIONS, FIELD_TYPES); + return new CompositeType(getTypeName(), "Checkpoints", FIELD_NAMES, FIELD_DESCRIPTIONS, FIELD_TYPES); } catch (OpenDataException e) { throw new IllegalStateException(e); } @@ -84,8 +80,8 @@ public TabularData listCheckpoints() { try { TabularDataSupport tab = new TabularDataSupport( - new TabularType(SegmentCheckpointMBean.class.getName(), - "Checkpoints", TYPE, new String[] { "id" })); + new TabularType(getTypeName(), + "Checkpoints", createCompositeType(), new String[] { "id" })); collectCheckpoints(tab); return tab; @@ -95,20 +91,20 @@ } /** - * Utility method for converting the fields associated with a checkpoint to the - * composite data format. + * Utility method for converting the fields associated with a checkpoint to + * the composite data format. * - * @param id id of the checkpoint - * @param created creation data of the checkpoint - * @param expires expiry data of the checkpoint - * @return composite data representation of the fields associated with the - * checkpoint + * @param id id of the checkpoint + * @param created creation data of the checkpoint + * @param expires expiry data of the checkpoint + * @return composite data representation of the fields associated with the + * checkpoint * @throws OpenDataException */ - protected static CompositeDataSupport toCompositeData(String id, String created, String expires, - Map properties) throws OpenDataException { - return new CompositeDataSupport(TYPE, FIELD_NAMES, new Object[] { - id, created, expires, toArray(properties) }); + protected final CompositeDataSupport toCompositeData(String id, String created, String expires, + Map properties) throws OpenDataException { + return new CompositeDataSupport(createCompositeType(), FIELD_NAMES, new Object[] { + id, created, expires, toArray(properties) }); } private static String[] toArray(Map properties) { @@ -120,4 +116,8 @@ return value; } + private String getTypeName() { + return getClass().getName(); + } + } Index: oak-core/src/main/java/org/apache/jackrabbit/oak/util/package-info.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/util/package-info.java (revision 1718560) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/util/package-info.java (working copy) @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@Version("1.3.1") +@Version("2.0.0") @Export(optional = "provide:=true") package org.apache.jackrabbit.oak.util;