Package org.jboss.wsf.spi.deployment

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


    * @param endpoint web service endpoint
    */
   public void init(final Endpoint endpoint)
   {
      final String ejbName = endpoint.getShortName();
      final Deployment dep = endpoint.getService().getDeployment();
      final EJBArchiveMetaData ejbArchiveMD = WSHelper.getRequiredAttachment(dep, EJBArchiveMetaData.class);
      final EJBMetaData ejbMD = (EJBMetaData) ejbArchiveMD.getBeanByEjbName(ejbName);

      if (ejbMD == null)
      {
View Full Code Here


    * @return EJB security meta data or null
    */
   private EJBSecurityMetaData getEjbSecurityMetaData(final Endpoint endpoint)
   {
      final String ejbName = endpoint.getShortName();
      final Deployment dep = endpoint.getService().getDeployment();
      final EJBArchiveMetaData ejbArchiveMD = WSHelper.getOptionalAttachment(dep, EJBArchiveMetaData.class);
      final EJBMetaData ejbMD = ejbArchiveMD != null ? ejbArchiveMD.getBeanByEjbName(ejbName) : null;

      return ejbMD != null ? ejbMD.getSecurityMetaData() : null;
   }
View Full Code Here

   protected void internalDeploy(final DeploymentUnit unit) throws DeploymentException
   {
      if (ASHelper.isWebServiceDeployment(unit))
      {
         this.log.debug(this.aspect + " start: " + unit.getName());
         final Deployment dep = ASHelper.getRequiredAttachment(unit, Deployment.class);
         if (this.aspect.canHandle(dep))
         {
            //set the context classloader using the proper one from the deployment aspect
            ClassLoader deployerClassLoader = SecurityActions.getContextClassLoader();
            try
View Full Code Here

   protected void internalUndeploy(final DeploymentUnit unit)
   {
      if (ASHelper.isWebServiceDeployment(unit))
      {
         this.log.debug(this.aspect + " stop: " + unit.getName());
         final Deployment dep = ASHelper.getRequiredAttachment(unit, Deployment.class);
         if (this.aspect.canHandle(dep))
         {
            //set the context classloader using the proper one from the deployment aspect
            ClassLoader deployerClassLoader = SecurityActions.getContextClassLoader();
            try
View Full Code Here

     * @param endpoint EJB webservice endpoint
     * @return EJB security meta data or null
     */
    private EJBSecurityMetaData getEjbSecurityMetaData(final Endpoint endpoint) {
        final String ejbName = endpoint.getShortName();
        final Deployment dep = endpoint.getService().getDeployment();
        final EJBArchiveMetaData ejbArchiveMD = WSHelper.getOptionalAttachment(dep, EJBArchiveMetaData.class);
        final EJBMetaData ejbMD = ejbArchiveMD != null ? ejbArchiveMD.getBeanByEjbName(ejbName) : null;

        return ejbMD != null ? ejbMD.getSecurityMetaData() : null;
    }
View Full Code Here

    @Override
    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit unit = phaseContext.getDeploymentUnit();
        if (isWebServiceDeployment(unit)) {
            ensureAspectInitialized();
            final Deployment dep = ASHelper.getRequiredAttachment(unit, WSAttachmentKeys.DEPLOYMENT_KEY);
            if (aspect.canHandle(dep)) {
                ROOT_LOGGER.aspectStart(aspect, unit.getName());
                ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
                try {
                    SecurityActions.setContextClassLoader(aspect.getLoader());
                    dep.addAttachment(ServiceTarget.class, phaseContext.getServiceTarget());
                    aspect.start(dep);
                    dep.removeAttachment(ServiceTarget.class);
                } finally {
                    SecurityActions.setContextClassLoader(origClassLoader);
                }
            }
        }
View Full Code Here

    }

    @Override
    public void undeploy(final DeploymentUnit unit) {
        if (isWebServiceDeployment(unit)) {
            final Deployment dep = ASHelper.getRequiredAttachment(unit, WSAttachmentKeys.DEPLOYMENT_KEY);
            if (aspect.canHandle(dep)) {
                ROOT_LOGGER.aspectStop(aspect, unit.getName());
                ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
                try {
                    SecurityActions.setContextClassLoader(aspect.getLoader());
View Full Code Here

     * Publishes the endpoints declared to the provided WSEndpointDeploymentUnit
     */
    public List<Endpoint> publish(ServiceTarget target, WSEndpointDeploymentUnit unit) throws Exception {
        List<DeploymentAspect> aspects = DeploymentAspectsProvider.getSortedDeploymentAspects();
        ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
        Deployment dep = null;
        try {
            SecurityActions.setContextClassLoader(ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader());
            WSDeploymentBuilder.getInstance().build(unit);
            dep = unit.getAttachment(WSAttachmentKeys.DEPLOYMENT_KEY);
            dep.addAttachment(ServiceTarget.class, target);
            DeploymentAspectManager dam = new DeploymentAspectManagerImpl();
            dam.setDeploymentAspects(aspects);
            dam.deploy(dep);
            // TODO: [JBWS-3426] fix this. START workaround
            if (target == null) {
                SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
                EndpointRegistryFactory factory = spiProvider.getSPI(EndpointRegistryFactory.class);
                EndpointRegistry registry = factory.getEndpointRegistry();
                for (final Endpoint endpoint : dep.getService().getEndpoints()) {
                    registry.register(endpoint);
                }
            }
            // END workaround
        } finally {
            if (dep != null) {
                dep.removeAttachment(ServiceTarget.class);
            }
            SecurityActions.setContextClassLoader(origClassLoader);
        }
        Deployment deployment = unit.getAttachment(WSAttachmentKeys.DEPLOYMENT_KEY);
        deployment.addAttachment(StandardContext.class, startWebApp(host, unit)); //TODO simplify and use findChild later in destroy()/stopWebApp()
        return deployment.getService().getEndpoints();
    }
View Full Code Here

    public void destroy(Context context) throws Exception {
        List<Endpoint> eps = context.getEndpoints();
        if (eps == null || eps.isEmpty()) {
            return;
        }
        Deployment deployment = eps.get(0).getService().getDeployment();
        List<DeploymentAspect> aspects = DeploymentAspectsProvider.getSortedDeploymentAspects();
        try {
            stopWebApp(deployment.getAttachment(StandardContext.class));
        } finally {
            ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
            try {
                SecurityActions.setContextClassLoader(ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader());
                final ServiceTarget target = deployment.getAttachment(ServiceTarget.class);
                // TODO: [JBWS-3426] fix this. START workaround
                if (target == null) {
                    SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
                    EndpointRegistryFactory factory = spiProvider.getSPI(EndpointRegistryFactory.class);
                    EndpointRegistry registry = factory.getEndpointRegistry();
                    for (final Endpoint endpoint : deployment.getService().getEndpoints()) {
                        registry.unregister(endpoint);
                    }
                }
                // END workaround
                DeploymentAspectManager dam = new DeploymentAspectManagerImpl();
View Full Code Here

           ROOT_LOGGER.cannotUnregisterRecordProcessor();
       }
    }

    private boolean hasWebservicesMD(final Endpoint endpoint) {
        final Deployment dep = endpoint.getService().getDeployment();
        return dep.getAttachment(WebservicesMetaData.class) != null;
    }
View Full Code Here

TOP

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

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.