public void create(Deployment dep, URL webAppURL) { if (webAppURL == null) throw new IllegalArgumentException("Web meta data URL cannot be null"); log.debug("publishServiceEndpoint: " + webAppURL); try { webXMLRewriter.rewriteWebXml(dep); dep.setProperty(HttpSpec.PROPERTY_WEBAPP_URL, webAppURL); org.jboss.deployers.client.spi.Deployment deployment = createDeploymentContext(webAppURL); // Mark the deployment as generated web app so the JSE deployer hook can ignore it MutableAttachments attach = (MutableAttachments)deployment.getPredeterminedManagedObjects(); attach.addAttachment(HttpSpec.PROPERTY_GENERATED_WEBAPP, Boolean.TRUE); mainDeployer.deploy(deployment); deploymentMap.put(webAppURL.toExternalForm(), deployment); } catch (Exception ex) { WSFDeploymentException.rethrow(ex); } }
public DeploymentContext determineStructure(Deployment deployment) throws DeploymentException { StructureBuilder builder = getStructureBuilder(); if (builder == null) throw new IllegalStateException("No structure builder has been configured"); Attachments attachments = deployment.getPredeterminedManagedObjects(); StructureMetaData structureMetaData = attachments.getAttachment(StructureMetaData.class); if (structureMetaData == null) { structureMetaData = StructureMetaDataFactory.createStructureMetaData(); try { determineStructure(deployment, structureMetaData); } catch (DeploymentException e) { throw e; } catch (Throwable t) { throw DeploymentException.rethrowAsDeploymentException("Exception determining structure: " + deployment, t); } } return structureBuilder.populateContext(deployment, structureMetaData); }
public DeploymentContext determineStructure(Deployment deployment) throws DeploymentException { StructureBuilder builder = getStructureBuilder(); if (builder == null) throw new IllegalStateException("No structure builder has been configured"); Attachments attachments = deployment.getPredeterminedManagedObjects(); StructureMetaData structureMetaData = attachments.getAttachment(StructureMetaData.class); if (structureMetaData == null) { structureMetaData = StructureMetaDataFactory.createStructureMetaData(); try { determineStructure(deployment, structureMetaData); } catch (DeploymentException e) { throw e; } catch (Throwable t) { throw DeploymentException.rethrowAsDeploymentException("Exception determining structure: " + deployment, t); } } return structureBuilder.populateContext(deployment, structureMetaData); }
if (contextInfo == null) contextInfo = StructureMetaDataFactory.createContextInfo("", null); contextInfo.setPredeterminedManagedObjects(deployment.getPredeterminedManagedObjects()); applyContextInfo(result, contextInfo);
final ClassLoader endpointClassLoader = endpointClass.getClassLoader(); final Deployment deployment = this.createSimpleDeployment("http://jaxws-endpoint-api" + contextRoot); final MutableAttachments mutableAttachments = (MutableAttachments) deployment.getPredeterminedManagedObjects(); final JBossWebMetaData jbossWebMD = this.newJBossWebMetaData(contextRoot, endpointClass);
contextInfo.setPredeterminedManagedObjects(deployment.getPredeterminedManagedObjects()); applyContextInfo(result, contextInfo);
public ServiceEndpointReference deploy(EndpointMetaData metaData, Class<?> providerImpl, URL serviceUrl, final ClassLoader classLoader, File warArchive, ServerConfig serverConfig) throws Exception { Deployment deployment = createVFSDeployment(warArchive); // Classloading ClassLoaderFactory clf = new DelegatingClassLoaderFactory(classLoader); // WebMetaData String[] webContext = deriveWebContextFromServiceUrl(serviceUrl); WebMetaDataFactory wmdFactory = new WebMetaDataFactory( metaData.getEndpointId(), webContext[0], webContext[1], providerImpl.getName() ); MutableAttachments mutableAttachments = (MutableAttachments)deployment.getPredeterminedManagedObjects(); // Applies to in memory only. Not used with VFS underneath //mutableAttachments.addAttachment(StructureMetaData.class, new StructureMetaDataImpl()); mutableAttachments.addAttachment(ClassLoaderFactory.class, clf); mutableAttachments.addAttachment(JBossWebMetaData.class, wmdFactory.createWebMetaData(classLoader)); mutableAttachments.addAttachment(DeploymentUnitFilter.class, new RiftsawWSDeploymentUnitFilter()); getMainDeployer().deploy(deployment); ServiceEndpointReference ref = new ServiceEndpointReference( metaData.getEndpointId(), serviceUrl, deployment.getName(), warArchive.getAbsolutePath() ); //ref.setArchiveLocation(warArchive.getAbsolutePath()); return(ref); }