public DeploymentPlan findDefaultPlan(QName deployable) { // default to first found deployment plan in a contribution if one is not specifed for a distributed deployment QNameSymbol symbol = new QNameSymbol(deployable); Contribution contribution = metadataStore.find(Composite.class, symbol).getResource().getContribution(); return findDefaultPlan(contribution); }
public void undeploy(QName name) throws Fabric3Exception { QNameSymbol symbol = new QNameSymbol(name); ResourceElement<QNameSymbol, Composite> element = metaDataStore.find(Composite.class, symbol); if (element == null) { throw new Fabric3Exception("Component not deployed: " + name); } Composite composite = element.getValue(); domain.undeploy(composite); Resource resource = element.getResource(); Contribution contribution = resource.getContribution(); contribution.getResources().remove(resource); }
public void undeploy(QName name) throws Fabric3Exception { QNameSymbol symbol = new QNameSymbol(name); ResourceElement<QNameSymbol, Composite> element = metaDataStore.find(Composite.class, symbol); if (element == null) { throw new Fabric3Exception("Component not deployed: " + name); } Composite composite = element.getValue(); domain.undeploy(composite); Resource resource = element.getResource(); Contribution contribution = resource.getContribution(); contribution.getResources().remove(resource); }
return artifacts; Resource resource = resourceElement.getResource(); InputStream stream = null; try {
public void undeploy(QName name) throws DeploymentException { try { QNameSymbol symbol = new QNameSymbol(name); ResourceElement<QNameSymbol, Composite> element = metaDataStore.find(Composite.class, symbol); if (element == null) { throw new DeploymentException("Component not deployed: " + name); } Composite composite = element.getValue(); domain.undeploy(composite, false); Resource resource = element.getResource(); Contribution contribution = resource.getContribution(); contribution.getResources().remove(resource); } catch (org.fabric3.api.host.domain.DeploymentException e) { throw new DeploymentException(e); } }
+ ". The domain journal (domain.xml) may be out of sync."); Contribution contribution = element.getResource().getContribution(); if (contribution == null) {
public Definition resolveWsdlByPortName(URI contributionUri, QName portName) throws WsdlResolutionException { PortSymbol symbol = new PortSymbol(portName); ResourceElement<PortSymbol, Port> resourceElement; try { resourceElement = store.find(contributionUri, Port.class, symbol); } catch (StoreException e) { throw new WsdlResolutionException("Error resolving port: " + portName, e); } if (resourceElement == null) { throw new WsdlResolutionException("WSDL port not found: " + portName); } Resource resource = resourceElement.getResource(); for (ResourceElement<?, ?> element : resource.getResourceElements()) { if (element.getSymbol() instanceof WsdlSymbol) { return (Definition) element.getValue(); } } throw new WsdlResolutionException("WSDL for port not found: " + portName); }
public Definition resolveWsdlByServiceName(URI contributionUri, QName serviceName) throws WsdlResolutionException { ServiceSymbol symbol = new ServiceSymbol(serviceName); ResourceElement<ServiceSymbol, Service> resourceElement; try { resourceElement = store.find(contributionUri, Service.class, symbol); } catch (StoreException e) { throw new WsdlResolutionException("Error resolving service: " + serviceName, e); } if (resourceElement == null) { throw new WsdlResolutionException("WSDL service not found: " + serviceName); } Resource resource = resourceElement.getResource(); for (ResourceElement<?, ?> element : resource.getResourceElements()) { if (element.getSymbol() instanceof WsdlSymbol) { return (Definition) element.getValue(); } } throw new WsdlResolutionException("WSDL for service not found: " + serviceName); }
public Definition resolveWsdlByBindingName(URI contributionUri, QName bindingName) throws WsdlResolutionException { BindingSymbol symbol = new BindingSymbol(bindingName); ResourceElement<BindingSymbol, Binding> resourceElement; try { resourceElement = store.find(contributionUri, Binding.class, symbol); } catch (StoreException e) { throw new WsdlResolutionException("Error resolving binding: " + bindingName, e); } if (resourceElement == null) { throw new WsdlResolutionException("WSDL binding not found: " + bindingName); } Resource resource = resourceElement.getResource(); for (ResourceElement<?, ?> element : resource.getResourceElements()) { if (element.getSymbol() instanceof WsdlSymbol) { return (Definition) element.getValue(); } } throw new WsdlResolutionException("WSDL for binding not found: " + bindingName); } }
public Resource introspect(Class<?> clazz, Contribution contribution, IntrospectionContext context) { ResourceElement<WebComponentTypeSymbol, WebComponentType> element = getTypeElement(contribution); WebComponentType componentType = element.getValue(); // introspect the class and generate a component type that will be merged into the web component type WebArtifactImplementation artifactImpl = new WebArtifactImplementation(); InjectingComponentType tempType = new InjectingComponentType(clazz); artifactImpl.setComponentType(tempType); TypeMapping mapping = context.getTypeMapping(clazz); if (mapping == null) { mapping = new TypeMapping(); context.addTypeMapping(clazz, mapping); helper.resolveTypeParameters(clazz, mapping); } classVisitor.visit(tempType, clazz, context); mergeComponentTypes(componentType, tempType, context); return element.getResource(); }
/** * Instantiates and deploys the given composite. * * @param composite the composite to instantiate and deploy * @throws Fabric3Exception if a deployment error occurs */ private void instantiateAndDeploy(Composite composite) throws Fabric3Exception { LogicalCompositeComponent domain = logicalComponentManager.getDomainComposite(); QName name = composite.getName(); QNameSymbol symbol = new QNameSymbol(name); ResourceElement<QNameSymbol, Composite> element = metadataStore.find(Composite.class, symbol); if (element == null) { throw new Fabric3Exception("Composite not found in metadata store: " + name); } Contribution contribution = element.getResource().getContribution(); if (ContributionState.STORED == contribution.getState()) { throw new Fabric3Exception("Contribution is not installed: " + contribution.getUri()); } InstantiationContext context = logicalModelInstantiator.include(composite, domain); if (context.hasErrors()) { throw new AssemblyException(context.getErrors()); } deploy(domain); contribution.deploy(); }
/** * Instantiates and deploys the given composite. * * @param composite the composite to instantiate and deploy * @throws Fabric3Exception if a deployment error occurs */ private void instantiateAndDeploy(Composite composite) throws Fabric3Exception { LogicalCompositeComponent domain = logicalComponentManager.getDomainComposite(); QName name = composite.getName(); QNameSymbol symbol = new QNameSymbol(name); ResourceElement<QNameSymbol, Composite> element = metadataStore.find(Composite.class, symbol); if (element == null) { throw new Fabric3Exception("Composite not found in metadata store: " + name); } Contribution contribution = element.getResource().getContribution(); if (ContributionState.STORED == contribution.getState()) { throw new Fabric3Exception("Contribution is not installed: " + contribution.getUri()); } InstantiationContext context = logicalModelInstantiator.include(composite, domain); if (context.hasErrors()) { throw new AssemblyException(context.getErrors()); } deploy(domain); contribution.deploy(); }
Contribution contribution = metadataStore.find(Composite.class, symbol).getResource().getContribution(); if (ContributionState.INSTALLED != contribution.getState()) { throw new ContributionNotInstalledException("Contribution is not installed: " + contribution.getUri());