mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 22:43:12 +00:00
[DS-247] [DS-243] [DSB-37] Allow multiple default MBeans per ServletContainer, one per webapp, with randomly generated UUID.
git-svn-id: http://scm.dspace.org/svn/repo/modules/dspace-services/trunk@4107 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
package org.dspace.kernel;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.management.InstanceNotFoundException;
|
||||
import javax.management.MBeanException;
|
||||
@@ -36,6 +37,7 @@ public class DSpaceKernelManager {
|
||||
*/
|
||||
private DSpaceKernel kernel;
|
||||
|
||||
|
||||
/**
|
||||
* A lock on the kernel to handle multiple threads getting the first item.
|
||||
*/
|
||||
@@ -87,6 +89,11 @@ public class DSpaceKernelManager {
|
||||
return kernel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static initialized random default Kernel name
|
||||
*/
|
||||
private static String defaultKernelName = UUID.randomUUID().toString();
|
||||
|
||||
/**
|
||||
* @param name the name for the kernel
|
||||
* @return a proper mbean name based on the given name
|
||||
@@ -94,7 +101,7 @@ public class DSpaceKernelManager {
|
||||
public static String checkName(String name) {
|
||||
String mbeanName = name;
|
||||
if (name == null || "".equals(name)) {
|
||||
mbeanName = DSpaceKernel.MBEAN_NAME;
|
||||
mbeanName = DSpaceKernel.MBEAN_PREFIX + defaultKernelName + DSpaceKernel.MBEAN_SUFFIX;
|
||||
} else {
|
||||
if (! name.startsWith(DSpaceKernel.MBEAN_PREFIX)) {
|
||||
mbeanName = DSpaceKernel.MBEAN_PREFIX + name + DSpaceKernel.MBEAN_SUFFIX;
|
||||
|
Reference in New Issue
Block a user