Package org.jboss.wsf.spi.management

Examples of org.jboss.wsf.spi.management.ServerConfig


               String servicePath = sepMetaData.getContextRoot() + sepMetaData.getURLPattern();
               String serviceEndpointURL = getServiceEndpointAddress(uriScheme, servicePath);

               SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
               ServerConfig config = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
               boolean alwaysModify = config.isModifySOAPAddress();

               if (alwaysModify || uriScheme == null || orgAddress.indexOf("REPLACE_WITH_ACTUAL_URL") >= 0)
               {
                  log.debug("Replace service endpoint address '" + orgAddress + "' with '" + serviceEndpointURL + "'");
                  wsdlEndpoint.setAddress(serviceEndpointURL);
View Full Code Here


      File tmpdir = null;
      try
      {
         SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
         ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();File tmpDir = serverConfig.getServerTempDir();
         tmpdir = serverConfig.getServerTempDir();
         tmpdir = new File(tmpdir.getCanonicalPath() + "/jbossws");
         tmpdir.mkdirs();
      }
      catch (Throwable th)
      {
View Full Code Here

    public synchronized void start(final StartContext context) throws StartException {
        // XTS expects the TCCL to be set to something that will locate the XTS service implementation classes.
        final ClassLoader loader = XTSService.class.getClassLoader();
        WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(loader);
        try {
            ServerConfig serverConfigValue =  wsServerConfig.getValue();
            WSCEnvironmentBean wscEnVBean = XTSPropertyManager.getWSCEnvironmentBean();

            if (coordinatorURL !=null ) {
                wscEnVBean.setCoordinatorURL11(coordinatorURL);
            }
            else {
                //Defaults to insecure (http) on this server's bind address.
                String defaultCoordinatorUrl = "http://" + serverConfigValue.getWebServiceHost() + ":" +
                        serverConfigValue.getWebServicePort() + "/" + wscEnVBean.getCoordinatorPath11();
                wscEnVBean.setCoordinatorURL11(defaultCoordinatorUrl);
            }

            wscEnVBean.setBindAddress11(serverConfigValue.getWebServiceHost());
            wscEnVBean.setBindPort11(serverConfigValue.getWebServicePort());
            wscEnVBean.setBindPortSecure11(serverConfigValue.getWebServiceSecurePort());

            XTSService service = new XTSService();
            try {
                service.start();
            } catch (Exception e) {
View Full Code Here

      //modify the runtime if we're booting, otherwise set reload required and leave the runtime unchanged
      if (context.isBooting()) {
         final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
         final String name = address.getLastElement().getValue();
         //get the server config object from the ServerConfigService (service installed and not started yet, but the object is fine for our needs here)
         final ServerConfig serverConfig = ASHelper.getMSCService(WSServices.CONFIG_SERVICE, ServerConfig.class, context);
         final ServiceName serviceName = getClientConfigServiceName(name);
         final ConfigService clientConfigService = new ConfigService(serverConfig, name, true);
         final ServiceTarget target = context.getServiceTarget();
         final ServiceBuilder<?> clientServiceBuilder = target.addService(serviceName, clientConfigService);
         for (ServiceName sn : PackageUtils.getServiceNameDependencies(context, serviceName, address, Constants.PROPERTY)) {
View Full Code Here

        if (context.isBooting()) {
           final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
           final String name = address.getLastElement().getValue();

           //get the server config object from the ServerConfigService (service installed but not started yet, but the object is fine for our needs here)
           final ServerConfig serverConfig = ASHelper.getMSCService(WSServices.CONFIG_SERVICE, ServerConfig.class, context);
           final ServiceName serviceName = getEndpointConfigServiceName(name);
           final ConfigService endpointConfigService = new ConfigService(serverConfig, name, false);

           final ServiceTarget target = context.getServiceTarget();
           final ServiceBuilder<?> serviceBuilder = target.addService(serviceName, endpointConfigService);
View Full Code Here

        if (!mainServices.isSuccessfulBoot()) {
            Assert.fail(mainServices.getBootError().toString());
        }

        //WSDL soap:address rewrite engine options test
        ServerConfig serverConfig = getMSCService(mainServices.getContainer(), WSServices.CONFIG_SERVICE, ServerConfig.class);
        Assert.assertTrue(serverConfig.isModifySOAPAddress());
        Assert.assertEquals("localhost", serverConfig.getWebServiceHost());
        Assert.assertEquals(9895, serverConfig.getWebServicePort());
        Assert.assertEquals(9944, serverConfig.getWebServiceSecurePort());
        Assert.assertEquals("https", serverConfig.getWebServiceUriScheme());
        Assert.assertEquals("s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g", serverConfig.getWebServicePathRewriteRule());

        //Client & Endpoint predefined configuration tests
        //HACK: we need to manually reload the client/endpoint configs as the ServerConfigService is actually not starting in this test;
        //the reason is that it requires services which are not installed here and even if those were available it would fail to start
        //because we're not running in a modular environment and hence it won't be able to detect the proper ws stack implementation.
        //Even if we made the subsystem work with a flat classloader (which would not make sense except for the tests here), we'd have
        //to deal a hell of ws specific maven dependencies here... so really not worth the effort.
        serverConfig.reloadClientConfigs();
        ClientConfig clCfg = serverConfig.getClientConfig("My-Client-Config");
        Assert.assertNotNull(clCfg);
        Assert.assertEquals(1, clCfg.getProperties().size());
        Assert.assertEquals("bar3", clCfg.getProperties().get("foo3"));
        Assert.assertEquals(2, clCfg.getPreHandlerChains().size());
        Map<String, UnifiedHandlerChainMetaData> map = new HashMap<String, UnifiedHandlerChainMetaData>();
        for (UnifiedHandlerChainMetaData uhc : clCfg.getPreHandlerChains()) {
            map.put(uhc.getId(), uhc);
        }
        Assert.assertTrue(map.get("my-handlers").getHandlers().isEmpty());
        Assert.assertEquals("##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM", map.get("my-handlers").getProtocolBindings());
        Assert.assertEquals(1, map.get("my-handlers2").getHandlers().size());
        Assert.assertEquals("MyHandler", map.get("my-handlers2").getHandlers().get(0).getHandlerName());
        Assert.assertEquals("org.jboss.ws.common.invocation.MyHandler", map.get("my-handlers2").getHandlers().get(0).getHandlerClass());
        Assert.assertEquals("##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM", map.get("my-handlers").getProtocolBindings());
        Assert.assertEquals(1, clCfg.getPostHandlerChains().size());
        Assert.assertEquals("my-handlers2", clCfg.getPostHandlerChains().get(0).getId());
        Assert.assertEquals(1, clCfg.getPostHandlerChains().get(0).getHandlers().size());
        Assert.assertEquals("MyHandler2", clCfg.getPostHandlerChains().get(0).getHandlers().get(0).getHandlerName());
        Assert.assertEquals("org.jboss.ws.common.invocation.MyHandler2", clCfg.getPostHandlerChains().get(0).getHandlers().get(0).getHandlerClass());
        Assert.assertEquals("##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM", clCfg.getPostHandlerChains().get(0).getProtocolBindings());
       
        serverConfig.reloadEndpointConfigs();
        EndpointConfig epCfg = serverConfig.getEndpointConfig("Standard-Endpoint-Config");
        Assert.assertNotNull(epCfg);
        Assert.assertTrue(epCfg.getProperties().isEmpty());
        Assert.assertTrue(epCfg.getPreHandlerChains().isEmpty());
        Assert.assertTrue(epCfg.getPostHandlerChains().isEmpty());
        epCfg = serverConfig.getEndpointConfig("Recording-Endpoint-Config");
        Assert.assertNotNull(epCfg);
        Assert.assertEquals(2, epCfg.getProperties().size());
        Assert.assertEquals("bar", epCfg.getProperties().get("foo"));
        Assert.assertEquals("bar2", epCfg.getProperties().get("foo2"));
        Assert.assertEquals(1, epCfg.getPreHandlerChains().size());
View Full Code Here

    public synchronized void start(final StartContext context) throws StartException {
        // XTS expects the TCCL to be set to something that will locate the XTS service implementation classes.
        final ClassLoader loader = XTSService.class.getClassLoader();
        SecurityActions.setContextLoader(loader);
        try {
            ServerConfig serverConfigValue =  wsServerConfig.getValue();
            WSCEnvironmentBean wscEnVBean = XTSPropertyManager.getWSCEnvironmentBean();

            if (coordinatorURL !=null ) {
                wscEnVBean.setCoordinatorURL11(coordinatorURL);
            }
            else {
                //Defaults to insecure (http) on this server's bind address.
                String defaultCoordinatorUrl = "http://" + serverConfigValue.getWebServiceHost() + ":" +
                        serverConfigValue.getWebServicePort() + "/" + wscEnVBean.getCoordinatorPath11();
                wscEnVBean.setCoordinatorURL11(defaultCoordinatorUrl);
            }

            wscEnVBean.setBindAddress11(serverConfigValue.getWebServiceHost());
            wscEnVBean.setBindPort11(serverConfigValue.getWebServicePort());
            wscEnVBean.setBindPortSecure11(serverConfigValue.getWebServiceSecurePort());

            XTSService service = new XTSService();
            try {
                service.start();
            } catch (Exception e) {
View Full Code Here

*/
public class ServerConfigFactoryImpl extends ServerConfigFactory
{
   public ServerConfig getServerConfig()
   {
      ServerConfig serverConfig = new KernelAwareSPIFactory().getKernelProvidedSPI(ServerConfig.BEAN_NAME, ServerConfig.class);
      if (serverConfig == null)
         throw new IllegalStateException("Cannot obtain ServerConfig for bean name: " + ServerConfig.BEAN_NAME);
     
      return serverConfig;
   }
View Full Code Here

   }

   private void setupHTMLResponseHeader(PrintWriter writer)
   {
      SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
      ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
      writer.println("<head>");
      writer.println("<meta http-equiv='Content-Type content='text/html; charset=iso-8859-1'>");
      writer.println("<title>JBossWS / " + serverConfig.getImplementationVersion() + "</title>");
      writer.println("<link rel='stylesheet' href='./styles.css'>");
      writer.println("</head>");
   }
View Full Code Here

      if (contextRoot == null)
         throw new IllegalStateException("Cannot obtain context root");
     
      SPIProvider provider = SPIProviderResolver.getInstance().getProvider();
      ServerConfigFactory spi = provider.getSPI(ServerConfigFactory.class);
      ServerConfig serverConfig = spi.getServerConfig();
     
      String host = serverConfig.getWebServiceHost();
      int port = serverConfig.getWebServicePort();
      int securePort = serverConfig.getWebServiceSecurePort();
      for (Endpoint ep : dep.getService().getEndpoints())
      {
         boolean confidential = isConfidentialTransportGuarantee(dep, ep);
         int currentPort = confidential ? securePort : port;
         String hostAndPort = host + (currentPort > 0 ? ":" + currentPort : "");
View Full Code Here

TOP

Related Classes of org.jboss.wsf.spi.management.ServerConfig

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.