Examples of Connector


Examples of org.apache.activemq.broker.Connector

            super.tearDown();
    }


    public void testSecureConnector() {
        Connector connector = new TransportConnector(sslTransportServer);
        connectionContext.setConnector(connector);
        connectionInfo.setTransportContext(new StubX509Certificate[] {});

        try {
            authBroker.addConnection(connectionContext, connectionInfo);
View Full Code Here

Examples of org.apache.catalina.Connector

    // Tell the embedded manager about the engine.
    //
    catEmbedded.addEngine(catEngine);
    InetAddress nullAddr = null;
    Connector connector = catEmbedded.createConnector(nullAddr, listeningPort,
        false);
    catEmbedded.addConnector(connector);

    // start up!
    catEmbedded.start();
View Full Code Here

Examples of org.apache.catalina.connector.Connector

   public void setNewSessionCookie(String sessionId, HttpServletResponse response)
   {
      if (response != null)
      {
         Context context = (Context) container_;
         Connector connector = ((Response) response).getConnector();
         if (context.getCookies())
         {
            // set a new session cookie
            Cookie cookie = new Cookie(Globals.SESSION_COOKIE_NAME, sessionId);
            // JBAS-6206. Configure cookie a la o.a.c.connector.Request.configureSessionCookie()
            cookie.setMaxAge(-1);
            if (context.getSessionCookie().getPath() != null)
            {
               cookie.setPath(context.getSessionCookie().getPath());
            }
            else
            {
               String contextPath = context.getEncodedPath();
               if ("".equals(contextPath))
               {
                  contextPath = "/";
               }
               cookie.setPath(contextPath);
            }
            if (context.getSessionCookie().getComment() != null)
            {
               cookie.setComment(context.getSessionCookie().getComment());
            }
            if (context.getSessionCookie().getDomain() != null)
            {
               cookie.setDomain(context.getSessionCookie().getDomain());
            }
            if (context.getSessionCookie().isHttpOnly())
            {
               cookie.setHttpOnly(true);
            }
            if (context.getSessionCookie().isSecure())
            {
               cookie.setSecure(true);
            }
            if (connector.getSecure())
            {
               cookie.setSecure(true);
            }

            if (trace_)
View Full Code Here

Examples of org.apache.catalina.connector.Connector

         {
            Iterator<ConnectorMetaData> connectorMetaDatas = serviceMetaData.getConnectors().iterator();
            while (connectorMetaDatas.hasNext())
            {
               ConnectorMetaData connectorMetaData = connectorMetaDatas.next();
               Connector connector = new Connector(connectorMetaData.getProtocol());
               if (connectorMetaData.getAttributes() != null)
               {
                  Iterator<QName> names = connectorMetaData.getAttributes().keySet().iterator();
                  while (names.hasNext())
                  {
                     QName name = names.next();
                     String value = (String) connectorMetaData.getAttributes().get(name);
                     // FIXME: This should be done by XB
                     value = StringPropertyReplacer.replaceProperties(value);
                     IntrospectionUtils.setProperty(connector, name.getLocalPart(), value);
                  }
               }
               if (executor != null)
               {
                  IntrospectionUtils.callMethod1(connector.getProtocolHandler(), "setExecutor",
                        executor, java.util.concurrent.Executor.class.getName(), getClass().getClassLoader());
               }
               service.addConnector(connector);
            }
         }
View Full Code Here

Examples of org.apache.catalina.connector.Connector

{
   public void test() throws Exception
   {
      MBeanServer server = getServer();
      ObjectName name = new ObjectName("jboss.web:type=Service,serviceName=jboss.web");
      Connector connector = new Connector("org.apache.coyote.memory.MemoryProtocolHandler");
      MemoryProtocolHandler handler = (MemoryProtocolHandler) connector.getProtocolHandler();
      server.invoke(name, "addConnector", new Object[] { connector }, new String[] { Connector.class.getName() });
      try
      {
         ByteChunk input = new ByteChunk(1024);
         ByteChunk output = new ByteChunk(1024);
         org.apache.coyote.Request req = new org.apache.coyote.Request();
         req.decodedURI().setString("/webbmtcleanuptest/test1.jsp");
         req.method().setString("GET");
         org.apache.coyote.Response resp = new org.apache.coyote.Response();
         handler.process(req, input, resp, output);
         if (resp.getStatus() != 200)
            throw new Error(output.toString());

         input = new ByteChunk(1024);
         output = new ByteChunk(1024);
         req = new org.apache.coyote.Request();
         req.decodedURI().setString("/webbmtcleanuptest/test2.jsp");
         req.method().setString("GET");
         resp = new org.apache.coyote.Response();
         handler.process(req, input, resp, output);
         if (resp.getStatus() != 200)
            throw new Error(output.toString());
      }
      finally
      {
         try
         {
            connector.stop();
         }
         finally
         {
            connector.destroy();
         }
      }
   }
View Full Code Here

Examples of org.apache.catalina.connector.Connector

        w.setLoadOnStartup(0);

        c.addChild(w);
        host.addChild(c);

        Connector connector = embedded.createConnector("127.0.0.1",port,Http11NioProtocol.class.getName());
        connector.setContainer(host);
        embedded.addEngine(engine);
        embedded.addConnector(connector);
        embedded.start();

        atmoServlet = (AtmosphereServlet) w.getServlet();
View Full Code Here

Examples of org.apache.catalina.connector.Connector

        //w.addInitParameter(CometSupport.MAX_INACTIVE, "20000");

        c.addChild(w);
        host.addChild(c);       

        Connector connector = embedded.createConnector("127.0.0.1",port,Http11NioProtocol.class.getName());
        connector.setContainer(host);
        embedded.addEngine(engine);
        embedded.addConnector(connector);
        embedded.start();
        atmoServlet = (AtmosphereServlet) w.getServlet();
View Full Code Here

Examples of org.apache.catalina.connector.Connector

        }

        tomcat = new TomcatWithFastSessionIDs();

        String protocol = getProtocol();
        Connector connector = new Connector(protocol);
        // Listen only on localhost
        connector.setAttribute("address",
                InetAddress.getByName("localhost").getHostAddress());
        // Use random free port
        connector.setPort(0);
        // Mainly set to reduce timeouts during async tests
        connector.setAttribute("connectionTimeout", "3000");
        tomcat.getService().addConnector(connector);
        tomcat.setConnector(connector);

        // Add AprLifecycleListener if we are using the Apr connector
        if (protocol.contains("Apr")) {
            StandardServer server = (StandardServer) tomcat.getServer();
            AprLifecycleListener listener = new AprLifecycleListener();
            listener.setSSLRandomSeed("/dev/urandom");
            server.addLifecycleListener(listener);
            connector.setAttribute("pollerThreadCount", Integer.valueOf(1));
        }

        File catalinaBase = getTemporaryDirectory();
        tomcat.setBaseDir(catalinaBase.getAbsolutePath());
        tomcat.getHost().setAppBase(appBase.getAbsolutePath());
View Full Code Here

Examples of org.apache.catalina.connector.Connector

    }

    public Connector createConnector(String address, int port,
             String protocol) {

        Connector connector = null;

  if (address != null) {
      /*
       * InetAddress.toString() returns a string of the form
       * "<hostname>/<literal_IP>". Get the latter part, so that the
       * address can be parsed (back) into an InetAddress using
       * InetAddress.getByName().
       */
      int index = address.indexOf('/');
      if (index != -1) {
    address = address.substring(index + 1);
      }
  }

  if (log.isDebugEnabled()) {
            log.debug("Creating connector for address='" +
          ((address == null) ? "ALL" : address) +
          "' port='" + port + "' protocol='" + protocol + "'");
  }

        try {

            if (protocol.equals("ajp")) {
                connector = new Connector("org.apache.jk.server.JkCoyoteHandler");
            } else if (protocol.equals("memory")) {
                connector = new Connector("org.apache.coyote.memory.MemoryProtocolHandler");
            } else if (protocol.equals("http")) {
                connector = new Connector();
            } else if (protocol.equals("https")) {
                connector = new Connector();
                connector.setScheme("https");
                connector.setSecure(true);
                connector.setProperty("SSLEnabled","true");
                // FIXME !!!! SET SSL PROPERTIES
            } else {
                connector = new Connector(protocol);
            }

            if (address != null) {
                IntrospectionUtils.setProperty(connector, "address",
                                               "" + address);
View Full Code Here

Examples of org.apache.geronimo.jee.connector.Connector

                    environment = plan.getEnvironment();
            }
        }
        else if (GeronimoUtils.isRARModule(module)) {
            if (getConnectorDeploymentPlan(module) != null) {
                Connector plan = getConnectorDeploymentPlan(module).getValue();
                if (plan != null)
                    environment = plan.getEnvironment();
            }
        }else if (GeronimoUtils.isAppClientModule(module)) {
            if (getAppClientDeploymentPlan(module) != null) {
                ApplicationClient plan = getAppClientDeploymentPlan(module).getValue();
                if (plan != null)
                    environment = plan.getServerEnvironment();
            }
        }

        Trace.tracePoint("Exit ", "DependencyHelper.getEnvironment", environment);
        return environment;
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.