Package org.jboss.wsf.spi.deployment

Examples of org.jboss.wsf.spi.deployment.Service


      ArchiveDeployment dep = newDeployment(di);
      dep.setRootFile(new URLLoaderAdapter(di.localUrl));
      dep.setRuntimeClassLoader(null);
      dep.setType(getDeploymentType());

      Service service = dep.getService();

      WebMetaData webMetaData = (WebMetaData)di.metaData;
      if (webMetaData == null)
         throw new IllegalStateException("Deployment unit does not contain web meta data");

      WebservicesMetaData wsMetaData = getWebservicesMetaData(di, "WEB-INF/webservices.xml");
      if (wsMetaData == null)
         throw new IllegalStateException("Deployment unit does not contain webservices meta data");

      // Copy the attachments
      dep.addAttachment(WebservicesMetaData.class, wsMetaData);
      dep.addAttachment(WebMetaData.class, webMetaData);

      for (WebserviceDescriptionMetaData wsd : wsMetaData.getWebserviceDescriptions())
      {
         for (PortComponentMetaData pcmd : wsd.getPortComponents())
         {
            String servletLink = pcmd.getServletLink();
            if (servletLink == null)
               throw new IllegalStateException("servlet-link cannot be null");

            Servlet servlet = getServletForName(webMetaData, servletLink);
            String servletClass = servlet.getServletClass();

            try
            {
               ClassLoader loader = dep.getInitialClassLoader();
               Class<?> epBean = loader.loadClass(servletClass.trim());

               // If this is a servlet we defer the the bean creation
               if (javax.servlet.Servlet.class.isAssignableFrom(epBean))
                  servletClass = null;
            }
            catch (ClassNotFoundException ex)
            {
               log.warn("Cannot load servlet class: " + servletClass);
            }

            // Create the endpoint
            Endpoint ep = newEndpoint(servletClass);
            ep.setShortName(servletLink);
            service.addEndpoint(ep);
         }
      }

      return dep;
   }
View Full Code Here


      ArchiveDeployment dep = newDeployment(di);
      dep.setRootFile(new URLLoaderAdapter(di.localUrl));
      dep.setRuntimeClassLoader(di.ucl);
      dep.setType(getDeploymentType());

      Service service = dep.getService();

      Ejb3ModuleMBean ejb3Module = EJBArchiveMetaDataAdapterEJB3.getEJB3Module(di.deployedObject);
      for (Object manager : ejb3Module.getContainers().values())
      {
         if (manager instanceof EJBContainer)
         {
            EJBContainer container = (EJBContainer)manager;
            if (isWebServiceBean(container))
            {
               String ejbName = container.getEjbName();
               String epBean = container.getBeanClassName();

               // Create the endpoint
               Endpoint ep = newEndpoint(epBean);
               ep.setShortName(ejbName);
               service.addEndpoint(ep);
            }
         }
      }

      return dep;
View Full Code Here

      ArchiveDeployment dep = newDeployment(di);
      dep.setRootFile(new URLLoaderAdapter(di.localUrl));
      dep.setRuntimeClassLoader(null);
      dep.setType(getDeploymentType());

      Service service = dep.getService();

      WebMetaData webMetaData = (WebMetaData)di.metaData;
      if (webMetaData == null)
         throw new IllegalStateException("Deployment unit does not contain web meta data");

      // Copy the attachments
      dep.addAttachment(WebMetaData.class, webMetaData);

      List<Servlet> servlets = getEndpointBeans(webMetaData, di.annotationsCl);
      for (Servlet servlet : servlets)
      {
         String servletName = servlet.getServletName();
         String servletClass = servlet.getServletClass();

         // Create the endpoint
         Endpoint ep = newEndpoint(servletClass);
         ep.setShortName(servletName);
         service.addEndpoint(ep);
      }

      return dep;
   }
View Full Code Here

      ArchiveDeployment dep = newDeployment(di);
      dep.setRootFile(new URLLoaderAdapter(di.localUrl));
      dep.setRuntimeClassLoader(di.ucl);
      dep.setType(getDeploymentType());

      Service service = dep.getService();

      ApplicationMetaData appmd = (ApplicationMetaData)di.metaData;
      if (appmd == null)
         throw new IllegalStateException("Deployment unit does not contain application meta data");

      WebservicesMetaData wsMetaData = getWebservicesMetaData(di, null);
      if (wsMetaData == null)
         throw new IllegalStateException("Deployment unit does not contain webservices meta data");

      // Copy the attachments
      dep.addAttachment(WebservicesMetaData.class, wsMetaData);
      dep.addAttachment(ApplicationMetaData.class, appmd);

      for (WebserviceDescriptionMetaData wsd : wsMetaData.getWebserviceDescriptions())
      {
         for (PortComponentMetaData pcmd : wsd.getPortComponents())
         {
            String ejbLink = pcmd.getEjbLink();
            if (ejbLink == null)
               throw new IllegalStateException("ejb-link cannot be null");

            BeanMetaData beanMetaData = appmd.getBeanByEjbName(ejbLink);
            if (beanMetaData == null)
               throw new IllegalStateException("Cannot obtain bean meta data for: " + ejbLink);

            String ejbClass = beanMetaData.getEjbClass();
           
            // Create the endpoint
            Endpoint ep = newEndpoint(ejbClass);
            ep.setShortName(ejbLink);
            service.addEndpoint(ep);
         }
      }
      return dep;
   }
View Full Code Here

         // Create/Setup the deployment
         Deployment dep = depModelFactory.newDeployment("endpoint-deployment", implClass.getClassLoader());
         dep.setRuntimeClassLoader(dep.getInitialClassLoader());

         // Create/Setup the service
         Service service = dep.getService();
         service.setContextRoot(context.getContextRoot());

         // Create/Setup the endpoint
         org.jboss.wsf.spi.deployment.Endpoint ep = depModelFactory.newEndpoint(implClass.getName());
         service.addEndpoint(ep);

         // Deploy using deployment aspects
         WSFRuntimeLocator locator = spiProvider.getSPI(WSFRuntimeLocator.class);
         WSFRuntime runtime = locator.locateRuntime(runtimeName);
       
View Full Code Here

TOP

Related Classes of org.jboss.wsf.spi.deployment.Service

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.