1 package org
.argeo
.slc
.osgi
;
3 import java
.lang
.management
.ManagementFactory
;
4 import java
.util
.ArrayList
;
5 import java
.util
.Dictionary
;
6 import java
.util
.Enumeration
;
7 import java
.util
.HashMap
;
8 import java
.util
.HashSet
;
9 import java
.util
.Iterator
;
10 import java
.util
.List
;
14 import javax
.management
.MBeanServer
;
15 import javax
.management
.ObjectName
;
16 import javax
.management
.StandardMBean
;
18 import org
.apache
.commons
.logging
.Log
;
19 import org
.apache
.commons
.logging
.LogFactory
;
20 import org
.argeo
.slc
.DefaultNameVersion
;
21 import org
.argeo
.slc
.NameVersion
;
22 import org
.argeo
.slc
.SlcException
;
23 import org
.argeo
.slc
.core
.execution
.DefaultExecutionFlowDescriptorConverter
;
24 import org
.argeo
.slc
.deploy
.Module
;
25 import org
.argeo
.slc
.deploy
.ModuleDescriptor
;
26 import org
.argeo
.slc
.execution
.ExecutionContext
;
27 import org
.argeo
.slc
.execution
.ExecutionFlow
;
28 import org
.argeo
.slc
.execution
.ExecutionFlowDescriptor
;
29 import org
.argeo
.slc
.execution
.ExecutionFlowDescriptorConverter
;
30 import org
.argeo
.slc
.execution
.ExecutionModuleDescriptor
;
31 import org
.argeo
.slc
.execution
.ExecutionModulesListener
;
32 import org
.argeo
.slc
.execution
.RealizedFlow
;
33 import org
.argeo
.slc
.runtime
.AbstractExecutionModulesManager
;
34 import org
.eclipse
.gemini
.blueprint
.service
.importer
.OsgiServiceLifecycleListener
;
35 import org
.osgi
.framework
.Bundle
;
36 import org
.osgi
.framework
.BundleEvent
;
37 import org
.osgi
.framework
.BundleException
;
38 import org
.osgi
.framework
.BundleListener
;
39 import org
.osgi
.framework
.Constants
;
40 import org
.osgi
.framework
.launch
.Framework
;
41 import org
.springframework
.context
.ApplicationContext
;
43 /** Execution modules manager implementation based on an OSGi runtime. */
44 public class OsgiExecutionModulesManager
extends
45 AbstractExecutionModulesManager
implements
46 OsgiServiceLifecycleListener
, BundleListener
{
48 private final static Log log
= LogFactory
49 .getLog(OsgiExecutionModulesManager
.class);
51 private BundlesManager bundlesManager
;
52 private Map
<OsgiBundle
, ExecutionContext
> executionContexts
= new HashMap
<OsgiBundle
, ExecutionContext
>();
53 private Map
<OsgiBundle
, ExecutionFlowDescriptorConverter
> executionFlowDescriptorConverters
= new HashMap
<OsgiBundle
, ExecutionFlowDescriptorConverter
>();
54 private Map
<OsgiBundle
, Set
<ExecutionFlow
>> executionFlows
= new HashMap
<OsgiBundle
, Set
<ExecutionFlow
>>();
55 private ExecutionFlowDescriptorConverter defaultDescriptorConverter
= new DefaultExecutionFlowDescriptorConverter();
57 private List
<ExecutionModulesListener
> executionModulesListeners
= new ArrayList
<ExecutionModulesListener
>();
59 private Boolean registerFlowsToJmx
= false;
61 public void init() throws Exception
{
62 bundlesManager
.getBundleContext().addBundleListener(this);
64 final String module
= System
.getProperty(UNIQUE_LAUNCH_MODULE_PROPERTY
);
65 final String flow
= System
.getProperty(UNIQUE_LAUNCH_FLOW_PROPERTY
);
67 // launch a flow and stops
68 new Thread("Unique Flow") {
71 executeFlowAndExit(module
, null, flow
);
77 public void destroy() {
78 bundlesManager
.getBundleContext().removeBundleListener(this);
81 /** Executes a single flow and <b>stops the JVM</b> */
82 protected void executeFlowAndExit(final String module
,
83 final String version
, final String flow
) {
84 if (log
.isDebugEnabled())
85 log
.debug("Launch unique flow " + flow
+ " from module " + module
);
87 OsgiBundle osgiBundle
= bundlesManager
.findFromPattern(module
);
88 if (osgiBundle
== null)
89 throw new SlcException("No OSGi bundle found for " + module
);
90 // Bundle moduleBundle =
91 // bundlesManager.findRelatedBundle(osgiBundle);
94 RealizedFlow lastLaunch
= findRealizedFlow(module
, flow
);
95 if (lastLaunch
== null)
96 throw new SlcException("Cannot find launch for " + module
+ " "
99 } catch (Exception e
) {
101 "Error in unique flow " + flow
+ " from module " + module
,
104 if (log
.isDebugEnabled())
105 log
.debug("Shutdown OSGi runtime...");
106 Framework framework
= (Framework
) bundlesManager
.getBundleContext()
109 // shutdown framework
111 // wait 1 min for shutdown
112 framework
.waitForStop(60 * 1000);
115 } catch (Exception e
) {
122 // public void startExectionModule(String moduleName, String moduleVersion)
125 // ServiceReference[] sr = bundlesManager.getServiceRefSynchronous(
126 // ApplicationContext.class.getName(),
127 // "org.springframework.context.service.name=" + moduleName);
128 // // bundlesManager.startSynchronous(moduleBundle);
129 // if (sr == null || sr.length == 0)
130 // throw new SlcException(
131 // "Cannot find execution module application context "
133 // } catch (InvalidSyntaxException e) {
134 // throw new SlcException("Cannot start exeuction module "
139 public synchronized ExecutionModuleDescriptor
getExecutionModuleDescriptor(
140 String moduleName
, String version
) {
141 ExecutionModuleDescriptor md
= new ExecutionModuleDescriptor();
142 OsgiBundle osgiBundle
= null;
143 DefaultNameVersion nameVersion
= new DefaultNameVersion(moduleName
,
145 bundles
: for (Iterator
<OsgiBundle
> iterator
= executionContexts
146 .keySet().iterator(); iterator
.hasNext();) {
147 OsgiBundle ob
= iterator
.next();
148 if (nameVersion
.getVersion() != null) {
149 if (ob
.equals(nameVersion
)) {
154 if (ob
.getName().equals(nameVersion
.getName())) {
160 if (osgiBundle
== null)
161 throw new SlcException("No execution module registered for "
163 md
.setName(osgiBundle
.getName());
164 md
.setVersion(osgiBundle
.getVersion());
165 md
.setTitle(osgiBundle
.getTitle());
166 md
.setDescription(osgiBundle
.getDescription());
168 ExecutionFlowDescriptorConverter executionFlowDescriptorConverter
= getExecutionFlowDescriptorConverter(
169 moduleName
, version
);
170 if (executionFlowDescriptorConverter
== null)
171 throw new SlcException("No flow converter found.");
172 executionFlowDescriptorConverter
.addFlowsToDescriptor(md
,
173 listFlows(moduleName
, version
));
177 public synchronized List
<ExecutionModuleDescriptor
> listExecutionModules() {
178 List
<ExecutionModuleDescriptor
> descriptors
= new ArrayList
<ExecutionModuleDescriptor
>();
180 for (Iterator
<OsgiBundle
> iterator
= executionContexts
.keySet()
181 .iterator(); iterator
.hasNext();) {
182 OsgiBundle osgiBundle
= iterator
.next();
183 ExecutionModuleDescriptor md
= new ExecutionModuleDescriptor();
184 setMetadataFromBundle(md
,
185 bundlesManager
.findRelatedBundle(osgiBundle
));
191 protected synchronized Map
<String
, ExecutionFlow
> listFlows(
192 String moduleName
, String moduleVersion
) {
194 Map
<String
, ExecutionFlow
> flows
= new HashMap
<String
, ExecutionFlow
>();
195 OsgiBundle key
= bundlesManager
.findRelatedBundle(moduleName
,
197 if (!executionFlows
.containsKey(key
))
199 Set
<ExecutionFlow
> flowsT
= executionFlows
.get(key
);
200 for (ExecutionFlow flow
: flowsT
)
201 flows
.put(flow
.getName(), flow
);
205 protected ExecutionFlow
findExecutionFlow(String moduleName
,
206 String moduleVersion
, String flowName
) {
207 String filter
= moduleVersion
== null || moduleVersion
.equals("0.0.0") ?
"(&(Bundle-SymbolicName="
209 + ")(org.eclipse.gemini.blueprint.bean.name="
211 : "(&(Bundle-SymbolicName=" + moduleName
+ ")(Bundle-Version="
213 + ")(org.eclipse.gemini.blueprint.bean.name="
215 return bundlesManager
.getSingleServiceStrict(ExecutionFlow
.class,
219 protected ExecutionContext
findExecutionContext(String moduleName
,
220 String moduleVersion
) {
221 String filter
= moduleFilter(moduleName
, moduleVersion
);
222 return bundlesManager
.getSingleServiceStrict(ExecutionContext
.class,
226 protected ExecutionFlowDescriptorConverter
findExecutionFlowDescriptorConverter(
227 String moduleName
, String moduleVersion
) {
228 String filter
= moduleFilter(moduleName
, moduleVersion
);
229 return bundlesManager
.getSingleService(
230 ExecutionFlowDescriptorConverter
.class, filter
, false);
233 /** Only based on symbolic name if version is null or "0.0.0" */
234 protected String
moduleFilter(String moduleName
, String moduleVersion
) {
235 return moduleVersion
== null || moduleVersion
.equals("0.0.0") ?
"(Bundle-SymbolicName="
237 : "(&(Bundle-SymbolicName=" + moduleName
+ ")(Bundle-Version="
238 + moduleVersion
+ "))";
243 * Builds a minimal realized flow, based on the provided information
244 * (typically from the command line).
247 * a bundle id, or a pattern contained in a bundle symbolic name
249 * the execution flow name
250 * @return a minimal realized flow, to be used in an execution
252 public RealizedFlow
findRealizedFlow(String module
, String executionName
) {
253 // First check whether we have a bundleId
254 Long bundleId
= null;
256 bundleId
= Long
.parseLong(module
);
257 } catch (NumberFormatException e
) {
261 // Look for bundle names containing pattern
262 OsgiBundle bundle
= null;
263 if (bundleId
!= null) {
264 bundle
= bundlesManager
.getBundle(bundleId
);
266 bundle
= bundlesManager
.findFromPattern(module
);
269 if (bundle
!= null) {
270 RealizedFlow launch
= new RealizedFlow();
271 launch
.setModuleName(bundle
.getName());
272 launch
.setModuleVersion(bundle
.getVersion());
273 ExecutionFlowDescriptor descriptor
= new ExecutionFlowDescriptor();
274 descriptor
.setName(executionName
);
275 launch
.setFlowDescriptor(descriptor
);
278 log
.warn("Could not find any execution module matching these requirements.");
283 public void upgrade(NameVersion nameVersion
) {
284 OsgiBundle osgiBundle
= new OsgiBundle(nameVersion
);
285 bundlesManager
.upgradeSynchronous(osgiBundle
);
288 protected synchronized ExecutionFlowDescriptorConverter
getExecutionFlowDescriptorConverter(
289 String moduleName
, String moduleVersion
) {
290 return findExecutionFlowDescriptorConverter(moduleName
, moduleVersion
);
291 // OsgiBundle osgiBundle = new OsgiBundle(moduleName, moduleVersion);
292 // return getExecutionFlowDescriptorConverter(osgiBundle);
295 protected synchronized ExecutionFlowDescriptorConverter
getExecutionFlowDescriptorConverter(
296 OsgiBundle osgiBundle
) {
297 if (executionFlowDescriptorConverters
.containsKey(osgiBundle
))
298 return executionFlowDescriptorConverters
.get(osgiBundle
);
300 return defaultDescriptorConverter
;
303 public ModuleDescriptor
getModuleDescriptor(String moduleName
,
305 return getExecutionModuleDescriptor(moduleName
, version
);
308 public List
<ModuleDescriptor
> listModules() {
309 Bundle
[] bundles
= bundlesManager
.getBundleContext().getBundles();
310 List
<ModuleDescriptor
> lst
= new ArrayList
<ModuleDescriptor
>();
311 for (Bundle bundle
: bundles
) {
312 ModuleDescriptor moduleDescriptor
= new ModuleDescriptor();
313 setMetadataFromBundle(moduleDescriptor
, bundle
);
314 lst
.add(moduleDescriptor
);
319 public void start(NameVersion nameVersion
) {
321 Bundle bundle
= bundlesManager
.findRelatedBundle(new OsgiBundle(
324 throw new SlcException("Could not find bundle for "
327 bundlesManager
.startSynchronous(bundle
);
328 if (isSpringInstrumented(bundle
)) {
329 // Wait for Spring application context to be ready
330 String filter
= "(Bundle-SymbolicName="
331 + bundle
.getSymbolicName() + ")";
333 bundlesManager
.getServiceRefSynchronous(
334 ApplicationContext
.class, filter
);
335 } catch (Exception e
) {
336 // stop if application context not found
341 } catch (Exception e
) {
342 throw new SlcException("Cannot start " + nameVersion
, e
);
346 /** Do it calmly in order to avoid NPE */
347 private Boolean
isSpringInstrumented(Bundle bundle
) {
348 Dictionary
<?
, ?
> headers
= bundle
.getHeaders();
349 if (headers
!= null && headers
.get("Spring-Context") != null)
351 Enumeration
<?
> springEntryPaths
= bundle
352 .getEntryPaths("/META-INF/spring");
353 if (springEntryPaths
!= null && springEntryPaths
.hasMoreElements())
358 public void stop(NameVersion nameVersion
) {
360 Bundle bundle
= bundlesManager
.findRelatedBundle(new OsgiBundle(
362 bundlesManager
.stopSynchronous(bundle
);
363 } catch (BundleException e
) {
364 throw new SlcException("Cannot stop " + nameVersion
, e
);
368 protected void setMetadataFromBundle(ModuleDescriptor md
, Bundle bundle
) {
371 if (md
.getName() == null || md
.getVersion() == null)
372 throw new SlcException("Name and version not available.");
374 Bundle
[] bundles
= bundlesManager
.getBundleContext().getBundles();
375 for (Bundle b
: bundles
) {
376 if (b
.getSymbolicName().equals(md
.getName())
377 && md
.getVersion().equals(
378 getHeaderSafe(b
, Constants
.BUNDLE_VERSION
))) {
387 throw new SlcException("Cannot find bundle.");
389 md
.setName(bdl
.getSymbolicName());
390 md
.setVersion(getHeaderSafe(bdl
, Constants
.BUNDLE_VERSION
));
391 md
.setTitle(getHeaderSafe(bdl
, Constants
.BUNDLE_NAME
));
392 md
.setDescription(getHeaderSafe(bdl
, Constants
.BUNDLE_DESCRIPTION
));
394 // copy manifets header to meta data
395 Dictionary
<?
, ?
> headers
= bundle
.getHeaders();
396 Enumeration
<?
> keys
= headers
.keys();
397 while (keys
.hasMoreElements()) {
398 Object key
= keys
.nextElement();
399 Object value
= headers
.get(key
);
401 md
.getMetadata().put(key
.toString(), value
.toString());
405 if (bundle
.getState() == Bundle
.ACTIVE
406 || bundle
.getState() == Bundle
.STARTING
)
409 md
.setStarted(false);
412 private String
getHeaderSafe(Bundle bundle
, Object key
) {
413 Object obj
= bundle
.getHeaders().get(key
);
417 return obj
.toString();
424 /** Registers an execution context. */
425 public synchronized void register(ExecutionContext executionContext
,
426 Map
<String
, String
> properties
) {
427 OsgiBundle osgiBundle
= asOsgiBundle(properties
);
428 Bundle bundle
= bundlesManager
.findRelatedBundle(osgiBundle
);
429 osgiBundle
.setTitle(getHeaderSafe(bundle
, Constants
.BUNDLE_NAME
));
430 osgiBundle
.setDescription(getHeaderSafe(bundle
,
431 Constants
.BUNDLE_DESCRIPTION
));
432 executionContexts
.put(osgiBundle
, executionContext
);
433 if (log
.isTraceEnabled())
434 log
.trace("Registered execution context from " + osgiBundle
);
436 ModuleDescriptor md
= osgiBundle
.getModuleDescriptor();
438 for (ExecutionModulesListener listener
: executionModulesListeners
)
439 listener
.executionModuleAdded(md
);
442 /** Unregisters an execution context. */
443 public synchronized void unregister(ExecutionContext executionContext
,
444 Map
<String
, String
> properties
) {
445 // FIXME why are properties null?
446 if (properties
== null)
448 OsgiBundle osgiBundle
= asOsgiBundle(properties
);
449 if (executionContexts
.containsKey(osgiBundle
)) {
450 executionContexts
.remove(osgiBundle
);
451 if (log
.isTraceEnabled())
452 log
.trace("Removed execution context from " + osgiBundle
);
454 ModuleDescriptor md
= osgiBundle
.getModuleDescriptor();
455 md
.setStarted(false);
456 for (ExecutionModulesListener listener
: executionModulesListeners
)
457 listener
.executionModuleRemoved(md
);
461 /** Registers an execution flow. */
462 public synchronized void register(ExecutionFlow executionFlow
,
463 Map
<String
, String
> properties
) {
464 OsgiBundle osgiBundle
= asOsgiBundle(properties
);
465 if (!executionFlows
.containsKey(osgiBundle
)) {
466 executionFlows
.put(osgiBundle
, new HashSet
<ExecutionFlow
>());
468 executionFlows
.get(osgiBundle
).add(executionFlow
);
469 if (log
.isTraceEnabled())
470 log
.trace("Registered " + executionFlow
+ " from " + osgiBundle
);
473 if (registerFlowsToJmx
)
474 registerMBean(osgiBundle
, executionFlow
);
475 ExecutionFlowDescriptorConverter efdc
= getExecutionFlowDescriptorConverter(osgiBundle
);
476 for (ExecutionModulesListener listener
: executionModulesListeners
)
477 listener
.executionFlowAdded(osgiBundle
.getModuleDescriptor(),
478 efdc
.getExecutionFlowDescriptor(executionFlow
));
481 /** Unregisters an execution flow. */
482 public synchronized void unregister(ExecutionFlow executionFlow
,
483 Map
<String
, String
> properties
) {
484 // FIXME why are properties null?
485 if (properties
== null)
487 OsgiBundle osgiBundle
= asOsgiBundle(properties
);
488 if (executionFlows
.containsKey(osgiBundle
)) {
489 Set
<ExecutionFlow
> flows
= executionFlows
.get(osgiBundle
);
490 flows
.remove(executionFlow
);
491 if (log
.isTraceEnabled())
492 log
.trace("Removed " + executionFlow
+ " from " + osgiBundle
);
493 if (flows
.size() == 0) {
494 executionFlows
.remove(osgiBundle
);
495 if (log
.isTraceEnabled())
496 log
.trace("Removed flows set from " + osgiBundle
);
500 if (registerFlowsToJmx
)
501 unregisterMBean(osgiBundle
, executionFlow
);
502 ExecutionFlowDescriptorConverter efdc
= getExecutionFlowDescriptorConverter(osgiBundle
);
503 for (ExecutionModulesListener listener
: executionModulesListeners
)
504 listener
.executionFlowRemoved(osgiBundle
.getModuleDescriptor(),
505 efdc
.getExecutionFlowDescriptor(executionFlow
));
509 /** Registers an execution module listener. */
510 public synchronized void register(
511 ExecutionModulesListener executionModulesListener
,
512 Map
<String
, String
> properties
) {
513 // sync with current state
514 for (OsgiBundle osgiBundle
: executionContexts
.keySet()) {
515 executionModulesListener
.executionModuleAdded(osgiBundle
516 .getModuleDescriptor());
518 for (OsgiBundle osgiBundle
: executionFlows
.keySet()) {
519 ExecutionFlowDescriptorConverter efdc
= getExecutionFlowDescriptorConverter(osgiBundle
);
520 for (ExecutionFlow executionFlow
: executionFlows
.get(osgiBundle
))
521 executionModulesListener
.executionFlowAdded(
522 osgiBundle
.getModuleDescriptor(),
523 efdc
.getExecutionFlowDescriptor(executionFlow
));
525 executionModulesListeners
.add(executionModulesListener
);
528 /** Unregisters an execution module listener. */
529 public synchronized void unregister(
530 ExecutionModulesListener executionModulesListener
,
531 Map
<String
, String
> properties
) {
532 executionModulesListeners
.remove(executionModulesListener
);
536 * INTERFACE IMPLEMENTATIONS
539 public void bundleChanged(BundleEvent evt
) {
540 Bundle bundle
= evt
.getBundle();
541 if (bundle
.getHeaders().get(
542 ExecutionModuleDescriptor
.SLC_EXECUTION_MODULE
) != null) {
543 OsgiBundle osgiBundle
= new OsgiBundle(bundle
);
544 if (evt
.getType() == BundleEvent
.INSTALLED
)
545 for (ExecutionModulesListener listener
: executionModulesListeners
)
546 listener
.executionModuleAdded(osgiBundle
547 .getModuleDescriptor());
548 else if (evt
.getType() == BundleEvent
.UNINSTALLED
)
549 for (ExecutionModulesListener listener
: executionModulesListeners
)
550 listener
.executionModuleRemoved(osgiBundle
551 .getModuleDescriptor());
556 @SuppressWarnings({ "rawtypes" })
557 public synchronized void bind(Object service
, Map properties
)
559 if (service
instanceof ExecutionFlowDescriptorConverter
) {
560 ExecutionFlowDescriptorConverter executionFlowDescriptorConverter
= (ExecutionFlowDescriptorConverter
) service
;
561 OsgiBundle osgiBundle
= asOsgiBundle(properties
);
562 executionFlowDescriptorConverters
.put(osgiBundle
,
563 executionFlowDescriptorConverter
);
564 if (log
.isTraceEnabled())
565 log
.debug("Registered execution flow descriptor converter from "
572 @SuppressWarnings("rawtypes")
573 public synchronized void unbind(Object service
, Map properties
)
575 if (service
instanceof ExecutionFlowDescriptorConverter
) {
576 OsgiBundle osgiBundle
= asOsgiBundle(properties
);
577 if (executionFlowDescriptorConverters
.containsKey(osgiBundle
)) {
578 executionFlowDescriptorConverters
.remove(osgiBundle
);
579 if (log
.isTraceEnabled())
580 log
.debug("Removed execution flow descriptor converter from "
591 protected MBeanServer
getMBeanServer() {
592 return ManagementFactory
.getPlatformMBeanServer();
595 public void registerMBean(Module module
, ExecutionFlow executionFlow
) {
597 StandardMBean mbean
= new StandardMBean(executionFlow
,
598 ExecutionFlow
.class);
599 getMBeanServer().registerMBean(mbean
,
600 flowMBeanName(module
, executionFlow
));
601 } catch (Exception e
) {
602 String msg
= "Cannot register execution flow " + executionFlow
604 throw new SlcException(msg
, e
);
608 public void unregisterMBean(Module module
, ExecutionFlow executionFlow
) {
610 getMBeanServer().unregisterMBean(
611 flowMBeanName(module
, executionFlow
));
612 } catch (Exception e
) {
613 String msg
= "Cannot unregister execution flow " + executionFlow
615 throw new SlcException(msg
, e
);
619 protected ObjectName
flowMBeanName(Module module
,
620 ExecutionFlow executionFlow
) {
621 String executionModulesPrefix
= "SLCExecutionModules";
622 // String path = executionFlow.getPath();
623 String name
= executionFlow
.getName();
624 // if (path == null && name.indexOf('/') >= 0) {
625 // path = name.substring(0, name.lastIndexOf('/'));
626 // name = name.substring(name.lastIndexOf('/'));
629 StringBuffer buf
= new StringBuffer(executionModulesPrefix
+ ":"
630 + "module=" + module
.getName() + " [" + module
.getVersion()
633 // if (path != null && !path.equals("")) {
635 // for (String token : path.split("/")) {
636 // if (!token.equals("")) {
637 // buf.append("path").append(depth).append('=');
638 // // in order to have directories first
640 // buf.append(token).append(',');
645 buf
.append("name=").append(name
);
647 return new ObjectName(buf
.toString());
648 } catch (Exception e
) {
649 throw new SlcException("Cannot generate object name based on "
657 @SuppressWarnings("rawtypes")
658 private OsgiBundle
asOsgiBundle(Map properties
) {
659 String bundleSymbolicName
= checkAndGet(Constants
.BUNDLE_SYMBOLICNAME
,
661 String bundleVersion
= checkAndGet(Constants
.BUNDLE_VERSION
, properties
);
662 return new OsgiBundle(bundleSymbolicName
, bundleVersion
);
665 @SuppressWarnings("rawtypes")
666 private String
checkAndGet(Object key
, Map properties
) {
667 if (!properties
.containsKey(key
) || properties
.get(key
) == null)
668 throw new SlcException(key
+ " not set in " + properties
);
670 return properties
.get(key
).toString();
673 public void setBundlesManager(BundlesManager bundlesManager
) {
674 this.bundlesManager
= bundlesManager
;
677 public void setDefaultDescriptorConverter(
678 ExecutionFlowDescriptorConverter defaultDescriptorConverter
) {
679 this.defaultDescriptorConverter
= defaultDescriptorConverter
;
682 public void setRegisterFlowsToJmx(Boolean registerFlowsToJmx
) {
683 this.registerFlowsToJmx
= registerFlowsToJmx
;