/** * Create a ServiceDomain instance. * <p/> * Uses {@link #ROOT_DOMAIN} as the domain name. * @return The ServiceDomain instance. */ public ServiceDomain createDomain() { return createDomain(ROOT_DOMAIN, null); }
ServiceDomain domain = new ServiceDomainManager().createDomain( ServiceDomainManager.ROOT_DOMAIN, _deployment.getConfig());
/** * {@link AfterDeploymentValidation} CDI event observer. * * @param event CDI Event instance. */ public void afterDeploymentValidation(@Observes AfterDeploymentValidation event) { InputStream swConfigStream; try { swConfigStream = Classes.getResourceAsStream(AbstractDeployment.SWITCHYARD_XML, getClass()); } catch (IOException ioe) { swConfigStream = null; } if (swConfigStream != null) { try { _deployment = new Deployment(swConfigStream); } catch (java.io.IOException ioEx) { throw CDIDeployMessages.MESSAGES.failedReadingConfig(ioEx); } finally { try { swConfigStream.close(); } catch (IOException ioEx) { ioEx.getMessage(); // keeps checkstyle happy } } ServiceDomain domain = new ServiceDomainManager().createDomain(); _deployment.init(domain, ActivatorLoader.createActivators(domain)); _deployment.start(); } }
ServiceDomain domain = new ServiceDomainManager().createDomain( ServiceDomainManager.ROOT_DOMAIN, _deployment.getConfig());
/** * {@link AfterDeploymentValidation} CDI event observer. * * @param event CDI Event instance. */ public void afterDeploymentValidation(@Observes AfterDeploymentValidation event) { InputStream swConfigStream; try { swConfigStream = Classes.getResourceAsStream(AbstractDeployment.SWITCHYARD_XML, getClass()); } catch (IOException ioe) { swConfigStream = null; } if (swConfigStream != null) { try { _deployment = new Deployment(swConfigStream); } catch (java.io.IOException ioEx) { throw CDIDeployMessages.MESSAGES.failedReadingConfig(ioEx); } finally { try { swConfigStream.close(); } catch (IOException ioEx) { ioEx.getMessage(); // keeps checkstyle happy } } ServiceDomain domain = new ServiceDomainManager().createDomain(); _deployment.init(domain, ActivatorLoader.createActivators(domain)); _deployment.start(); } }
@Override public void before(AbstractDeployment deployment) { if (deployment instanceof SimpleTestDeployment) { // Not a user defined configuration based test... deploy the Services and Transformers // found by the CDI discovery process... @SuppressWarnings("unchecked") Class<? extends AbstractDeployment> simpleCdiDeploymentType = (Class<? extends AbstractDeployment>) Classes.forName("org.switchyard.component.bean.internal.SimpleCDIDeployment", getClass()); if (simpleCdiDeploymentType == null) { if (getTestKit() != null && getTestKit().getTestInstance().getClass().getPackage() == CDIMixIn.class.getPackage()) { return; // not fatal for unit tests of CDIMixIn since they can't depend on the bean component as this would create a cyclic Maven dependency. } else { Assert.fail("Failed to locate the SimpleCDIDeployment class on the classpath. Module must include the SwitchYard Bean Component as one of its depedencies."); } } try { _simpleCdiDeployment = simpleCdiDeploymentType.newInstance(); _simpleCdiDeployment.setParentDeployment(deployment); ServiceDomain domain = new ServiceDomainManager().createDomain(); _simpleCdiDeployment.init(domain, getTestKit().getActivators()); _simpleCdiDeployment.start(); } catch (Exception e) { e.printStackTrace(); Assert.fail("Failed to manually deploy Bean Service. Exception: " + e.getMessage()); } } }
@Override public void before(AbstractDeployment deployment) { if (deployment instanceof SimpleTestDeployment) { // Not a user defined configuration based test... deploy the Services and Transformers // found by the CDI discovery process... @SuppressWarnings("unchecked") Class<? extends AbstractDeployment> simpleCdiDeploymentType = (Class<? extends AbstractDeployment>) Classes.forName("org.switchyard.component.bean.internal.SimpleCDIDeployment", getClass()); if (simpleCdiDeploymentType == null) { if (getTestKit() != null && getTestKit().getTestInstance().getClass().getPackage() == CDIMixIn.class.getPackage()) { return; // not fatal for unit tests of CDIMixIn since they can't depend on the bean component as this would create a cyclic Maven dependency. } else { Assert.fail("Failed to locate the SimpleCDIDeployment class on the classpath. Module must include the SwitchYard Bean Component as one of its depedencies."); } } try { _simpleCdiDeployment = simpleCdiDeploymentType.newInstance(); _simpleCdiDeployment.setParentDeployment(deployment); ServiceDomain domain = new ServiceDomainManager().createDomain(); _simpleCdiDeployment.init(domain, getTestKit().getActivators()); _simpleCdiDeployment.start(); } catch (Exception e) { e.printStackTrace(); Assert.fail("Failed to manually deploy Bean Service. Exception: " + e.getMessage()); } } }
/** * Create a new SwitchYard runtime from the specified config. * @param config Switchyard configuration. * @throws IOException Error reading configuration. */ public SwitchYard(InputStream config) throws IOException { _deployment = new Deployment(config); _domain = new ServiceDomainManager().createDomain( _deployment.getConfig().getQName(), _deployment.getConfig()); _activatorList = ActivatorLoader.createActivators(_domain); }
setDeploymentState(SwitchYardDeploymentState.INITIALIZING); _appServiceDomain = _domainManager.createDomain(getName(_deployment.getConfig()), _deployment.getConfig());
setDeploymentState(SwitchYardDeploymentState.INITIALIZING); _appServiceDomain = _domainManager.createDomain(getName(_deployment.getConfig()), _deployment.getConfig());