Package org.apache.tuscany.sca.host.http

Examples of org.apache.tuscany.sca.host.http.ServletHostExtensionPoint


                String host = InetAddress.getLocalHost().getHostName();
                ServerSocket socket = new ServerSocket(0);
                int port = socket.getLocalPort();
                socket.close();
               
                ServletHostExtensionPoint servletHosts = domainManagementRuntime.getExtensionPointRegistry().getExtensionPoint(ServletHostExtensionPoint.class);
                for (ServletHost servletHost: servletHosts.getServletHosts()) {
                    servletHost.setDefaultPort(port);
                    if (path != null && path.length() > 0 && !path.equals("/")) {
                        servletHost.setContextPath(path);
                    }
                }
               
                // make the node available to the model
                // this causes the runtime to start registering binding-sca service endpoints
                // with the domain proxy
                // TODO - This code is due to be pulled out and combined with the register and
                //        resolution code that appears in this class
                ModelFactoryExtensionPoint factories = domainManagementRuntime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
                nodeFactory = new NodeFactoryImpl(node);
                factories.addFactory(nodeFactory);               

                // Create an in-memory domain level management composite
                AssemblyFactory assemblyFactory = domainManagementRuntime.getAssemblyFactory();
                domainManagementComposite = assemblyFactory.createComposite();
                domainManagementComposite.setName(new QName(Constants.SCA10_NS, "domainManagement"));
                domainManagementComposite.setURI(domainModel.getDomainURI() + "/Management");
               
               
            } else {
                domainManagementRuntime = (ReallySmallRuntime)((SCANodeSPI)node).getNodeRuntime();
                domainManagementComposite = domainManagementRuntime.getCompositeActivator().getDomainComposite();

                // set the context path for the node
                String path = URI.create(node.getURI()).getPath();
                if (path != null && path.length() > 0 && !path.equals("/")) {
                    ServletHostExtensionPoint servletHosts = domainManagementRuntime.getExtensionPointRegistry().getExtensionPoint(ServletHostExtensionPoint.class);
                    for (ServletHost servletHost: servletHosts.getServletHosts()) {
                        servletHost.setContextPath(path);
                    }
                }
            }
         
View Full Code Here


   
    /**
     * Constructs a resource implementation.
     */
    public WidgetImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
        ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
        this.servletHost = servletHosts.getServletHosts().get(0);
    }
View Full Code Here

    private ServletHost servletHost;
    private DataBindingExtensionPoint dataBindings;
    private String defaultPort = "8085";

    public JAXWSBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
        ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
        List<ServletHost> hosts = servletHosts.getServletHosts();
        if (!hosts.isEmpty()) {
            this.servletHost = hosts.get(0);
        }
        modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
        dataBindings = extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class);
View Full Code Here

                // Add ServletContext as a utility
                ExtensionPointRegistry registry = factory.getExtensionPointRegistry();
                UtilityExtensionPoint utilityExtensionPoint = registry.getExtensionPoint(UtilityExtensionPoint.class);
                utilityExtensionPoint.addUtility(ServletContext.class, servletContext);
               
                ServletHostExtensionPoint servletHosts = registry.getExtensionPoint(ServletHostExtensionPoint.class);
                servletHosts.setWebApp(true);

                // TODO: why are the init parameters copied to the attributes?
                for (Enumeration<?> e = servletContext.getInitParameterNames(); e.hasMoreElements();) {
                    String name = (String)e.nextElement();
                    String value = servletContext.getInitParameter(name);
View Full Code Here

    private JettyServer server;

    public void start(ExtensionPointRegistry extensionPointRegistry) {

        // Register a Jetty servlet host
        ServletHostExtensionPoint servletHosts =
            extensionPointRegistry.getExtensionPoint(ServletHostExtensionPoint.class);
        WorkScheduler workScheduler = extensionPointRegistry.getExtensionPoint(WorkScheduler.class);
        server = new JettyServer(workScheduler);
        servletHosts.addServletHost(server);
    }
View Full Code Here

            }
            // Configure the default server port
            int port = URI.create(nodeName).getPort();
            if (port != -1) {
                ServletHostExtensionPoint servletHosts = nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ServletHostExtensionPoint.class);
                for (ServletHost servletHost: servletHosts.getServletHosts()) {
                    servletHost.setDefaultPort(port);
                }
            }
           
            // Create an in-memory domain level composite
View Full Code Here

public class JSONRPCBindingProviderFactory implements BindingProviderFactory<JSONRPCBinding> {

    private ServletHost servletHost;
   
    public JSONRPCBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
        ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
        this.servletHost = servletHosts.getServletHosts().get(0);
    }
View Full Code Here

            domainBuilder = nodeRuntime.getDomainBuilder();           
           
            // configure the default port and path for this runtime
            int port = URI.create(nodeURI).getPort();
            String path = nodeURL.getPath();
            ServletHostExtensionPoint servletHosts = nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ServletHostExtensionPoint.class);
            for (ServletHost servletHost: servletHosts.getServletHosts()) {
                servletHost.setDefaultPort(port);
                if (path != null && path.length() > 0 && !path.equals("/")) {
                    servletHost.setContextPath(path);
                }
            }           
View Full Code Here

            port = URI.create(nodeURI).getPort();
        }
       
        // Configure the default port
        if (port != -1) {
            ServletHostExtensionPoint servletHosts = nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ServletHostExtensionPoint.class);
            for (ServletHost servletHost: servletHosts.getServletHosts()) {
                servletHost.setDefaultPort(port);
            }
        }
    }
View Full Code Here

        // Create the SCA node
        SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
        node = nodeFactory.createSCANode(nodeImage);
       
        // Register the Servlet host
        ServletHostExtensionPoint servletHosts = servletHosts(node);
        servletHosts.getServletHosts().clear();
        servletHosts.addServletHost(servletHost);

        // Save the node in the Servlet context
        servletContext.setAttribute(SCAClient.class.getName(), node);
       
        // Start the node
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.host.http.ServletHostExtensionPoint

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.