private boolean hasWebservicesMD(final Endpoint endpoint) { final Deployment dep = endpoint.getService().getDeployment(); return dep.getAttachment(WebservicesMetaData.class) != null; }
/** * Returns true if deployment represents JAXWS EJB deployment. * * @param dep webservice deployment * @return true if JAXWS EJB deployment, false otherwise */ public static boolean isJaxwsEjbDeployment( final Deployment dep ) { return dep.getService().getEndpoints( JAXWS_EJB_ENDPOINT_FILTER ).size() > 0; }
/** * Modifies context root. * * @param dep webservice deployment * @param jbossWebMD web meta data */ private void modifyContextRoot(final Deployment dep, final JBossWebMetaData jbossWebMD) { final String contextRoot = dep.getService().getContextRoot(); this.log.debug("Setting context root: " + contextRoot + " for deployment: " + dep.getSimpleName()); jbossWebMD.setContextRoot(contextRoot); }
@Override public void start(Deployment dep) { final String contextRoot = dep.getService().getContextRoot(); if (contextRoot == null || contextRoot.startsWith("/") == false) throw Messages.MESSAGES.contextRootExpectedToStartWithLeadingSlash(contextRoot); for (Endpoint ep : dep.getService().getEndpoints()) { final StringBuilder name = new StringBuilder(Endpoint.SEPID_DOMAIN + ":"); name.append(Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextRoot.substring(1) + ","); name.append(Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ep.getShortName()); ep.setName(ObjectNameFactory.create(name.toString())); } }
@Override public void start(Deployment dep) { String contextRoot = dep.getService().getContextRoot(); if (contextRoot == null) { contextRoot = getExplicitContextRoot(dep); if (contextRoot == null) contextRoot = getImplicitContextRoot((ArchiveDeployment)dep); // Always prefix with '/' if (contextRoot.startsWith("/") == false) contextRoot = "/" + contextRoot; dep.getService().setContextRoot(contextRoot); } }
protected void createJBossWebAppDescriptor(Deployment dep, JBossWebMetaData jbwmd, SecurityHandler securityHandler) { /* Create a jboss-web <jboss-web> <security-domain>java:/jaas/cts</security-domain> <context-root>/ws/ejbN/</context-root> <virtual-host>some.domain.com</virtual-host> </jboss-web> */ if (securityHandler != null) securityHandler.addSecurityDomain(jbwmd, dep); // Get the context root for this deployment String contextRoot = dep.getService().getContextRoot(); if (contextRoot == null) throw new WSFDeploymentException("Cannot obtain context root"); jbwmd.setContextRoot(contextRoot); String[] virtualHosts = dep.getService().getVirtualHosts(); if (virtualHosts != null && virtualHosts.length > 0) { jbwmd.setVirtualHosts(Arrays.asList(virtualHosts)); } } }
service.setContextRoot(context.getContextRoot()); service.addEndpoint(ep);
/** * Creates new Web Service endpoint. * * @param endpointClass endpoint class name * @param endpointName endpoint name * @param dep deployment * @return WS endpoint */ protected final Endpoint newEndpoint(final String endpointClass, final String endpointName, final Deployment dep) { if (endpointName == null) { throw new NullPointerException("Null endpoint name"); } if (endpointClass == null) { throw new NullPointerException("Null endpoint class"); } final Endpoint endpoint = this.deploymentModelFactory.newEndpoint(endpointClass); endpoint.setShortName(endpointName); dep.getService().addEndpoint(endpoint); return endpoint; }
for (Endpoint endpoint : dep.getService().getEndpoints()) final Endpoint endpoint = dep.getService().getEndpointByName(ejbName); endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
protected void initEndpointAddress(Deployment dep, ServerEndpointMetaData sepMetaData) String contextRoot = dep.getService().getContextRoot(); String urlPattern = null; if (linkName != null) Endpoint endpoint = dep.getService().getEndpointByName(linkName); if (endpoint != null) urlPattern = ((HttpEndpoint)endpoint).getURLPattern(); Integer port = (Integer)dep.getService().getProperty("port"); if (port == null)
final List<String> virtualHosts = dep.getService().getVirtualHosts(); this.log.debug("Setting virtual hosts: " + virtualHosts); jbossWebMD.setVirtualHosts(virtualHosts);
QName interfaceQName = wsdlEndpoint.getInterface().getName(); Endpoint ep = dep.getService().getEndpointByName(linkName); ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData, ep, portName, interfaceQName); sepMetaData.setPortComponentName(pcMetaData.getPortComponentName());
service.setContextRoot(context.getContextRoot()); service.addEndpoint(ep);
/** * Creates new Web Service endpoint. * * @param endpointClass endpoint class name * @param endpointName endpoint name * @param dep deployment * @return WS endpoint */ protected final Endpoint newEndpoint(final String endpointClass, final String endpointName, final Deployment dep) { if (endpointName == null) { throw new NullPointerException("Null endpoint name"); } if (endpointClass == null) { throw new NullPointerException("Null endpoint class"); } final Endpoint endpoint = this.deploymentModelFactory.newEndpoint(endpointClass); endpoint.setShortName(endpointName); dep.getService().addEndpoint(endpoint); return endpoint; }
protected void createJBossWebAppDescriptor(Deployment dep, JBossWebMetaData jbwmd, SecurityHandler securityHandler) { /* Create a jboss-web <jboss-web> <security-domain>java:/jaas/cts</security-domain> <context-root>/ws/ejbN/</context-root> <virtual-host>some.domain.com</virtual-host> </jboss-web> */ if (securityHandler != null) securityHandler.addSecurityDomain(jbwmd, dep); // Get the context root for this deployment String contextRoot = dep.getService().getContextRoot(); if (contextRoot == null) throw new WSFDeploymentException("Cannot obtain context root"); jbwmd.setContextRoot(contextRoot); String[] virtualHosts = dep.getService().getVirtualHosts(); if (virtualHosts != null && virtualHosts.length > 0) { jbwmd.setVirtualHosts(Arrays.asList(virtualHosts)); } } }
for (Endpoint endpoint : dep.getService().getEndpoints()) final Endpoint endpoint = dep.getService().getEndpointByName(ejbName); endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
@Override public void start(Deployment dep) { String contextRoot = dep.getService().getContextRoot(); if (contextRoot == null) { contextRoot = getExplicitContextRoot(dep); if (contextRoot == null) contextRoot = getImplicitContextRoot((ArchiveDeployment)dep); // Always prefix with '/' if (contextRoot.startsWith("/") == false) contextRoot = "/" + contextRoot; dep.getService().setContextRoot(contextRoot); } }
final List<String> virtualHosts = dep.getService().getVirtualHosts(); this.log.debug("Setting virtual hosts: " + virtualHosts); jbossWebMD.setVirtualHosts(virtualHosts);
public static void undoPublishStep(WebHost host, Context wsctx) throws Exception { List<Endpoint> eps = wsctx.getEndpoints(); if (eps == null || eps.isEmpty()) { return; } EndpointPublisherImpl publisher = new EndpointPublisherImpl(host, true); publisher.stopWebApp(eps.get(0).getService().getDeployment()); }
public void stop(final Deployment dep) { for (final Endpoint ep : dep.getService().getEndpoints()) { ep.setRecordProcessors(Collections.<RecordProcessor>emptyList()); } }