Examples of LocalConnector


Examples of org.mortbay.jetty.LocalConnector

    }
   
    public void testVirtualHostWildcard() throws Exception
    {
        Server server = new Server();
        LocalConnector connector = new LocalConnector();
        server.setConnectors(new Connector[] { connector });
       
        ContextHandler context = new ContextHandler("/");
       
        IsHandledHandler handler = new IsHandledHandler();
View Full Code Here

Examples of org.mortbay.jetty.LocalConnector

        }
    }

    private void checkWildcardHost(boolean succeed, Server server, String[] contextHosts, String[] requestHosts) throws Exception
    {
        LocalConnector connector = (LocalConnector)server.getConnectors()[0];
        ContextHandlerCollection handlerCollection = (ContextHandlerCollection)server.getHandler();
        ContextHandler context = (ContextHandler)handlerCollection.getHandlers()[0];
        IsHandledHandler handler = (IsHandledHandler)context.getHandler();

        context.setVirtualHosts(contextHosts);
        // trigger this manually; it's supposed to be called when adding the handler
        handlerCollection.mapContexts();
       
        for(int i = 0; i < requestHosts.length; ++i)
        {
            String host = requestHosts[i];
            connector.getResponses("GET / HTTP/1.1\n" + "Host: "+host+"\n\n");
            if(succeed)
                assertTrue("'"+host+"' should have been handled.",handler.isHandled());
            else
                assertFalse("'"+host + "' should not have been handled.", handler.isHandled());
            handler.reset();
View Full Code Here

Examples of org.mortbay.jetty.LocalConnector

        public void run()
        {
            try
            {
                LocalConnector connector = _tester.createLocalConnector();
                for (int i=0;i<NUM_LOOPS;i++)
                {
                    HttpTester request = new HttpTester();
                    HttpTester response = new HttpTester();
View Full Code Here

Examples of org.mortbay.jetty.LocalConnector

    public LocalConnector createLocalConnector()
        throws Exception
    {
        synchronized (this)
        {
            LocalConnector connector = new LocalConnector();
            _server.addConnector(connector);

            if (_server.isStarted())
                connector.start();

            return connector;
        }
    }
View Full Code Here

Examples of org.mortbay.jetty.LocalConnector

   
    protected void setUp() throws Exception
    {
        super.setUp();
        _server = new Server();
        _connector = new LocalConnector();
        _context = new Context(Context.SESSIONS|Context.SECURITY);
       
        _server.setSendServerVersion(false);
        _server.addConnector(_connector);
        _server.addHandler(_context);
View Full Code Here

Examples of org.mortbay.jetty.LocalConnector

     * A hack to work around the restrictive access of {@link HttpConnection#setCurrentConnection(HttpConnection)}
     */
    private class HttpConnection2 extends HttpConnection {
        HttpConnection2() {
            // some random value just to avoid NPE
            super(new LocalConnector(),null,server);
        }
View Full Code Here

Examples of org.mortbay.jetty.LocalConnector

     * A hack to work around the restrictive access of {@link HttpConnection#setCurrentConnection(HttpConnection)}
     */
    private class HttpConnection2 extends HttpConnection {
        HttpConnection2() {
            // some random value just to avoid NPE
            super(new LocalConnector(),null,server);
        }
View Full Code Here

Examples of org.mortbay.jetty.LocalConnector

     * A hack to work around the restrictive access of {@link HttpConnection#setCurrentConnection(HttpConnection)}
     */
    private class HttpConnection2 extends HttpConnection {
        HttpConnection2() {
            // some random value just to avoid NPE
            super(new LocalConnector(),null,server);
        }
View Full Code Here

Examples of org.mortbay.jetty.LocalConnector

     * A hack to work around the restrictive access of {@link HttpConnection#setCurrentConnection(HttpConnection)}
     */
    private class HttpConnection2 extends HttpConnection {
        HttpConnection2() {
            // some random value just to avoid NPE
            super(new LocalConnector(),null,server);
        }
View Full Code Here

Examples of org.mortbay.jetty.LocalConnector

        stop();
    }
   
    public void start() throws Exception
    {
        _connector = new LocalConnector() {
            public boolean isConfidential(Request request)
            {
                return _isSecure;
            }
        };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.