Package net.jini.export

Examples of net.jini.export.Exporter


     * Initializes the server, assuming that the appropriate subject is in
     * effect.
     */
    protected void initAsSubject() throws Exception {
  /* Export the server */
  Exporter exporter = getExporter();
  serverProxy = (Hello) exporter.export(this);

  /* Create the smart proxy */
  Proxy smartProxy = Proxy.create(serverProxy);

  /* Get the discovery manager, for discovering lookup services */
 
View Full Code Here


 
  public Remote export() throws RemoteException {
      if (exportType.equals("default")) {
    stub = Activatable.exportObject(impl, id, 0);
      } else {
    Exporter uexporter;
    if (exportType.equals("basic")) {
        uexporter = new
      BasicJeriExporter(TcpServerEndpoint.getInstance(0),
            new BasicILFactory(),
            true, true);
View Full Code Here

   */
  System.setProperty("sun.rmi.dgc.client.gcInterval",
      String.valueOf(GC_INTERVAL));

  MarshalledObjectGet obj = new MarshalledObjectGet();
  Exporter exporter = null;

  try {
      exporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(0),
               new BasicILFactory(), true, true);
      Remote stub = exporter.export(obj);
      System.err.println("exported remote object");

      MarshalledObject mobj = new MarshalledObject(stub);
      Remote unmarshalledStub = (Remote) mobj.get();
      System.err.println("unmarshalled stub from marshalled object");

      synchronized (obj.lock) {
    obj.unreferencedInvoked = false;

    unmarshalledStub = null;
    System.gc();
    System.err.println("cleared unmarshalled stub");
    System.err.println("waiting for unreferenced() callback " +
           "(SHOULD happen)...");
    obj.lock.wait(TIMEOUT);

    if (obj.unreferencedInvoked) {
        // TEST PASSED
    } else {
        throw new RuntimeException(
      "TEST FAILED: unrefereced() not invoked after " +
      ((double) TIMEOUT / 1000.0) + " seconds");
    }
      }

      System.err.println("TEST PASSED");

  } catch (Exception e) {
      if (e instanceof RuntimeException) {
    throw (RuntimeException) e;
      } else {
    throw new RuntimeException(
        "TEST FAILED: unexpected exception: " + e.toString());
      }
  } finally {
      if (exporter != null) {
    exporter.unexport(true);
      }
  }
    }
View Full Code Here

  // Get the exporter

  /* What we use for the default (or in the default activatable case
   * what we make the underlying exporter).
   */
  final Exporter basicExporter =
      new BasicJeriExporter(TcpServerEndpoint.getInstance(0),
          new BasicILFactory(), false, true);
  if (activationID == null) {
      exporter = (Exporter)Config.getNonNullEntry(config,
    COMPONENT_NAME,  "serverExporter", Exporter.class,
View Full Code Here

    /**
     * Exports this instance.
     */
    public OrangeEcho export() throws Exception {
        Exporter exporter = null;
    Configuration c = QAConfig.getConfig().getConfiguration();
  // check for none cofiguration
  if (!(c instanceof com.sun.jini.qa.harness.QAConfiguration)) {
            exporter = QAConfig.getDefaultExporter();
  } else {
            exporter = (Exporter) c.getEntry("test",
                                             "reliabilityExporter",
                                             Exporter.class);
  }
  stub = (OrangeEcho) exporter.export(this);
  return stub;
    }
View Full Code Here

    /**
     * Exports this instance.
     */
    public Orange export() throws Exception {
        Exporter exporter = null;
    Configuration c = QAConfig.getConfig().getConfiguration();
  // check for none cofiguration
  if (!(c instanceof com.sun.jini.qa.harness.QAConfiguration)) {
            exporter = QAConfig.getDefaultExporter();
  } else {
            exporter = (Exporter) c.getEntry("test",
                                             "reliabilityExporter",
                                             Exporter.class);
  }
  stub = (Orange) exporter.export(this);
  return stub;
    }
View Full Code Here

    /**
     * Exports this instance.
     */
    public Apple export() throws Exception {
  Exporter exporter = null;
  Configuration c = QAConfig.getConfig().getConfiguration();
  // check for none cofiguration
  if (!(c instanceof com.sun.jini.qa.harness.QAConfiguration)) {
      exporter = QAConfig.getDefaultExporter();
  } else {
            exporter = (Exporter) c.getEntry("test",
                                             "reliabilityExporter",
                                             Exporter.class);
  }
  stub = (Apple) exporter.export(this);
  return stub;
    }
View Full Code Here

     *         If an error occured while trying to export this object.
     */
    public NotifyCounter(Entry template, long leaseTime)
            throws RemoteException {
  Configuration c = getConfiguration();
  Exporter exporter = QAConfig.getDefaultExporter();
  if (c instanceof com.sun.jini.qa.harness.QAConfiguration) {
      try {
    exporter = (Exporter) c.getEntry("test",
             "outriggerListenerExporter",
             Exporter.class);
      } catch (ConfigurationException e) {
    throw new RemoteException("Configuration Error", e);
      }
  }
  proxy = exporter.export(this);
        maxEvNum = 0;
        this.template = template;
        this.leaseTime = leaseTime;
    }
View Full Code Here

    public static void main(String[] args) throws Exception {
  System.err.println("\nRegression test for bug 4843268\n");

  Thread t = new Thread(new Runnable() {
      public void run() {
    Exporter exporter =
        new BasicJeriExporter(new BlockingListenServerEndpoint(),
            new BasicILFactory(), false, false);
    try {
        exporter.export(new Remote() { });
    } catch (ExportException e) {
        throw new Error(e);
    }
      }
  });
  t.setDaemon(true);
  t.start();
  synchronized (lock) {
      while (!blocking) {
    lock.wait();
      }
  }
  Exporter exporter =
      new BasicJeriExporter(TcpServerEndpoint.getInstance(0),
          new BasicILFactory(), false, false);
  exporter.export(new Remote() { });
  exporter.unexport(true);
  System.err.println("TEST PASSED");
    }
View Full Code Here

    private ArrayList notifications = new ArrayList();

    public TestEventListener05() throws RemoteException {
        Configuration c = getConfiguration();
        Exporter exporter = QAConfig.getDefaultExporter();
        if (c instanceof com.sun.jini.qa.harness.QAConfiguration) {
            try {
                exporter = (Exporter) c.getEntry("test",
                                                 "outriggerListenerExporter",
                                                 Exporter.class);
            } catch (ConfigurationException e) {
                throw new RemoteException("Configuration Error", e);
            }
        }
        proxy = exporter.export(this);
    }
View Full Code Here

TOP

Related Classes of net.jini.export.Exporter

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.