Package net.jini.jeri

Examples of net.jini.jeri.BasicJeriExporter


 
            exporter = (Exporter)Config.getNonNullEntry(config,
          MERCURY, "serverExporter", Exporter.class,
    new ActivationExporter(
        activationID,
        new BasicJeriExporter(
            TcpServerEndpoint.getInstance(0),
      new BasicILFactory(), false, true)),
    activationID);
            if (initLogger.isLoggable(Level.CONFIG)) {
                initLogger.log(Level.CONFIG, "Activatable service exporter is: {0}",
          exporter);
      }   
  } else { //Get non-activatable configuration items
            exporter = (Exporter) Config.getNonNullEntry(config,
                MERCURY, "serverExporter", Exporter.class,
    new BasicJeriExporter(
        TcpServerEndpoint.getInstance(0),
        new BasicILFactory(), false, true));
            if (initLogger.isLoggable(Level.CONFIG)) {
                initLogger.log(Level.CONFIG,
    "Non-activatable service exporter is: {0}", exporter);   
View Full Code Here


      activationPrepared = true;
            exporter = (Exporter)Config.getNonNullEntry(config,
          TxnManager.MAHALO, "serverExporter", Exporter.class,
                new ActivationExporter(
        activationID,
                    new BasicJeriExporter(
      TcpServerEndpoint.getInstance(0),
      new BasicILFactory(), false, true)),
        activationID);
            if(initLogger.isLoggable(Level.CONFIG)) {
    initLogger.log(Level.CONFIG,
              "Activatable service exporter is: {0}", exporter);
      }
        } else {
            exporter = (Exporter) Config.getNonNullEntry(config,
                TxnManager.MAHALO, "serverExporter", Exporter.class,
                new BasicJeriExporter(
        TcpServerEndpoint.getInstance(0),
        new BasicILFactory(), false, true));
            if(initLogger.isLoggable(Level.CONFIG)) {
    initLogger.log(Level.CONFIG,
              "Non-activatable service exporter is: {0}", exporter);
View Full Code Here

    public Object run() throws Exception {
  ServerEndpoint se1 = SslServerEndpoint.getInstance(PORT);
  ServerEndpoint se2 = SslServerEndpoint.getInstance(HOST, PORT);
  InvocationLayerFactory ilf = new BasicILFactory();
  Exporter e1 = new BasicJeriExporter(se1, ilf);
  Exporter e2 = new BasicJeriExporter(se2, ilf);
  e1.export(new Remote() { });
  e2.export(new Remote() { });

  Thread.currentThread().sleep(5000);

  // If we got here, success. Otherwise an exception should
  // have been thrown. (IllegalArgumentException)
View Full Code Here

  public Listener() throws ConfigurationException, ExportException {
      exporter = (Exporter)
    Config.getNonNullEntry(config, BROWSER, "listenerExporter",
               Exporter.class,
               new BasicJeriExporter(
               TcpServerEndpoint.getInstance(0),
               new BasicILFactory(),
               false, false));
      proxy = (RemoteEventListener) exporter.export(this);
  }
View Full Code Here

   * Export non-DGC-enabled remote object (A0) on endpoint A.
   *
   * - DGC call to A should fail.
   */
  Remote implA0 = new Remote() { };
  Exporter expA0 = new BasicJeriExporter(seA, ilf, false, false);
  expA0.export(implA0);
  System.err.println("\t{A0}");

  System.err.print("DGC call to A ");
  verifyFailure(dgcA);

  /*
   * Export DGC-enabled remote object (B1) on endpoint B.
   *
   * - DGC call to A should still fail.
   * - DGC call to B should succeed.
   * - DGC call to B with foreign UUID class should fail.
   */
  Remote implB1 = new Remote() { };
  Exporter expB1 = new BasicJeriExporter(seB, ilf, true, false);
  expB1.export(implB1);
  System.err.println("\t{A0}\t{B1}");

  System.err.print("DGC call to A ");
  verifyFailure(dgcA);
  System.err.print("DGC call to B ");
  verifySuccess(dgcB);
  System.err.print("DGC call to B with foreign UUID class ");
  verifyFailureWithUuid(dgcB, foreignUuid);

  /*
   * Export DGC-enabled remote object (A1) on endpoint A.
   *
   * - DGC call to A should now succeed.
   */
  Remote implA1 = new Remote() { };
  Exporter expA1 = new BasicJeriExporter(seA, ilf, true, false);
  expA1.export(implA1);
  System.err.println("\t{A0,A1}\t{B1}");

  System.err.print("DGC call to A ");
  verifySuccess(dgcA);

  /*
   * Unexport A1.
   *
   * - DGC call to A should fail again.
   * - DGC call to B should still succeed.
   */
  expA1.unexport(true);
  System.err.println("\t{A0}\t{B1}");

  System.err.print("DGC call to A ");
  verifyFailure(dgcA);
  System.err.print("DGC call to B ");
  verifySuccess(dgcB);

  /*
   * Export non-DGC-enabled remote object (B0) on endpoint B, to
   * maintain listening on B.  Then clear reference to B1,
   * letting it become garbage collected.
   *
   * - DGC call to B should now fail.
   */

  Remote implB0 = new Remote() { };
  Exporter expB0 = new BasicJeriExporter(seB, ilf, false, false);
  expB0.export(implB0);
  System.err.println("\t{A0}\t{B0,B1}");

  implB1 = null;
  System.gc();
  Thread.sleep(3000);
View Full Code Here

  long connTimeout =
      Long.getLong("com.sun.jini.jeri.http.idleConnectionTimeout",
       DEFAULT_IDLE_CONNECTION_TIMEOUT).longValue();

  CountedSocketFactory csf = new CountedSocketFactory();
  Exporter exporter = new BasicJeriExporter(
      HttpServerEndpoint.getInstance(null, 0, csf, null),
      new BasicILFactory());
  EchoImpl impl = new EchoImpl();
  Echo stub = (Echo) exporter.export(impl);

  try {
      final int REPS = 3;
      for (int i = 0; i < REPS; i++) {
    if (stub.echo(i) != i) {
        throw new Error();
    }
      }

      int expectedSocketsCreated = (connTimeout > 0) ? 1 : REPS;
      if (csf.clientSocketsCreated != expectedSocketsCreated) {
    throw new Error(
        "wrong number of sockets created: " +
        csf.clientSocketsCreated + " instead of " +
        expectedSocketsCreated);
      }

      if (connTimeout > 0) {
    for (int i = 0; i < REPS; i++) {
        sleep(connTimeout);
        if (stub.echo(i) != i) {
      throw new Error();
        }
    }
    expectedSocketsCreated += REPS;
    if (csf.clientSocketsCreated != expectedSocketsCreated) {
        throw new Error(
      "wrong number of sockets created: " +
      csf.clientSocketsCreated + " instead of " +
      expectedSocketsCreated);
    }
      }
  } finally {
      exporter.unexport(true);
  }
    }
View Full Code Here

    Exporter getExporter(Configuration config)
  throws ConfigurationException
    {
  return (Exporter) Config.getNonNullEntry(
      config, NORM, "serverExporter", Exporter.class,
      new BasicJeriExporter(
    TcpServerEndpoint.getInstance(0), new BasicILFactory()));
    }
View Full Code Here

  ServerEndpoint se1 = KerberosServerEndpoint.getInstance(s, null, null,
                PORT);
  ServerEndpoint se2 = KerberosServerEndpoint.getInstance(s, null, HOST,
                PORT);
  InvocationLayerFactory ilf = new BasicILFactory();
  Exporter e1 = new BasicJeriExporter(se1, ilf, false, false);
  Exporter e2 = new BasicJeriExporter(se2, ilf, false, false);
  e1.export(new Remote() { });
  e2.export(new Remote() { });
    }
View Full Code Here

  try {
      LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
      System.err.println("created registry");

      Exporter exporterA =
    new BasicJeriExporter(TcpServerEndpoint.getInstance(0),
              new BasicILFactory(), true, false);
      Remote stubA = exporterA.export(obj);
      System.err.println("exported remote object once");

      Exporter exporterB =
    new BasicJeriExporter(TcpServerEndpoint.getInstance(0),
              new BasicILFactory(), true, false);
      Remote stubB = exporterB.export(obj);
      System.err.println("exported remote object twice");

      Exporter exporterC =
    new BasicJeriExporter(TcpServerEndpoint.getInstance(0),
              new BasicILFactory(), false, false);
      Remote stubC = exporterC.export(obj);
      System.err.println("exported remote object thrice");

      Registry registry = LocateRegistry.getRegistry(
    "", TestLibrary.REGISTRY_PORT);
View Full Code Here

      KerberosServerEndpoint serverEndpoint =
    KerberosServerEndpoint.getInstance(
    serverSubject, null, null, 0, null, null);
     
      serverExporter = new BasicJeriExporter(
    serverEndpoint,
    new BasicILFactory(
        new BasicMethodConstraints(serverConstraints),
        ServerPermission.class));
      server = new Server();
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.