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

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


    private ServletHost servletHost;
    private Map<ClassLoader, 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(ModelFactoryExtensionPoint.class);
        policyHandlerClassnames = PolicyHandlerDefinitionsLoader.loadPolicyHandlerClassnames();
View Full Code Here


    private TomcatServer server;

    public void start(ExtensionPointRegistry extensionPointRegistry) {

        // Register a Tomcat 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.
            server = AccessController.doPrivileged(new PrivilegedAction<TomcatServer>() {
                public TomcatServer run() {
                    return new TomcatServer(workScheduler);
                 }
            });       
            servletHosts.addServletHost(server);
        }
    }
View Full Code Here

    private MessageFactory messageFactory;
    private Mediator mediator;
    private ServletHost servletHost;

    public RSSBindingProviderFactory(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 Axis2BindingProviderFactory(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);
    }
View Full Code Here

   
    private MessageFactory messageFactory;
    private ServletHost servletHost;

    public Axis2SCABindingProviderFactory(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);
    }   
View Full Code Here

public class WebImplementationProviderFactory implements ImplementationProviderFactory<WebImplementation> {

    private ServletHost servletHost;

    public WebImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
        ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
        List<ServletHost> hosts = servletHosts.getServletHosts();
        if (!hosts.isEmpty()) {
            this.servletHost = hosts.get(0);
        }
    }
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();
        // Only add webapp host if no other host already registered (eg jetty in standalone)
        if (hosts != null && hosts.size() < 1) {
            hosts.add(new WebAppServletHost());
        }
    }
View Full Code Here

    }

    private static WebAppServletHost getServletHost(Node node) {
        NodeImpl nodeImpl = (NodeImpl)node;
        ExtensionPointRegistry eps = nodeImpl.getExtensionPoints();
        ServletHostExtensionPoint servletHosts = eps.getExtensionPoint(ServletHostExtensionPoint.class);
        List<ServletHost> hosts = servletHosts.getServletHosts();
        if (hosts == null || hosts.size() < 1) {
            throw new IllegalStateException("No ServletHost found");
        }
        ServletHost servletHost = hosts.get(0);
        if (!(servletHost instanceof WebAppServletHost)) {
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

    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.