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

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


                // Add ServletContext as a utility
                ExtensionPointRegistry registry = factory.getExtensionPointRegistry();
                UtilityExtensionPoint utilityExtensionPoint = registry.getExtensionPoint(UtilityExtensionPoint.class);
                utilityExtensionPoint.addUtility(ServletContext.class, configurator.getServletContext());

                ServletHostExtensionPoint servletHosts = registry.getExtensionPoint(ServletHostExtensionPoint.class);
                servletHosts.setWebApp(true);

                host = getServletHost(configurator);

            } catch (ServletException e) {
                throw new ServiceRuntimeException(e);
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

*/
public class WebAppModuleActivator implements ModuleActivator {

    public void start(ExtensionPointRegistry extensionPointRegistry) {

        ServletHostExtensionPoint servletHosts =
            extensionPointRegistry.getExtensionPoint(ServletHostExtensionPoint.class);
       
        List<ServletHost> hosts = servletHosts.getServletHosts();
        if (isRunningInWebapp()) {
            if (hosts.size() > 0) {
                hosts.removeAll(hosts);
            }
            servletHosts.addServletHost(WebAppServletHost.getInstance());
        }
    }
View Full Code Here

        // Create the SCA node
        SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
        node = nodeFactory.createSCANodeFromURL(nodeConfiguration);
       
        // 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

        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 MessageFactory messageFactory;
    private Mediator mediator;
    private ServletHost servletHost;

    public AtomBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
        ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
        this.servletHost = servletHosts.getServletHosts().get(0);
        ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
        this.messageFactory = modelFactories.getFactory(MessageFactory.class);
        this.mediator = new MediatorImpl(extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class),
                                         extensionPoints.getExtensionPoint(TransformerExtensionPoint.class));
    }
View Full Code Here

    private MessageFactory messageFactory;
    private ServletHost servletHost;
   
    public HTTPBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
        ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
        this.servletHost = servletHosts.getServletHosts().get(0);
        ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
        messageFactory = modelFactories.getFactory(MessageFactory.class);
    }
View Full Code Here

                                            RuntimeComponentReference reference,
                                            DistributedSCABinding binding,
                                            ExtensionPointRegistry extensionPoints,
                                            Map<ClassLoader, List<PolicyHandlerTuple>> policyHandlerClassnames) {

        ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
        ServletHost servletHost = servletHosts.getServletHosts().get(0);
        ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
        DataBindingExtensionPoint dataBindings = extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class);

        this.component = component;
        this.reference = reference;
View Full Code Here

                                          RuntimeComponentService service,
                                          DistributedSCABinding binding,
                                          ExtensionPointRegistry extensionPoints,
                                          Map<ClassLoader, List<PolicyHandlerTuple>> policyHandlerClassnames) {

        ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
        ServletHost servletHost = servletHosts.getServletHosts().get(0);
        ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
        MessageFactory messageFactory = modelFactories.getFactory(MessageFactory.class);
        DataBindingExtensionPoint dataBindings = extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class);

        this.binding = binding.getSCABinding();
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

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.