Package org.jboss.as.webservices.config

Examples of org.jboss.as.webservices.config.ServerConfigImpl


        }, OperationContext.Stage.RUNTIME);

        WSServices.saveContainerRegistry(context.getServiceRegistry(false));
        ServiceTarget serviceTarget = context.getServiceTarget();
        if (appclient && model.hasDefined(WSDL_HOST)) {
            ServerConfigImpl serverConfig = createServerConfig(model, true);
            newControllers.add(ServerConfigService.install(serviceTarget, serverConfig, verificationHandler));
        }
        if (!appclient) {
            ServerConfigImpl serverConfig = createServerConfig(model, false);
            newControllers.add(ServerConfigService.install(serviceTarget, serverConfig, verificationHandler));
            newControllers.add(EndpointRegistryService.install(serviceTarget, verificationHandler));

            final Resource webSubsystem = context.readResourceFromRoot(PathAddress.pathAddress(PathElement.pathElement("subsystem", "web")));
            String defaultHost = webSubsystem.getModel().get("default-virtual-server").asString();
View Full Code Here


            newControllers.add(PortComponentLinkService.install(serviceTarget, defaultHost, verificationHandler));
        }
    }

    private static ServerConfigImpl createServerConfig(ModelNode configuration, boolean appclient) {
        final ServerConfigImpl config = ServerConfigImpl.newInstance();
        try {
            ModelNode wsdlHost = configuration.require(WSDL_HOST).resolve();
            config.setWebServiceHost(wsdlHost.asString());
        } catch (UnknownHostException e) {
            throw new RuntimeException(e);
        }
        if (!appclient) {
            config.setModifySOAPAddress(configuration.require(MODIFY_WSDL_ADDRESS).asBoolean());
        }
        if (configuration.hasDefined(WSDL_PORT)) {
            config.setWebServicePort(configuration.require(WSDL_PORT).asInt());
        }
        if (configuration.hasDefined(WSDL_SECURE_PORT)) {
            config.setWebServiceSecurePort(configuration.require(WSDL_SECURE_PORT).asInt());
        }
        return config;
    }
View Full Code Here

     * @return
     * @throws OperationFailedException
     * @throws DisabledOperationException
     */
    private boolean updateServerConfig(OperationContext context, String attributeName, String value, boolean isRevert) throws OperationFailedException, DisabledOperationException {
        ServerConfigImpl config = (ServerConfigImpl)context.getServiceRegistry(false).getRequiredService(WSServices.CONFIG_SERVICE).getValue();
        try {
            if (MODIFY_WSDL_ADDRESS.equals(attributeName)) {
                final boolean modifyWSDLAddress = value != null && Boolean.parseBoolean(value);
                config.setModifySOAPAddress(modifyWSDLAddress, isRevert);
            } else if (WSDL_HOST.equals(attributeName)) {
                final String host = value != null ? value : null;
                try {
                    config.setWebServiceHost(host, isRevert);
                } catch (final UnknownHostException e) {
                    throw new OperationFailedException(e.getMessage(), e);
                }
            } else if (WSDL_PORT.equals(attributeName)) {
                final int port = value != null ? Integer.parseInt(value) : -1;
                config.setWebServicePort(port, isRevert);
            } else if (WSDL_SECURE_PORT.equals(attributeName)) {
                final int securePort = value != null ? Integer.parseInt(value) : -1;
                config.setWebServiceSecurePort(securePort, isRevert);
            } else if (WSDL_PATH_REWRITE_RULE.equals(attributeName)) {
                final String path = value != null ? value : null;
                config.setWebServicePathRewriteRule(path, isRevert);
            } else if (WSDL_URI_SCHEME.equals(attributeName)) {
                if (value == null || value.equals("http") || value.equals("https")) {
                    config.setWebServiceUriScheme(value, isRevert);
                } else {
                    throw new IllegalArgumentException(attributeName + " = " + value);
                }
            } else if (STATISTICS_ENABLED.equals(attributeName)) {
                final boolean enabled = value != null ? Boolean.parseBoolean(value) : false;
                config.setStatisticsEnabled(enabled);
            } else {
                throw new IllegalArgumentException(attributeName);
            }
        } catch (DisabledOperationException doe) {
            // the WS stack rejected the runtime update
View Full Code Here

        }, OperationContext.Stage.RUNTIME);

        ServiceTarget serviceTarget = context.getServiceTarget();
        final boolean jmxAvailable = isJMXSubsystemAvailable(context);
        if (appclient && model.hasDefined(WSDL_HOST)) {
            ServerConfigImpl serverConfig = createServerConfig(model, true, context);
            newControllers.add(ServerConfigService.install(serviceTarget, serverConfig, verificationHandler, getServerConfigDependencies(context, appclient), jmxAvailable));
        }
        if (!appclient) {
            ServerConfigImpl serverConfig = createServerConfig(model, false, context);
            newControllers.add(ServerConfigService.install(serviceTarget, serverConfig, verificationHandler, getServerConfigDependencies(context, appclient), jmxAvailable));
        }
        newControllers.add(XTSClientIntegrationService.install(serviceTarget, verificationHandler));
    }
View Full Code Here

        }
        newControllers.add(XTSClientIntegrationService.install(serviceTarget, verificationHandler));
    }

    private static ServerConfigImpl createServerConfig(ModelNode configuration, boolean appclient, OperationContext context) throws OperationFailedException {
        final ServerConfigImpl config = ServerConfigImpl.newInstance();
        try {
            ModelNode wsdlHost = Attributes.WSDL_HOST.resolveModelAttribute(context, configuration);
            config.setWebServiceHost(wsdlHost.isDefined() ? wsdlHost.asString() : null);
        } catch (UnknownHostException e) {
            throw new RuntimeException(e);
        }
        if (!appclient) {
            config.setModifySOAPAddress(Attributes.MODIFY_WSDL_ADDRESS.resolveModelAttribute(context, configuration).asBoolean());
            config.setStatisticsEnabled(Attributes.STATISTICS_ENABLED.resolveModelAttribute(context, configuration).asBoolean());
        }
        if (configuration.hasDefined(WSDL_PORT)) {
            config.setWebServicePort(Attributes.WSDL_PORT.resolveModelAttribute(context, configuration).asInt());
        }
        if (configuration.hasDefined(WSDL_SECURE_PORT)) {
            config.setWebServiceSecurePort(Attributes.WSDL_SECURE_PORT.resolveModelAttribute(context, configuration).asInt());
        }
        if (configuration.hasDefined(WSDL_URI_SCHEME)) {
            config.setWebServiceUriScheme(Attributes.WSDL_URI_SCHEME.resolveModelAttribute(context, configuration).asString());
        }
        if (configuration.hasDefined(WSDL_PATH_REWRITE_RULE)) {
            config.setWebServicePathRewriteRule(Attributes.WSDL_PATH_REWRITE_RULE.resolveModelAttribute(context, configuration).asString());
        }
        return config;
    }
View Full Code Here

    public void internalDeploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit unit = phaseContext.getDeploymentUnit();
        WSDeploymentBuilder.getInstance().build(unit);

        if (isWebServiceDeployment(unit)) { //note, this check works only after the WSDeploymentBuilder above has run
            ServerConfigImpl config = (ServerConfigImpl)phaseContext.getServiceRegistry().getRequiredService(WSServices.CONFIG_SERVICE).getValue();
            config.incrementWSDeploymentCount();
        }
    }
View Full Code Here

    }

    @Override
    public void internalUndeploy(final org.jboss.as.server.deployment.DeploymentUnit context) {
        if (isWebServiceDeployment(context)) {
            ServerConfigImpl config = (ServerConfigImpl)context.getServiceRegistry().getRequiredService(WSServices.CONFIG_SERVICE).getValue();
            config.decrementWSDeploymentCount();
        }
    }
View Full Code Here

                public void execute(RuntimeTaskContext context) throws OperationFailedException {
                    log.info("Activating WebServices Extension");
                    WSServices.saveContainerRegistry(context.getServiceRegistry());

                    ServiceTarget serviceTarget = context.getServiceTarget();
                    ServerConfigImpl serverConfig = createServerConfig(config);
                    ServerConfigService.install(serviceTarget, serverConfig);
                    EndpointRegistryService.install(serviceTarget);

                    // add the DUP for dealing with WS deployments
                    WSDeploymentActivator.activate(updateContext);
View Full Code Here

        final ModelNode compensatingOperation = Util.getResourceRemoveOperation(operation.require(OP_ADDR));
        return new BasicOperationResult(compensatingOperation);
    }

    private static ServerConfigImpl createServerConfig(ModelNode configuration) {
        final ServerConfigImpl config = ServerConfigImpl.getInstance();
        try {
            config.setWebServiceHost(configuration.require(WEBSERVICE_HOST).asString());
        } catch (UnknownHostException e) {
            throw new RuntimeException(e);
        }
        config.setModifySOAPAddress(configuration.require(MODIFY_SOAP_ADDRESS).asBoolean());
        if (configuration.hasDefined(WEBSERVICE_PORT)) {
            config.setWebServicePort(configuration.require(WEBSERVICE_PORT).asInt());
        }
        if (configuration.hasDefined(WEBSERVICE_SECURE_PORT)) {
            config.setWebServiceSecurePort(configuration.require(WEBSERVICE_SECURE_PORT).asInt());
        }
        return config;
    }
View Full Code Here

            }
        }, OperationContext.Stage.RUNTIME);
        if (!appclient) {
            WSServices.saveContainerRegistry(context.getServiceRegistry(false));
            ServiceTarget serviceTarget = context.getServiceTarget();
            ServerConfigImpl serverConfig = createServerConfig(model);
            newControllers.add(ServerConfigService.install(serviceTarget, serverConfig, verificationHandler));
            newControllers.add(EndpointRegistryService.install(serviceTarget, verificationHandler));
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.webservices.config.ServerConfigImpl

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.