Package net.jini.jeri

Examples of net.jini.jeri.ServerEndpoint


               = new LookupDiscoveryManager(DiscoveryGroupManagement.NO_GROUPS,
                                            new LookupLocator[0], null,config);
        }

        /* Handle items and duties related to exporting this service. */
        ServerEndpoint endpoint = TcpServerEndpoint.getInstance(0);
        InvocationLayerFactory ilFactory = new BasicILFactory();
        Exporter defaultExporter = new BasicJeriExporter(endpoint,
                                                         ilFactory,
                                                         false,
                                                         true);
View Full Code Here


    }

    private static Ping export(String host, int port, Ping impl)
  throws ExportException, UnsupportedConstraintException
    {
  ServerEndpoint se = getServerEndpoint(host, port, new SF(), null);
  InvocationLayerFactory ilf =
      new BasicILFactory(null, null, PingImpl.class.getClassLoader());
  Exporter exporter = new BasicJeriExporter(se, ilf, false, false);
  return (Ping) exporter.export(impl);
    }
View Full Code Here

      }
  }
    }

    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

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

      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

 
  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

  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

      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

    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

  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

TOP

Related Classes of net.jini.jeri.ServerEndpoint

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.