Examples of ServerEndpoint


Examples of net.jini.jeri.ServerEndpoint

      }
  }
    }

    public static void main(String[] args) throws Exception {
  ServerEndpoint sep = TcpServerEndpoint.getInstance(0);
  Endpoint ep = sep.enumerateListenEndpoints(new ListenContext() {
      public ListenCookie addListenEndpoint(ListenEndpoint lep)
    throws IOException
      {
    return lep.listen(new Dispatcher()).getCookie();
      }
View Full Code Here

Examples of net.jini.jeri.ServerEndpoint

  throws UnsupportedConstraintException
    {
  if (constraints == null) {
      constraints = InvocationConstraints.EMPTY;
  }
  ServerEndpoint ep = getServerEndpoint(null);
  checkIntegrity(ep.checkConstraints(constraints));
    }
View Full Code Here

Examples of net.jini.jeri.ServerEndpoint

      throw new NullPointerException();
  }
  if (constraints == null) {
      constraints = InvocationConstraints.EMPTY;
  }
  ServerEndpoint ep =
      getServerEndpoint(new PrearrangedServerSocketFactory(socket));
  ServerConnManagerImpl mgr = new ServerConnManagerImpl();
  endpointInternals.setServerConnManager(ep, mgr);

  ListenContextImpl lc = new ListenContextImpl();
  ep.enumerateListenEndpoints(lc);
  ServerConnection conn = mgr.getServerConnection();
  try {
      InputStream in = new BufferedInputStream(conn.getInputStream());
      OutputStream out = new BufferedOutputStream(conn.getOutputStream());
      InboundRequestHandle handle = conn.processRequestData(in, out);
View Full Code Here

Examples of net.jini.jeri.ServerEndpoint

 
  ActivationGroupID[] gids = (ActivationGroupID[])
      groupTable.keySet().toArray(
            new ActivationGroupID[groupTable.size()]);
  activator = new ActivatorImpl();
  ServerEndpoint se = TcpServerEndpoint.getInstance(PHOENIX_PORT);
  activatorExporter =
      getExporter(config, "activatorExporter",
      new BasicJeriExporter(se, new BasicILFactory(),
                false, true,
               PhoenixConstants.ACTIVATOR_UUID));
View Full Code Here

Examples of net.jini.jeri.ServerEndpoint

  if (System.getSecurityManager() == null) {
      System.setSecurityManager(new SecurityManager());
  }

  SSF ssf = new SSF();
  ServerEndpoint se = getServerEndpoint(ssf);
  ListenContext lc = new ListenContext() {
      public ListenCookie addListenEndpoint(ListenEndpoint le)
    throws IOException
      {
    return le.listen(new RequestDispatcher() {
        public void dispatch(InboundRequest r) { }
    }).getCookie();
      }
  };
  se.enumerateListenEndpoints(lc);

  synchronized (ssf) {
      long now, deadline = 0;
      while (!ssf.serverSocketClosed) {
    now = System.currentTimeMillis();
View Full Code Here

Examples of net.jini.jeri.ServerEndpoint

      public ServerSocket createServerSocket() throws IOException {
    return useNIO ? ServerSocketChannel.open().socket()
            : new ServerSocket();
      }
  };
  ServerEndpoint se =
      TcpServerEndpoint.getInstance(null, 0, sf, ssf);
  InvocationLayerFactory ilf =
      new BasicILFactory(null, null, PingImpl.class.getClassLoader());
  Exporter exporter = new BasicJeriExporter(se, ilf, false, false);
  Ping proxy = (Ping) exporter.export(impl);
View Full Code Here

Examples of net.jini.jeri.ServerEndpoint

    private static boolean testedInboundRequest = false;
    private static RuntimeException inboundRequestFailure = null;

    public static void main(String[] args) throws Exception {

  ServerEndpoint serverEndpoint = TcpServerEndpoint.getInstance(0);
  System.err.println("obtained server endpoint: " + serverEndpoint);

  String method = "ServerCapabilities.checkConstraints";
  System.err.println("\nTesting " + method + ":");
  for (Iterator i = testCases.entrySet().iterator(); i.hasNext();) {
      Map.Entry entry = (Map.Entry) i.next();
      InvocationConstraints c = (InvocationConstraints) entry.getKey();
      System.err.println("  trying: " + c);
      InvocationConstraints u = serverEndpoint.checkConstraints(c);
      System.err.println("returned: " + u);
      if (!entry.getValue().equals(u)) {
    throw new RuntimeException(
        "TEST FAILED: incorrect constraints returned by " +
        method);
      }
  }

  Endpoint endpoint =
      serverEndpoint.enumerateListenEndpoints(new ListenContext() {
    public ListenCookie addListenEndpoint(ListenEndpoint le)
        throws IOException
    {
        return le.listen(new RD()).getCookie();
    }
View Full Code Here

Examples of net.jini.jeri.ServerEndpoint

  ServerSocketFactory ssf = new AbstractServerSocketFactory() {
      public ServerSocket createServerSocket() throws IOException {
    return new ServerSocket();
      }
  };
  ServerEndpoint se =
      TcpServerEndpoint.getInstance("localhost", 0, sf, ssf);
  InvocationLayerFactory ilf =
      new BasicILFactory(null, null, PingImpl.class.getClassLoader());
  Exporter exporter = new BasicJeriExporter(se, ilf, false, false);
  Ping proxy = (Ping) exporter.export(impl);
View Full Code Here

Examples of net.jini.jeri.ServerEndpoint

      throw new RuntimeException("TEST FAILED: " +
    "local host name not looked up in name service");
  }
  System.err.println("Local host name is \"" + localName + "\"");

  final ServerEndpoint se = getServerEndpoint();
  final ListenContext lc = new ListenContext() {
      public ListenCookie addListenEndpoint(ListenEndpoint le)
    throws IOException
      {
    return le.listen(new RequestDispatcher() {
        public void dispatch(InboundRequest r) { }
    }).getCookie();
      }
  };

  /*
   * Verify that invoking enumerateListenEndpoints with
   * permission to resolve the local host name throws an
   * UnknownHostException that does contain the local host name
   * in its detail message.
   */
  System.err.println("Trying with permission:");
  try {
      se.enumerateListenEndpoints(lc);
      throw new RuntimeException("TEST FAILED");
  } catch (UnknownHostException e) {
      e.printStackTrace();
      String message = e.getMessage();
      if (message == null || message.indexOf(localName) == -1) {
    throw new RuntimeException("TEST FAILED: " +
        "exception message does not contain local host name");
      }
  }

  /*
   * Verify that invoking enumerateListenEndpoints without
   * permission to resolve the local host name throws an
   * UnknownHostException that does not contain the local host
   * name in its detail message.
   */
  System.err.println("Trying without permission:");
  AccessControlContext acc = new AccessControlContext(
      new ProtectionDomain[] { new ProtectionDomain(null, null) });
  try {
      AccessController.doPrivileged(new PrivilegedExceptionAction() {
    public Object run() throws IOException {
        se.enumerateListenEndpoints(lc);
        throw new RuntimeException("TEST FAILED");
    }
      }, acc);
  } catch (PrivilegedActionException pae) {
      IOException e = (IOException) pae.getCause();
View Full Code Here

Examples of org.rhq.enterprise.agent.AgentUtils.ServerEndpoint

                    agent.serverClockNotification(serverTime);
                }
            } else if (args.length > 2) {
                out.println(MSG.getMsg(AgentI18NResourceKeys.HELP_SYNTAX_LABEL, getSyntax()));
            } else {
                ServerEndpoint serverEndpoint = AgentUtils.getServerEndpoint(agent.getConfiguration(), args[1]);

                // use the generic client utility to issue the command
                RemoteCommunicator rc = agent.createServerRemoteCommunicator(serverEndpoint.transport,
                    serverEndpoint.namePort.address, serverEndpoint.namePort.port, serverEndpoint.transportParams);
                GenericCommandClient client = new GenericCommandClient(rc);
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.