Package java.rmi.activation

Examples of java.rmi.activation.ActivationGroupDesc$CommandEnvironment


           System.in,
           ActivationGroupInit.class.getClassLoader(),
           false, null, Collections.EMPTY_LIST);
      in.useCodebaseAnnotations();
      ActivationGroupID id  = (ActivationGroupID)in.readObject();
      ActivationGroupDesc desc = (ActivationGroupDesc)in.readObject();
      long incarnation = in.readLong();
      Class cl = RMIClassLoader.loadClass(desc.getLocation(),
            desc.getClassName());
      try {
    Method create =
        cl.getMethod("createGroup",
         new Class[]{ActivationGroupID.class,
               ActivationGroupDesc.class,
View Full Code Here


      props.put("javax.net.ssl.trustStore", testsrc + "keystore");
      props.put("java.security.policy",
          testsrc + "group.security.policy");
      props.put("java.security.auth.login.config", testsrc + "login");
      // can call registerGroup
      gid = sys.registerGroup(new ActivationGroupDesc(props, null));
      // can call getActivationGroupDesc
      ActivationGroupDesc gdesc = sys.getActivationGroupDesc(gid);
      // cannot call setActivationGroupDesc
      try {
    sys.setActivationGroupDesc(gid, gdesc);
    throw new RuntimeException(
           "client1 able to setActivationGroupDesc");
View Full Code Here

    public static class AsClient2 implements PrivilegedExceptionAction {
  public Object run() throws Exception {
      Security.verifyObjectTrust(sys, null, trustCtx);
      // cannot call registerGroup
      try {
    sys.registerGroup(new ActivationGroupDesc(null, null));
    throw new RuntimeException("client2 able to registerGroup");
      } catch (SecurityException e) {
      }
      // cannot call getActivationGroupDesc
      try {
    sys.getActivationGroupDesc(gid);
    throw new RuntimeException(
           "client2 able to getActivationGroupDesc");
      } catch (SecurityException e) {
      }
      CommandEnvironment env =
    new CommandEnvironment("foobar", new String[]{"-baz"});
      // can set java program to "foobar" and option "-baz"
      sys.setActivationGroupDesc(gid,
               new ActivationGroupDesc(null, env));
      env = new CommandEnvironment("baz", null);
      // cannot set java program to "baz"
      try {
    sys.setActivationGroupDesc(gid,
             new ActivationGroupDesc(null,
                   env));
    throw new RuntimeException(
       "client2 able to setActivationGroupDesc with program baz");
      } catch (SecurityException e) {
      }
      // cannot set java program to "foobar" and option "-foobar"
      env = new CommandEnvironment("foobar", new String[]{"-foobar"});
      try {
    sys.setActivationGroupDesc(gid,
             new ActivationGroupDesc(null, env));
    throw new RuntimeException(
     "client2 able to setActivationGroupDesc with option -foobar");
      } catch (SecurityException e) {
      }
      // 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 {
View Full Code Here

    Security.verifyObjectTrust(sys, null, trustCtx);
    throw new RuntimeException("nobody able to verify trust");
      } catch (ConnectIOException e) {
      }
      try {
    sys.registerGroup(new ActivationGroupDesc(null, null));
    throw new RuntimeException("nobody able to registerGroup");
      } catch (ConnectIOException e) {
      }
      try {
    sys.getActivationGroupDesc(gid);
    throw new RuntimeException(
           "nobody able to getActivationGroupDesc");
      } catch (ConnectIOException e) {
      }
      try {
    sys.setActivationGroupDesc(gid, new ActivationGroupDesc(null,
                  null));
    throw new RuntimeException(
           "nobody able to setActivationGroupDesc");
      } catch (ConnectIOException e) {
      }
View Full Code Here

     */
    public static class AsServer implements PrivilegedExceptionAction {
  public Object run() throws Exception {
      Security.verifyObjectTrust(sys, null, trustCtx);
      try {
    sys.registerGroup(new ActivationGroupDesc(null, null));
    throw new RuntimeException("server able to registerGroup");
      } catch (SecurityException e) {
      }
      try {
    sys.getActivationGroupDesc(gid);
    throw new RuntimeException(
           "server able to getActivationGroupDesc");
      } catch (SecurityException e) {
      }
      try {
    sys.setActivationGroupDesc(gid, new ActivationGroupDesc(null,
                  null));
    throw new RuntimeException(
           "server able to setActivationGroupDesc");
      } catch (SecurityException e) {
      }
View Full Code Here

  for (int i = 0; i < propValues.length; i += 2) {
      props.setProperty(propValues[i], propValues[i + 1]);
  }

  /* Create group description */
  ActivationGroupDesc groupDesc = new ActivationGroupDesc(props, cmd);

  /* Create the activation data -- configuration source and service ID */
  MarshalledObject data = new MarshalledObject(
      new ActivationData(
    (String[]) config.getEntry(
View Full Code Here

      = new CommandEnvironment(getServerCommand(),
                               getServerOptions());
  ActivationGroupID gid = null;
        try {
      gid = sys.registerGroup(
                new ActivationGroupDesc(getServerProperties(),
                            cmdToExecute));
       storeGroupID(getLog(), gid);
  } catch (Exception e) {
            try {
                if (gid != null) sys.unregisterGroup(gid);
View Full Code Here

TOP

Related Classes of java.rmi.activation.ActivationGroupDesc$CommandEnvironment

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.