import org.argeo.slc.execution.ExecutionModuleDescriptor;
import org.argeo.slc.execution.ExecutionModulesListener;
import org.argeo.slc.execution.RealizedFlow;
+import org.eclipse.gemini.blueprint.service.importer.OsgiServiceLifecycleListener;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleEvent;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
import org.osgi.framework.launch.Framework;
import org.springframework.context.ApplicationContext;
-import org.eclipse.gemini.blueprint.service.importer.OsgiServiceLifecycleListener;
/** Execution modules manager implementation based on an OSGi runtime. */
public class OsgiExecutionModulesManager extends
+ flowName + "))"
: "(&(Bundle-SymbolicName=" + moduleName + ")(Bundle-Version="
+ moduleVersion
- + ")(org.eclipse.gemini.blueprint.bean.name=" + flowName
- + "))";
+ + ")(org.eclipse.gemini.blueprint.bean.name="
+ + flowName + "))";
return bundlesManager.getSingleServiceStrict(ExecutionFlow.class,
filter, true);
}
+ bundle.getSymbolicName() + ")";
try {
bundlesManager.getServiceRefSynchronous(
- ApplicationContext.class.getName(), filter);
+ ApplicationContext.class, filter);
} catch (Exception e) {
// stop if application context not found
bundle.stop();
/** Unregisters an execution context. */
public synchronized void unregister(ExecutionContext executionContext,
Map<String, String> properties) {
+ // FIXME why are properties null?
+ if (properties == null)
+ return;
OsgiBundle osgiBundle = asOsgiBundle(properties);
if (executionContexts.containsKey(osgiBundle)) {
executionContexts.remove(osgiBundle);
/** Unregisters an execution flow. */
public synchronized void unregister(ExecutionFlow executionFlow,
Map<String, String> properties) {
+ // FIXME why are properties null?
+ if (properties == null)
+ return;
OsgiBundle osgiBundle = asOsgiBundle(properties);
if (executionFlows.containsKey(osgiBundle)) {
Set<ExecutionFlow> flows = executionFlows.get(osgiBundle);
}
}
- @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++;
- }
- }
- }
+ // 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());