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

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


    private TomcatServer server;

    public void start(ExtensionPointRegistry extensionPointRegistry) {

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


*/
public class WebAppModuleActivator implements ModuleActivator {

    public void start(ExtensionPointRegistry extensionPointRegistry) {

        ServletHostExtensionPoint servletHosts =
            extensionPointRegistry.getExtensionPoint(ServletHostExtensionPoint.class);

        List<ServletHost> hosts = servletHosts.getServletHosts();
        ServletHost host = null;
        try {
           host = TuscanyServletFilter.getServletHost();
        } catch (NoClassDefFoundError e) {
          // ignore
View Full Code Here

        // Create the SCA node
        NodeFactory nodeFactory = NodeFactory.newInstance();
        node = nodeFactory.createNode(nodeConfiguration);
       
        // Register the Servlet host
        ServletHostExtensionPoint servletHosts = servletHosts(node);
        servletHosts.getServletHosts().clear();
        servletHosts.addServletHost(servletHost);

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

        try {
            registry = (ExtensionPointRegistry)node.getClass().getMethod("getExtensionPointRegistry").invoke(node);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        ServletHostExtensionPoint servletHosts = registry.getExtensionPoint(ServletHostExtensionPoint.class);
        return servletHosts;
    }
View Full Code Here

    private ServletHost servletHost;
    private List<PolicyHandlerTuple> policyHandlerClassnames = null;
    private DataBindingExtensionPoint dataBindings;

    public Axis2BindingProviderFactory(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);
        policyHandlerClassnames = PolicyHandlerDefinitionsLoader.loadPolicyHandlerClassnames();
View Full Code Here

    private JettyServer server;

    public void start(ExtensionPointRegistry extensionPointRegistry) {

        // Register a Jetty Servlet host
        ServletHostExtensionPoint servletHosts =
            extensionPointRegistry.getExtensionPoint(ServletHostExtensionPoint.class);
       
        if (servletHosts.getServletHosts().size() < 1) {
            UtilityExtensionPoint utilities = extensionPointRegistry.getExtensionPoint(UtilityExtensionPoint.class);
            final WorkScheduler workScheduler = utilities.getUtility(WorkScheduler.class);
            // Allow privileged access to start MBeans. Requires MBeanPermission in security policy.
            try {
                server = AccessController.doPrivileged(new PrivilegedAction<JettyServer>() {
                    public JettyServer run() {
                        return new JettyServer(workScheduler);
                     }
                });       
                servletHosts.addServletHost(server);
            } catch (Exception e) {
                logger.log(Level.WARNING, "Exception creating JettyServer", e);
            }
        }
    }
View Full Code Here

    private FactoryExtensionPoint modelFactories;
    private ServletHost servletHost;
    private DataBindingExtensionPoint dataBindings;

    public Axis2BindingProviderFactory(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

        // Create the SCA node
        NodeFactory nodeFactory = NodeFactory.newInstance();
        node = nodeFactory.createNode(nodeConfiguration);
       
        // Register the Servlet host
        ServletHostExtensionPoint servletHosts = servletHosts(node);
        servletHosts.getServletHosts().clear();
        servletHosts.addServletHost(servletHost);

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

        try {
            registry = (ExtensionPointRegistry)node.getClass().getMethod("getExtensionPointRegistry").invoke(node);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        ServletHostExtensionPoint servletHosts = registry.getExtensionPoint(ServletHostExtensionPoint.class);
        return servletHosts;
    }
View Full Code Here

    private JettyServer server;

    public void start(ExtensionPointRegistry extensionPointRegistry) {

        // Register a Jetty Servlet host
        ServletHostExtensionPoint servletHosts =
            extensionPointRegistry.getExtensionPoint(ServletHostExtensionPoint.class);

        List<ServletHost> hosts = servletHosts.getServletHosts();
        if (hosts != null) {
            // Clear out any other hosts (eg webapp or tomcat) and add this jetty host is default
            hosts.clear();
            UtilityExtensionPoint utilities = extensionPointRegistry.getExtensionPoint(UtilityExtensionPoint.class);
            final WorkScheduler workScheduler = utilities.getUtility(WorkScheduler.class);
            // Allow privileged access to start MBeans. Requires MBeanPermission in security policy.
            try {
                server = AccessController.doPrivileged(new PrivilegedAction<JettyServer>() {
                    public JettyServer run() {
                        return new JettyServer(workScheduler);
                     }
                });       
                servletHosts.addServletHost(server);
            } catch (Exception e) {
                logger.log(Level.WARNING, "Exception creating JettyServer", e);
            }
        }
    }
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.