Examples of Endpoint


Examples of kilim.nio.EndPoint

    public static class EchoServer extends SessionTask {
        @Override
        public void execute() throws Pausable, Exception {
            ByteBuffer buf = ByteBuffer.allocate(100);
            EndPoint ep = getEndPoint();
            while (true) {
                buf.clear();
                buf = ep.fillMessage(buf, 4, /*lengthIncludesItself*/ false);
                buf.flip();
                int strlen = buf.getInt();
                String s= new String(buf.array(), 4, strlen);
                //System.out.println ("Rcvd: " + s);
                if (!s.startsWith("Iteration #")) {
                    ep.close();
                    break;
                }
                buf.position(0); // reset read pos
                ep.write(buf); // echo.
                if (s.endsWith("DONE")) {
                    ep.close();
                    break;
                }
            }
        }
View Full Code Here

Examples of net.grinder.tools.tcpproxy.EndPoint

      File keyStoreFile = null;
      char[] keyStorePassword = null;
      String keyStoreType = null;
      boolean isHTTPProxy = true;
      boolean console = false;
      EndPoint chainedHTTPProxy = null;
      EndPoint chainedHTTPSProxy = null;
      int timeout = 0;
      boolean useColour = false;

      final FilterChain requestFilterChain = new FilterChain("request");
      final FilterChain responseFilterChain = new FilterChain("response");

      try {
        // Parse 1.
        for (int i = 0; i < args.length; i++) {
          if ("-properties".equalsIgnoreCase(args[i])) {
            final Properties properties = new Properties();
            final FileInputStream in = new FileInputStream(
                new File(args[++i]));
            try {
              properties.load(in);
            } finally {
              in.close();
            }
            System.getProperties().putAll(properties);
          }
        }

        // Parse 2.
        for (int i = 0; i < args.length; i++) {
          if ("-requestfilter".equalsIgnoreCase(args[i])) {
            requestFilterChain.add(args[++i]);
          } else if ("-responsefilter".equalsIgnoreCase(args[i])) {
            responseFilterChain.add(args[++i]);
          } else if ("-component".equalsIgnoreCase(args[i])) {
            final Class<?> componentClass;

            try {
              componentClass = Class.forName(args[++i]);
            } catch (ClassNotFoundException e) {
              throw barfError("Class '" + args[i]
                  + "' not found.");
            }
            m_filterContainer.addComponent(componentClass);
          } else if ("-http".equalsIgnoreCase(args[i])) {
            requestFilterChain.add(HTTPRequestFilter.class);
            responseFilterChain.add(HTTPResponseFilter.class);
            m_filterContainer
                .addComponent(AttributeStringParserImplementation.class);
            m_filterContainer.addComponent(ConnectionCache.class);
            m_filterContainer
                .addComponent(ConnectionHandlerFactoryImplementation.class);
            m_filterContainer
                .addComponent(HTTPRecordingImplementation.class);
            m_filterContainer
                .addComponent(ProcessHTTPRecordingWithXSLT.class);
            m_filterContainer
                .addComponent(RegularExpressionsImplementation.class);
            m_filterContainer
                .addComponent(URIParserImplementation.class);
            m_filterContainer
                .addComponent(SimpleStringEscaper.class);

            if (i + 1 < args.length && !args[i + 1].startsWith("-")) {
              final String s = args[++i];

              if ("oldjython".equals(s)) {
                // Default.
              } else if ("jython".equals(s)) {
                m_filterContainer
                    .addComponent(BuiltInStyleSheet.Jython);
              } else if ("clojure".equals(s)) {
                m_filterContainer
                    .addComponent(BuiltInStyleSheet.Clojure);
              } else {
                m_filterContainer
                    .addComponent(new StyleSheetFile(
                        new File(s)));
              }
            }
          } else if ("-localhost".equalsIgnoreCase(args[i])) {
            localHost = args[++i];
          } else if ("-localport".equalsIgnoreCase(args[i])) {
            localPort = Integer.parseInt(args[++i]);
          } else if ("-remotehost".equalsIgnoreCase(args[i])) {
            remoteHost = args[++i];
            isHTTPProxy = false;
          } else if ("-remoteport".equalsIgnoreCase(args[i])) {
            remotePort = Integer.parseInt(args[++i]);
            isHTTPProxy = false;
          } else if ("-ssl".equalsIgnoreCase(args[i])) {
            useSSLPortForwarding = true;
          } else if ("-keystore".equalsIgnoreCase(args[i])) {
            keyStoreFile = new File(args[++i]);
          } else if ("-keystorepassword".equalsIgnoreCase(args[i])
              || "-storepass".equalsIgnoreCase(args[i])) {
            keyStorePassword = args[++i].toCharArray();
          } else if ("-keystoretype".equalsIgnoreCase(args[i])
              || "-storetype".equalsIgnoreCase(args[i])) {
            keyStoreType = args[++i];
          } else if ("-timeout".equalsIgnoreCase(args[i])) {
            timeout = Integer.parseInt(args[++i]) * 1000;
          } else if ("-console".equalsIgnoreCase(args[i])) {
            console = true;
          } else if ("-colour".equalsIgnoreCase(args[i])
              || "-color".equalsIgnoreCase(args[i])) {
            useColour = true;
          } else if ("-properties".equalsIgnoreCase(args[i])) {
            /* Already handled */
            ++i;
          } else if ("-httpproxy".equalsIgnoreCase(args[i])) {
            chainedHTTPProxy = new EndPoint(args[++i],
                Integer.parseInt(args[++i]));
          } else if ("-httpsproxy".equalsIgnoreCase(args[i])) {
            chainedHTTPSProxy = new EndPoint(args[++i],
                Integer.parseInt(args[++i]));
          } else if ("-debug".equalsIgnoreCase(args[i])) {
            m_filterContainer
                .changeMonitor(new ConsoleComponentMonitor(
                    System.err));
          } else if ("-initialtest".equalsIgnoreCase(args[i])) {
            final String argument = i + 1 < args.length ? args[++i]
                : "123";
            throw barfError("-initialTest is no longer supported. "
                + "Use -DHTTPPlugin.initialTest=" + argument
                + " or the -properties option instead.");
          } else {
            throw barfUsage();
          }
        }
      } catch (FileNotFoundException fnfe) {
        throw barfError(fnfe.getMessage());
      } catch (IndexOutOfBoundsException e) {
        throw barfUsage();
      } catch (NumberFormatException e) {
        throw barfUsage();
      }

      if (timeout < 0) {
        throw barfError("Timeout must be non-negative.");
      }

      final EndPoint localEndPoint = new EndPoint(localHost, localPort);
      final EndPoint remoteEndPoint = new EndPoint(remoteHost, remotePort);

      if (chainedHTTPSProxy == null && chainedHTTPProxy != null) {
        chainedHTTPSProxy = chainedHTTPProxy;
      }

View Full Code Here

Examples of net.jini.jeri.Endpoint

          "Access to resolve local host denied");
        }
    }
    resolvedHost = localAddr.getHostAddress();
      }
      Endpoint result = createEndpoint(
    resolvedHost,
    checkCookie(listenContext.addListenEndpoint(listenEndpoint)));
      if (logger.isLoggable(Level.FINE)) {
    logger.log(Level.FINE,
         "enumerate listen endpoints for {0}\nreturns {1}",
View Full Code Here

Examples of org.apache.activemq.command.Endpoint

        bufferPool.stop();
    }

    public Command read() throws IOException {
        Command answer = null;
        Endpoint from = null;
        synchronized (readLock) {
            while (true) {
                readBuffer.clear();
                SocketAddress address = channel.receive(readBuffer);
View Full Code Here

Examples of org.apache.camel.Endpoint

            // This will override any URI supplied ?resourcePath=... param
            parameters.put(Olingo2Endpoint.RESOURCE_PATH_PROPERTY, resourcePath.toString());
        }

        final Olingo2Configuration endpointConfiguration = createEndpointConfiguration(Olingo2ApiName.DEFAULT);
        final Endpoint endpoint = createEndpoint(uri, methodName, Olingo2ApiName.DEFAULT, endpointConfiguration);

        // set endpoint property inBody
        setProperties(endpoint, parameters);

        // configure endpoint properties and initialize state
        endpoint.configureProperties(parameters);

        return endpoint;
    }
View Full Code Here

Examples of org.apache.cassandra.net.EndPoint

    }
    */

    private boolean isANeighbour(EndPoint neighbour)
    {
        EndPoint predecessor = storageService_.getPredecessor(StorageService.getLocalStorageEndPoint());
        if ( predecessor.equals(neighbour) )
            return true;

        EndPoint successor = storageService_.getSuccessor(StorageService.getLocalStorageEndPoint());
        if ( successor.equals(neighbour) )
            return true;

        return false;
    }
View Full Code Here

Examples of org.apache.cloudstack.engine.subsystem.api.storage.EndPoint

        if (getJobId() != null) {
            if (s_logger.isTraceEnabled()) {
                log("Sending progress command ", Level.TRACE);
            }
            try {
                EndPoint ep = _epSelector.select(sserver);
                ep.sendMessageAsync(new UploadProgressCommand(getCommand(), getJobId(), reqType), new Callback(ep.getId(), this));
            } catch (Exception e) {
                s_logger.debug("Send command failed", e);
                setDisconnected();
            }
        }
View Full Code Here

Examples of org.apache.cxf.endpoint.Endpoint

      dispatch = svc.createDispatch(mcf.getPortQName(), type, mode);
     
      if (mcf.getSecurityType() == WSManagedConnectionFactory.SecurityType.WSSecurity
          && mcf.getOutInterceptors() != null) {
        Client client = ((DispatchImpl)dispatch).getClient();
        Endpoint ep = client.getEndpoint();
        for (Interceptor i : mcf.getOutInterceptors()) {
          ep.getOutInterceptors().add(i);
        }
      }
    }
   
    if (mcf.getSecurityType() == WSManagedConnectionFactory.SecurityType.HTTPBasic){
View Full Code Here

Examples of org.apache.hadoop.fs.swift.auth.entities.Endpoint

      StringBuilder regionList = new StringBuilder();

      //these fields are all set together at the end of the operation
      URI endpointURI = null;
      URI objectLocation;
      Endpoint swiftEndpoint = null;
      AccessToken accessToken;

      for (Catalog catalog : serviceCatalog) {
        String name = catalog.getName();
        String type = catalog.getType();
        String descr = String.format("[%s: %s]; ", name, type);
        catList.append(descr);
        if (LOG.isDebugEnabled()) {
          LOG.debug("Catalog entry " + descr);
        }
        if (name.equals(SERVICE_CATALOG_SWIFT)
            || name.equals(SERVICE_CATALOG_CLOUD_FILES)
            || type.equals(SERVICE_CATALOG_OBJECT_STORE)) {
          //swift is found
          if (LOG.isDebugEnabled()) {
            LOG.debug("Found swift catalog as " + name + " => " + type);
          }
          //now go through the endpoints
          for (Endpoint endpoint : catalog.getEndpoints()) {
            String endpointRegion = endpoint.getRegion();
            URI publicURL = endpoint.getPublicURL();
            URI internalURL = endpoint.getInternalURL();
            descr = String.format("[%s => %s / %s]; ",
                                  endpointRegion,
                                  publicURL,
                                  internalURL);
            regionList.append(descr);
            if (LOG.isDebugEnabled()) {
              LOG.debug("Endpoint " + descr);
            }
            if (region == null || endpointRegion.equals(region)) {
              endpointURI = usePublicURL ? publicURL : internalURL;
              swiftEndpoint = endpoint;
              break;
            }
          }
        }
      }
      if (endpointURI == null) {
        String message = "Could not find swift service from auth URL "
                         + authUri
                         + " and region '" + region + "'. "
                         + "Categories: " + catList
                         + ((regionList.length() > 0) ?
                            ("regions: " + regionList)
                                                      : "No regions");
        throw new SwiftInvalidResponseException(message,
                                                SC_OK,
                                                "authenticating",
                                                authUri);

      }


      accessToken = access.getToken();
      String path = SWIFT_OBJECT_AUTH_ENDPOINT
                    + swiftEndpoint.getTenantId();
      String host = endpointURI.getHost();
      try {
        objectLocation = new URI(endpointURI.getScheme(),
                                 null,
                                 host,
View Full Code Here

Examples of org.apache.harmony.rmi.transport.Endpoint

                            RMIClientSocketFactory csf,
                            RMIServerSocketFactory ssf,
                            ObjID objId) {
        super();
        isLocal = true;
        ep = new Endpoint(port, csf, ssf);
        this.objId = objId;
    }
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.