Package java.rmi.activation

Examples of java.rmi.activation.ActivationID


     */
    public void run() throws Exception {
        FakeActivationGroup.setLogger(logger);
        ActivationSystem system = new FakeActivationSystem(logger);
        ActivationGroupID agid = new FakeActivationGroupID(logger, system);
        ActivationID aid;
        Exporter exporter;
        try {
            aid = new ActivationID(null);
            ActivationGroup.inactive(aid, null);
            throw new TestException(
                    "ActivationException should be thrown"
                     + " if group is not active");
        } catch (ActivationException t) {
            logger.log(Level.FINEST,
                    "ActivationException in case if group is not active");
        }
        Properties props = new Properties();
        ActivationGroupDesc gd = new ActivationGroupDesc(
            "com.sun.jini.test.spec.activation.util.FakeActivationGroup",
            null,
            null,
            props,
            null);
        java.rmi.activation.ActivationGroup ag =
                ActivationGroup.createGroup(agid, gd, 0);
        boolean [] cases = {true, false};
        for (int i = 0; i < cases.length; i++) {
          boolean result = cases[i];
          logger.log(Level.FINEST, "return case: " + result);
          for (int j = 0; j < cases.length; j++) {
            if (cases[j]) {
                exporter = null;
            } else {
                exporter = new FakeExporter(logger);
            }
            logger.log(Level.FINEST, "exporter: " + exporter);

            for (int k = 0; k < cases.length; k++) {
                if (cases[k]) {
                    aid = null;
                } else {
                    aid = new ActivationID(null);
                }
                logger.log(Level.FINEST, "ActivationID: " + aid);

              FakeActivationGroup.resetInactiveObjectTouch();
              FakeActivationGroup.setInactiveObjectReturn(result);
View Full Code Here


        int index = lockedIDs.indexOf(id);
        if (index < 0) {
      lockedIDs.add(id);
      return;
        }
        ActivationID lockedID =
      (ActivationID) lockedIDs.get(index);
        if (lockedID != id) {
      // don't wait on an id that won't be notified
      id = lockedID;
      continue;
View Full Code Here

    throw new RuntimeException(
           "client1 able to setActivationGroupDesc");
      } catch (SecurityException e) {
      }
      // can call registerObject
      ActivationID aid =
    sys.registerObject(new ActivationDesc(gid,
                  Impl.class.getName(),
                  null, null));
      // cannot call getProxyVerifier
      try {
    Security.verifyObjectTrust(aid, null, trustCtx);
    throw new RuntimeException(
           "client1 able to verifyObjectTrust");
      } catch (SecurityException e) {
      }
      // can call getActivationDesc
      ActivationDesc adesc = sys.getActivationDesc(aid);
      // cannot call setActivationDesc
      try {
    sys.setActivationDesc(aid, adesc);
    throw new RuntimeException(
           "client1 able to setActivationDesc");
      } catch (SecurityException e) {
      }
      // can call activate
      Service svc = (Service) aid.activate(false);
      // make the service (and hence the group) go inactive
      UID uid1 = svc.inactivate();
      // give the service and group time to go inactive
      Thread.sleep(15000);
      // check indirectly that group actually went away the first time
View Full Code Here

      }
      // can call setActivationGroupDesc to set to default
      sys.setActivationGroupDesc(gid,
               new ActivationGroupDesc(null, null));
      // can call registerObject
      ActivationID aid =
    sys.registerObject(new ActivationDesc(gid, "Foo", null, null));
      // cannot call activate
      try {
    aid.activate(false);
    throw new RuntimeException("client2 able to activate");
      } catch (SecurityException e) {
      }
      // can call getProxyVerifier
      Security.verifyObjectTrust(aid, null, trustCtx);
View Full Code Here

  throws ActivationException, RemoteException
    {
  if (exportType.equals("default")) {
      return Activatable.register(desc);
  } else {
      ActivationID id =
    ActivationGroup.getSystem().registerObject(desc);
      if (exportType.equals("basic")) {
    return createSecureProxy(id, desc);
      } else if (exportType.equals("jrmp")) {
    return createProxy(id, desc);
View Full Code Here

  /* Register the activation descriptor */
  ProxyPreparer actIdPreparer = (ProxyPreparer) config.getEntry(
      "com.sun.jini.example.hello.Server", "activationIdPreparer",
      ProxyPreparer.class, new BasicProxyPreparer());
  ActivationID aid = (ActivationID) actIdPreparer.prepareProxy(
      actSys.registerObject(actDesc));

  /* Activate the server */
  aid.activate(true);

  System.out.println("Activated server");
    }
View Full Code Here

     */
    public void run() throws Exception {
        int i;
        Object o;

        ActivationID aid = new FakeActivationID(logger);
        MethodSetProxy fup = new MethodSetProxy(logger);
        InvocationHandler handler2 = new ActivatableInvocationHandler(aid,
                fup);
        RemoteMethodSetInterface fakeProxy = (RemoteMethodSetInterface)
                Proxy.newProxyInstance(
                        RemoteMethodSetInterface.class.getClassLoader(),
                        new Class[] {RemoteMethodSetInterface.class},
                        handler2);
        ActivationID aid2 = new FakeActivationID(logger, fakeProxy, true);
        InvocationHandler handler = new ActivatableInvocationHandler(aid2,
                null);
        RemoteMethodSetInterface fi = (RemoteMethodSetInterface)
                Proxy.newProxyInstance(
                        RemoteMethodSetInterface.class.getClassLoader(),
View Full Code Here

    /**
     * This method performs all actions mentioned in class description.
     */
    public void run() throws Exception {
        // action step 1
        ActivationID aid = new FakeActivationID(logger);
        Exporter exporter = new FakeExporter(logger);
        ActivationExporter activationExporter =
                new ActivationExporter(aid, exporter);

        // action step 2
View Full Code Here

    /**
     * This method performs all actions mentioned in class description.
     */
    public void run() throws Exception {
        // action step 1
        ActivationID aid = new FakeActivationID(logger);
        Exporter exporter = new FakeExporter(logger);
        ActivationExporter activationExporter = new ActivationExporter(aid,
                exporter);
        // action step 2
        // action step 3
View Full Code Here

    /**
     * This method performs all actions mentioned in class description.
     */
    public void run() throws Exception {
        ActivationID aid = new FakeActivationID(logger);
        Exporter exporter = new FakeExporter(logger);
        ActivationExporter activationExporter =
          new ActivationExporter(aid, exporter);
        Remote fup = new MethodSetProxy(logger);
        Remote result = activationExporter.export(fup);
View Full Code Here

TOP

Related Classes of java.rmi.activation.ActivationID

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.