Package net.jini.jeri

Examples of net.jini.jeri.BasicJeriExporter


      ReferenceQueue refQueue = new ReferenceQueue();
      Reference loaderRef = new WeakReference(loader, refQueue);
      System.err.println("created loader: " + loader);

      Thread.currentThread().setContextClassLoader(loader);
      exporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(0),
               new BasicILFactory(), true, true);
      exporter.export(obj);
      Thread.currentThread().setContextClassLoader(
    ClassLoader.getSystemClassLoader());
      System.err.println(
View Full Code Here


  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

  System.setProperty(
      "com.sun.jini.jeri.server.suppressStackTraces", "true");

  Exporter exporter =
      new BasicJeriExporter(TcpServerEndpoint.getInstance(0), new
          BasicILFactory(), true, true);

  try {
      verifySuppression((Pong) exporter.export(new Impl()));

      System.err.println(
    "TEST PASSED (server-side stack trace data suppressed)");
  } finally {
      try {
    exporter.unexport(true);
      } catch (Exception e) {
      }
  }
    }
View Full Code Here

    public static void main(String[] args) throws Exception {
 
  Remote impl = new UnmarshalUnexpectedException();
  Exporter exporter =
      new BasicJeriExporter(TcpServerEndpoint.getInstance(0),
          new TestILFactory(), false, true);
  RemoteInterface proxy = null;
 
  try {
      proxy = (RemoteInterface) exporter.export(impl);
      try {
    proxy.throwIt(new RuntimeException());
      } catch (RuntimeException e) {
    System.err.println("caught RuntimeException");
      }
      try {
    proxy.throwIt(new Error());
      } catch (ServerError e) {
    System.err.println("caught ServerError");
      }
      try {
    proxy.throwIt(new RemoteException());
      } catch (RemoteException e) {
    System.err.println("caught RemoteException");
      }
      try {
    proxy.throwIt(new IOException());
      } catch (UnexpectedException e) {
    System.err.println("caught UnexpectedException");
    if (e.getCause().getClass() != IOException.class) {
        throw new RuntimeException(
      "test failed; expected nested IOException, got " +
      e.getClass().toString());
    }
    System.err.println(
        "UnexpectedException has correct nested exception");
      }
      System.err.println("test passed");
  } finally {
      if (proxy != null) {
    exporter.unexport(true);
      }
  }
    }
View Full Code Here

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

  System.err.println("\nRegression test for RFE 4010355\n");

  Exporter exporter =
      new BasicJeriExporter(TcpServerEndpoint.getInstance(0),
          new BasicILFactory(), true, true);
 
  try {
      Ping stub = (Ping) exporter.export(new ServerStackTrace());

      StackTraceElement[] remoteTrace;
      try {
    __FOO__(stub);
    throw new RuntimeException("TEST FAILED: no exception caught");
      } catch (PingException e) {
    System.err.println(
        "trace of exception thrown by remote call:");
    e.printStackTrace();
    System.err.println();
    remoteTrace = e.getStackTrace();
      }

      int fooIndex = -1;
      int barIndex = -1;
      for (int i = 0; i < remoteTrace.length; i++) {
    StackTraceElement e = remoteTrace[i];
    if (e.getMethodName().equals("__FOO__")) {
        if (fooIndex != -1) {
      throw new RuntimeException("TEST FAILED: " +
          "trace contains more than one __FOO__");
        }
        fooIndex = i;
    } else if (e.getMethodName().equals("__BAR__")) {
        if (barIndex != -1) {
      throw new RuntimeException("TEST FAILED: " +
          "trace contains more than one __BAR__");
        }
        barIndex = i;
    }
      }
      if (fooIndex == -1) {
    throw new RuntimeException(
       "TEST FAILED: trace lacks client-side method __FOO__");
      }
      if (barIndex == -1) {
    throw new RuntimeException(
       "TEST FAILED: trace lacks server-side method __BAR__");
      }
      if (fooIndex < barIndex) {
    throw new RuntimeException(
       "TEST FAILED: trace contains client-side method __FOO__ " +
       "before server-side method __BAR__");
      }
      System.err.println("TEST PASSED");
  } finally {
      try {
    exporter.unexport(true);
      } catch (Exception e) {
      }
  }
    }
View Full Code Here

  Exporter exporter = null;
 
  try {
      System.err.println("Regression test for 5024489\n");

      exporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(0),
               new BasicILFactory());

      Remote impl = new Impl();
      Remote proxy = exporter.export(impl);
View Full Code Here

  public void ping() { }
    }

    public static void main(String[] args) throws Exception {
  Impl impl = new Impl();
  Exporter exporter = new BasicJeriExporter(
      TcpServerEndpoint.getInstance(null, 0, null,
            new DelayingServerSocketFactory()),
      new BasicILFactory());
  Ping stub = (Ping) exporter.export(impl);

  new Thread(new Unexporter(exporter)).start();

  try {
      stub.ping();
View Full Code Here

            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));
  system = new SystemImpl();
  systemExporter =
      getExporter(config, "systemExporter",
      new BasicJeriExporter(se, new SystemAccessILFactory(),
                false, true,
                   PhoenixConstants.ACTIVATION_SYSTEM_UUID));
  monitor = new MonitorImpl();
  monitorExporter =
      getExporter(config, "monitorExporter",
      new BasicJeriExporter(se, new AccessILFactory()));
  registry = new RegistryImpl();
  registryExporter =
      getExporter(config, "registryExporter", new RegistrySunExporter());
  monitorStub = (ActivationMonitor) monitorExporter.export(monitor);
  synchronized (activatorExporter) {
View Full Code Here

  };
  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);
  /*
   * Create this object early to avoid possible FuturePing
   * verification failure when new threads cannot be created.
   */
  FuturePing future = new FuturePing(proxy);
View Full Code Here

  };
  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);
  /*
   * Create another proxy that will use a different connection
   * than the first (SocketFactory does not override equals).
   */
  Ping proxy2 = (Ping) (new MarshalledInstance(proxy)).get(false);
View Full Code Here

TOP

Related Classes of net.jini.jeri.BasicJeriExporter

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.