X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.osgi%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fosgi%2FOsgiExecutionModulesManager.java;h=d46ad48c5b3b09b71247dbcea719ec1a28d2a947;hb=12af2b405bc936521813eb4840db9ccef20a2177;hp=f85df26aa1e2bce907ba94e75bd649e0323f080b;hpb=a050d4c27325c65fc04e7eed5b63b5f8ea117df0;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/OsgiExecutionModulesManager.java b/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/OsgiExecutionModulesManager.java index f85df26aa..d46ad48c5 100644 --- a/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/OsgiExecutionModulesManager.java +++ b/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/OsgiExecutionModulesManager.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2012 Mathieu Baudier + * Copyright (C) 2007-2012 Argeo GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -596,35 +596,33 @@ public class OsgiExecutionModulesManager extends } } + @SuppressWarnings("deprecation") protected ObjectName flowMBeanName(Module module, ExecutionFlow executionFlow) { String executionModulesPrefix = "SLCExecutionModules"; - // String path = executionFlow.getPath(); + String path = executionFlow.getPath(); String name = executionFlow.getName(); - // if (path == null && name.indexOf('/') >= 0) { - // path = name.substring(0, name.lastIndexOf('/')); - // name = name.substring(name.lastIndexOf('/')); - // } + if (path == null && name.indexOf('/') >= 0) { + path = name.substring(0, name.lastIndexOf('/')); + name = name.substring(name.lastIndexOf('/')); + } StringBuffer buf = new StringBuffer(executionModulesPrefix + ":" + "module=" + module.getName() + " [" + module.getVersion() + "],"); - // if (path != null && !path.equals("")) { - // int depth = 0; - // for (String token : path.split("/")) { - // if (!token.equals("")) { - // buf.append("path").append(depth).append('='); - // // in order to have directories first - // buf.append('/'); - // buf.append(token).append(','); - // depth++; - // } - // } - // } - - // FIXME deal with / - + if (path != null && !path.equals("")) { + int depth = 0; + for (String token : path.split("/")) { + if (!token.equals("")) { + buf.append("path").append(depth).append('='); + // in order to have directories first + buf.append('/'); + buf.append(token).append(','); + depth++; + } + } + } buf.append("name=").append(name); try { return new ObjectName(buf.toString());