summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2011-12-20 02:20:20 (EST)
committerLazar Kirchev2011-12-20 02:20:20 (EST)
commit30d646e07597c63177883772d74eb1dd6625bf46 (patch)
tree56a2e68df59635b7a1cac9f17a1aad0f99a96389
parent5df9d7bbf3dbcb3e4e89f3b1e81da58385a5d9f2 (diff)
downloadorg.eclipse.gemini.managment-30d646e07597c63177883772d74eb1dd6625bf46.zip
org.eclipse.gemini.managment-30d646e07597c63177883772d74eb1dd6625bf46.tar.gz
org.eclipse.gemini.managment-30d646e07597c63177883772d74eb1dd6625bf46.tar.bz2
bug 366235: define ObjectNameTranslator interface
-rw-r--r--org.eclipse.gemini.mgmt/src/org/eclipse/gemini/mgmt/ObjectNameTranslator.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/org.eclipse.gemini.mgmt/src/org/eclipse/gemini/mgmt/ObjectNameTranslator.java b/org.eclipse.gemini.mgmt/src/org/eclipse/gemini/mgmt/ObjectNameTranslator.java
new file mode 100644
index 0000000..b030d02
--- /dev/null
+++ b/org.eclipse.gemini.mgmt/src/org/eclipse/gemini/mgmt/ObjectNameTranslator.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2011 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.gemini.mgmt;
+
+import javax.management.ObjectName;
+
+/**
+ * {@link ObjectNameTranslator} maps JMX object names defined by Gemini Management before they are used to publish
+ * mbeans. The purpose is to allow multiple instances of Gemini Management to run in a single OSGi framework without
+ * their object names colliding.
+ * <p />
+ * For more background, see <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=366235#c1">bug 366235</a>.
+ * <p />
+ * One and only one implementation of this interface may be configured into Gemini Management by attaching a fragment to
+ * Gemini Management including the implementation class and a manifest header like this:
+ * <p />
+ * <code>GeminiManagement-ObjectNameTranslator: MyObjectNameTranslator</code>
+ * <p />
+ * The default behaviour of Gemini Management when no object name translator is configured is the same as if an object
+ * name translator was configured which translates each object name to itself.
+ * <p />
+ * <strong>Concurrent Semantics</strong><br />
+ * Implementations of this interface must be thread safe.
+ */
+public interface ObjectNameTranslator {
+
+ /**
+ * Translates the given {@link ObjectName}. The translation must be injective, which means that translations of
+ * distinct object names must be distinct.
+ *
+ * @param objectName the {@link ObjectName} to be translated
+ * @return the translated {@link ObjectName}
+ */
+ ObjectName translate(ObjectName objectName);
+
+}