diff --git a/common/camel/src/main/java/org/switchyard/common/camel/SwitchYardCamelContext.java b/common/camel/src/main/java/org/switchyard/common/camel/SwitchYardCamelContext.java index 56df41a19..0998855d8 100644 --- a/common/camel/src/main/java/org/switchyard/common/camel/SwitchYardCamelContext.java +++ b/common/camel/src/main/java/org/switchyard/common/camel/SwitchYardCamelContext.java @@ -208,6 +208,12 @@ private void applyConfiguration() { timeout = DEFAULT_TIMEOUT; } getShutdownStrategy().setTimeout(timeout); + + if (_domain.getName() != null) { + // Need to replace colons to make a valid ObjectName + setName(_domain.getName().toString().replace(':', '-')); + } + } } diff --git a/deploy/base/src/main/java/org/switchyard/deploy/internal/AbstractDeployment.java b/deploy/base/src/main/java/org/switchyard/deploy/internal/AbstractDeployment.java index 41e9a04cb..0a7628254 100644 --- a/deploy/base/src/main/java/org/switchyard/deploy/internal/AbstractDeployment.java +++ b/deploy/base/src/main/java/org/switchyard/deploy/internal/AbstractDeployment.java @@ -117,16 +117,7 @@ public final void init(ServiceDomain appServiceDomain, List activator throw new IllegalArgumentException("null 'appServiceDomain' argument."); } - // initialize deployment name - if (getConfig() != null) { - _name = getConfig().getQName(); - if (_name == null) { - // initialize to composite name if config name is missing - if (getConfig().getComposite() != null) { - _name = getConfig().getComposite().getQName(); - } - } - } + initName(); _serviceDomain = appServiceDomain; _serviceDomain.setProperty(CLASSLOADER_PROPERTY, Classes.getTCCL()); @@ -139,6 +130,26 @@ public final void init(ServiceDomain appServiceDomain, List activator doInit(activators); } + /** + * Initialises the deployment name. + */ + public final void initName() { + if (_name != null) { + return; + } + + // initialize deployment name + if (getConfig() != null) { + _name = getConfig().getQName(); + if (_name == null) { + // initialize to composite name if config name is missing + if (getConfig().getComposite() != null) { + _name = getConfig().getComposite().getQName(); + } + } + } + } + /** * This field is not available until after the deployment has been