Package com.sun.jini.start

Examples of com.sun.jini.start.SharedActivatableServiceDescriptor


    public void run(EnvCheck envCheck) {
        this.envCheck = envCheck;
  ServiceDescriptor[] d = envCheck.getDescriptors();
  for (int i = 0; i < d.length; i++) {
      if (d[i] instanceof SharedActivatableServiceDescriptor) {
    SharedActivatableServiceDescriptor sd =
        (SharedActivatableServiceDescriptor) d[i];
    checkDirectory(sd);
      }
  }
    }
View Full Code Here


        Configuration config) throws Exception
    {
        logger.entering(DestroySharedGroup.class.getName(), "destroy",
      new Object[] {Arrays.asList(srvArray), config} );
  Created created = null;
        SharedActivatableServiceDescriptor desc = null;
  ActivationSystem activationSystem = null;
     
        for (int i=0; i < srvArray.length; i++) {
      if (srvArray[i] instanceof SharedActivatableServiceDescriptor) {
                desc = (SharedActivatableServiceDescriptor)srvArray[i];
    activationSystem =
        ServiceStarter.getActivationSystem(
            desc.getActivationSystemHost(),
      desc.getActivationSystemPort(),
      config);
    try {
                    created = (Created)desc.create(config);
              if (created != null &&
            created.proxy instanceof SharedGroup) {
      // service proxy from create() is already prepared
            SharedGroup sg = (SharedGroup)created.proxy;
      try {
          sg.destroyVM();
                try {
                    File log = new File(desc.getSharedGroupLog());
                                FileSystem.destroy(log, true);
                } catch (Exception e) {
                                logger.log(Level.WARNING,
            "destroy.group.deletion", e);
                }
View Full Code Here

      String[] serviceConfigArgs =
    (String[]) optionsList.toArray(new String[optionsList.size()]);
      // if a sharedGroup does not exist for this service,
      // one will be created by getServiceSharedLogDir().
      // The check for the activation system being up is done there
      SharedActivatableServiceDescriptor desc =
    new SharedActivatableServiceDescriptor(
            getServiceCodebase(),
            getServicePolicyFile(),
            getServiceClasspath(),
            getServiceImpl(),
            getServiceSharedLogDir(),
            serviceConfigArgs,
            getServiceRestart(),
            getServiceActivationHost(),
            getServiceActivationPort());
                  
      // get starter config and preparer name now so it will
      // show up in the log
      Configuration starterConfig = getStarterConfiguration();
      getServicePreparerName();
      logServiceParameters(); // log debug output
      logOverrides(serviceConfigArgs);
      if (transformer != null) {
    desc = (SharedActivatableServiceDescriptor)
           transformer.transform(desc);
      }
      created = (SharedActivatableServiceDescriptor.Created)
          desc.create(starterConfig);
  } catch (ConfigurationException e) {
      throw new TestException("Configuration problem for "
                                   + serviceName, e);
  } catch (Exception e) {
      throw new TestException("Problem creating service for "
View Full Code Here

          new String[] {// server options
        "-ea",
    },
          sharedvm_props);

        SharedActivatableServiceDescriptor sasd =
            new SharedActivatableServiceDescriptor(
          "http://resendes:8080/mercury-dl.jar",
          "http://resendes:8086/policy.mercury",
          "http://resendes:8080/mercury.jar",
          "com.sun.jini.mercury.MailboxBogusImpl",
          sharedVmLog,
          new String[] {
        "http://resendes:8089/mercury_service_act.config"
    },
          true);

        SharedActivatableServiceDescriptor sasdWithExtras =
            new SharedActivatableServiceDescriptor(
          "http://resendes:8080/mercury-dl.jar",
          "http://resendes:8086/policy.mercury",
          "http://resendes:8080/mercury.jar",
          "com.sun.jini.mercury.MailboxBogusImpl",
          sharedVmLog,
          new String[] {
        "http://resendes:8089/mercury_service_act.config"
    },
                pp,
                pp,
          true,
                "localhost",
                1234);
               
        ServiceDescriptor[] serviceDescriptors =
      new ServiceDescriptor[] {
    // sasdWithExtras & nasdWithExtras not written because
                // default/recovered preparer and lifecycle objects won't match.
                nasdWithoutExtras,
    sharedvm,
    sasd
      };

        // Serialize service descriptors to a file
  FileOutputStream f = new FileOutputStream("tmp");   
  ObjectOutput oos = new ObjectOutputStream(f);   
  oos.writeObject(nasdWithExtras);   
         oos.writeObject(nasdWithoutExtras);   
  oos.writeObject(sharedvm);   
  oos.writeObject(sasd);   
  oos.writeObject(sasdWithExtras);   
        oos.writeObject(serviceDescriptors);   
  oos.flush();
  oos.close();
        logger.log(Level.INFO, "Wrote: " + nasdWithExtras);
        logger.log(Level.INFO, "Wrote: " + nasdWithoutExtras);       
        logger.log(Level.INFO, "Wrote: " + sharedvm);
        logger.log(Level.INFO, "Wrote: " + sasd);
        logger.log(Level.INFO, "Wrote: " + sasdWithExtras);
        logger.log(Level.INFO, "Wrote: " + Arrays.asList(serviceDescriptors));

        // Deserialize objects from a file.   
  FileInputStream in = new FileInputStream("tmp");   
  ObjectInputStream ois = new ObjectInputStream(in);   
  NonActivatableServiceDescriptor nasdWithExtras_r =
      (NonActivatableServiceDescriptor)ois.readObject();
  nasdWithExtras_r.setLifeCycle(lc);
        nasdWithExtras_r.setServicePreparer(pp);
  NonActivatableServiceDescriptor nasdWithoutExtras_r =
      (NonActivatableServiceDescriptor)ois.readObject();       
  SharedActivationGroupDescriptor sharedvm_r =
      (SharedActivationGroupDescriptor)ois.readObject();
  SharedActivatableServiceDescriptor sasd_r =
      (SharedActivatableServiceDescriptor)ois.readObject();
  SharedActivatableServiceDescriptor sasdWithExtras_r =
      (SharedActivatableServiceDescriptor)ois.readObject();
  //sasdWithExtras_r.setLifeCycle(lc);
        sasdWithExtras_r.setServicePreparer(pp);
        sasdWithExtras_r.setInnerProxyPreparer(pp);
  ServiceDescriptor[] recovered =
            (ServiceDescriptor[])ois.readObject();
  ois.close();
 
        logger.log(Level.INFO, "Read: " + nasdWithExtras_r);
        logger.log(Level.INFO, "Read: " + nasdWithoutExtras_r);
        logger.log(Level.INFO, "Read: " + sharedvm_r);
        logger.log(Level.INFO, "Read: " + sasd_r);
        logger.log(Level.INFO, "Read: " + sasdWithExtras_r);
        logger.log(Level.INFO, "Read: " + Arrays.asList(recovered));

  if (!verifyNonActivatableServiceDescriptors(nasdWithExtras, nasdWithExtras_r)) {
      throw new TestException(
          "Written and recovered NonActivatableServiceDescriptors don't match");
  }
  if (!verifyNonActivatableServiceDescriptors(nasdWithoutExtras, nasdWithoutExtras_r)) {
      throw new TestException(
          "Written and recovered NonActivatableServiceDescriptors don't match");
  }
        if (!verifySharedActivationGroupDescriptors(sharedvm, sharedvm_r)) {
      throw new TestException(
          "Written and recovered SharedActivationGroupDescriptors don't match");
  }
  if (!verifySharedActivatableServiceDescriptors(sasd, sasd_r)) {
      throw new TestException(
          "Written and recovered SharedActivatableServiceDescriptors don't match");
  }
  if (!verifySharedActivatableServiceDescriptors(sasdWithExtras, sasdWithExtras_r)) {
      throw new TestException(
          "Written and recovered SharedActivatableServiceDescriptors don't match");
  }
  if (!verifyServiceDescriptors(serviceDescriptors, recovered)) {
      throw new TestException(
          "Written and recovered ServiceDescriptor[] don't match");
  }
 
  //Do some negative tests - Ensure bad descriptor doesn't match
        NonActivatableServiceDescriptor bogus_nasd =
            new NonActivatableServiceDescriptor(
                nasdWithoutExtras.getExportCodebase(),
                nasdWithoutExtras.getPolicy(),
                nasdWithoutExtras.getImportCodebase(),
                nasdWithoutExtras.getImplClassName() + "_bogus",
                nasdWithoutExtras.getServerConfigArgs(),
          nasdWithoutExtras.getLifeCycle());
        if (verifyNonActivatableServiceDescriptors(bogus_nasd, nasdWithoutExtras)) {
      throw new TestException("Bogus NASD passed verification");
  }
  //Do some negative tests - Ensure setLifeCycle can't be called after creation
  try {
      nasdWithoutExtras.create(EmptyConfiguration.INSTANCE); //Original descriptor
  } catch (Exception e) {
            logger.log(Level.INFO, "exception creating NASD ... ignoring", e);
  }
  try {
      nasdWithoutExtras.setLifeCycle(lc);
  } catch (IllegalStateException ie) {
            logger.log(Level.INFO, "Expected exception setting NASD LifeCycle ... ignoring", ie);
  } catch (Exception e) {
      e.printStackTrace();
      throw new TestException("Unexpected exception: " + e);
  }
 
  try {
      nasdWithoutExtras_r.create(EmptyConfiguration.INSTANCE); //Recovered descriptor
  } catch (Exception e) {
            logger.log(Level.INFO, "exception creating recovered NASD ... ignoring", e);
  }
  try {
      nasdWithoutExtras_r.setLifeCycle(lc);
  } catch (IllegalStateException ie) {
            logger.log(Level.INFO, "Expected exception setting recovered NASD LifeCycle ... ignoring", ie);
  } catch (Exception e) {
      e.printStackTrace();
      throw new TestException("Unexpected exception: " + e);
  }

  //Do some negative tests - Ensure bad descriptor doesn't match
        SharedActivatableServiceDescriptor bogus_sasd =
            new SharedActivatableServiceDescriptor(
          sasd.getExportCodebase(),
          sasd.getPolicy(),
          sasd.getImportCodebase(),
          sasd.getImplClassName(),
          sasd.getSharedGroupLog() + "_bogus",
View Full Code Here

          + "] doesn't match written length [" + wrote.length + "]");
            return false;
  }
  for (int i=0; i < wrote.length; i++) {
      if (wrote[i] instanceof SharedActivatableServiceDescriptor) {
          SharedActivatableServiceDescriptor sasdw =
        (SharedActivatableServiceDescriptor)wrote[i];
          SharedActivatableServiceDescriptor sasdr =
        (SharedActivatableServiceDescriptor)read[i];
    if (!verifySharedActivatableServiceDescriptors(sasdw, sasdr)) {
        return false;
    }
      } else if (wrote[i] instanceof NonActivatableServiceDescriptor) {
View Full Code Here

        String config = null;
  config =
          ServiceStarterCreateBadTransientServiceTest.getServiceConfigFile().toString();
 

  SharedActivatableServiceDescriptor badCodebase =
            new SharedActivatableServiceDescriptor(
    codebase.replaceAll("mercury", "mercury-bogus"),
                policy,
                classpath,
                impl,
                sga.getSharedGroupLog().toString(),
                new String[] { config },
    true);
        try {
            Created created =
                (Created)badCodebase.create(EmptyConfiguration.INSTANCE);
      throw new TestException(
          "Created proxy: " + created.proxy
    + " with a badcodebase descriptor: " + badCodebase);
        } catch (UnmarshalException e) {
      logger.log(Level.INFO, "Expected Failure -- with a badcodebase descriptor: "
          + badCodebase);
            e.printStackTrace();
        }

  SharedActivatableServiceDescriptor badPolicy =
            new SharedActivatableServiceDescriptor(
                codebase,
                policy.replaceAll("policy", "policy_bogus"),
                classpath,
                impl,
                sga.getSharedGroupLog().toString(),
                new String[] { config },
    true);
        try {
            Created created =
                (Created)badPolicy.create(EmptyConfiguration.INSTANCE);
      throw new TestException(
          "Created proxy: " + created.proxy
    + " with a bad policy descriptor: " + badPolicy);
        } catch (ActivationException e) {
      logger.log(Level.INFO, "Expected Failure with a bad policy descriptor: "
          + badPolicy);
            e.printStackTrace();
        }

  SharedActivatableServiceDescriptor badClasspath =
            new SharedActivatableServiceDescriptor(
                codebase,
                policy,
                classpath.replaceAll("mercury", "mercury_bogus"),
                impl,
                sga.getSharedGroupLog().toString(),
                new String[] { config },
    true);
        try {
            Created created =
                (Created)badClasspath.create(EmptyConfiguration.INSTANCE);
      throw new TestException(
          "Created proxy: " + created.proxy
    + " with a bad classpath descriptor: " + badClasspath);
        } catch (ActivationException ae) {
      if (ae.getCause() instanceof ClassNotFoundException) {
          logger.log(Level.INFO,
        "Expected Failure with a bad classpath descriptor: "
              + badClasspath, ae);
      } else {
          logger.log(Level.INFO,
        "Unexpected Failure with a bad classpath descriptor: "
              + badClasspath);
          throw new TestException(
              "Unexpected exception"
        + " with a bad classpath descriptor: " + badClasspath, ae);
      }
        }

  SharedActivatableServiceDescriptor badImpl =
            new SharedActivatableServiceDescriptor(
                codebase,
                policy,
                classpath,
                impl.replaceAll("Impl", "Impl_bogus"),
                sga.getSharedGroupLog().toString(),
                new String[] { config },
    true);
        try {
            Created created =
                (Created)badImpl.create(EmptyConfiguration.INSTANCE);
      throw new TestException(
          "Created proxy: " + created.proxy
    + " with a bad impl descriptor: " + badImpl);
        } catch (ActivationException ae) {
      if (ae.getCause() instanceof ClassNotFoundException) {
          logger.log(Level.INFO,
        "Expected Failure with a bad impl descriptor: "
              + badImpl, ae);

      } else {
          logger.log(Level.INFO,
        "Unexpected Failure with a bad impl descriptor: "
              + badImpl);
          throw new TestException(
              "Unexpected exception"
        + " with a bad impl descriptor: " + badImpl, ae);
      }
        }

  SharedActivatableServiceDescriptor badLog =
            new SharedActivatableServiceDescriptor(
                codebase,
                policy,
                classpath,
                impl,
                sga.getSharedGroupLog().toString() + "bogus",
                new String[] { config },
    true);
        try {
            Created created =
                (Created)badLog.create(EmptyConfiguration.INSTANCE);
      throw new TestException(
          "Created proxy: " + created.proxy
    + " with a bad log descriptor: " + badLog);
        } catch (IOException e) {
      logger.log(Level.INFO, "Expected Failure with a bad log descriptor: "
          + badLog, e);
        }

  SharedActivatableServiceDescriptor badConfig =
            new SharedActivatableServiceDescriptor(
                codebase,
                policy,
                classpath,
                impl,
                sga.getSharedGroupLog().toString(),
                new String[] { sga.getSharedGroupLog().toString() },
    true);
        try {
            Created created =
                (Created)badConfig.create(EmptyConfiguration.INSTANCE);
      throw new TestException(
          "Created proxy: " + created.proxy
    + " with a bad config descriptor: " + badConfig);
        } catch (ActivationException e) {
      logger.log(Level.INFO, "Expected Failure with a bad config descriptor: "
View Full Code Here

      }
  }

  for (int i=0; i < goodArgsList.length; i++) {
      try {
    SharedActivatableServiceDescriptor tsd =
        (SharedActivatableServiceDescriptor)
      cons.newInstance(goodArgsList[i]);
    if (!checkArgs(goodArgsList[i], tsd)) {
              throw new TestException(
                        "Failed -- check args");
View Full Code Here

   
    private static ProxyPreparer pp = new BasicProxyPreparer();

    public void run() throws Exception {

        SharedActivatableServiceDescriptor sasd =
      new SharedActivatableServiceDescriptor(
    cb, pol, cp, impl, logDir, confArgs, restart);

  logger.log(Level.INFO, "Sasd w/ null config args: {0}", sasd);
    }
View Full Code Here

  for (int i=0; i < goodArgsList.length; i++) {
      try {
             logger.log(Level.FINEST, "Trying good args: {0}",
        Arrays.asList(goodArgsList[i]));
                SharedActivatableServiceDescriptor tsd =
        (SharedActivatableServiceDescriptor)
      cons.newInstance(goodArgsList[i]);
    if (!checkMainArgs(goodArgsList[i], tsd)) {
              throw new TestException(
      "Failed -- check main args");
    }
                if (!checkRestart((Boolean)goodArgsList[i][8], tsd)) {
              throw new TestException(
      "Failed -- check restart flag");
    }
                if (!checkInnerProxyPreparer((ProxyPreparer)goodArgsList[i][6], tsd)) {
              throw new TestException(
      "Failed -- check inner proxy preparer");
    }
                if (!checkServicePreparer((ProxyPreparer)goodArgsList[i][7], tsd)) {
              throw new TestException(
      "Failed -- check service proxy preparer");
    }
                if (!checkHost((String)goodArgsList[i][9], tsd)) {
              throw new TestException(
      "Failed -- check activation host");
    }
                if (!checkPort((Integer)goodArgsList[i][10], tsd)) {
              throw new TestException(
      "Failed -- check activation port");
    }
       } catch (Exception e) {
          throw new TestException(
        "Failed -- failed good args: ["
        + i + "] ", e);
      }
  }

       // Excercise alternate constructor       
        consArgs = new Class[] {
      String.class, String.class, String.class, String.class,
      String.class, String[].class, boolean.class, String.class,
            int.class};
  cons = null;
  cons = SharedActivatableServiceDescriptor.class.getConstructor(
        consArgs);
       
        logger.log(Level.FINEST,
            "Trying constructor that takes the following args: {0}",
            Arrays.asList(consArgs));
        //Test bad args
        ArrayList list = new ArrayList();
  for (int i=0; i < badArgsList.length; i++) {
      try {
                list.clear();
                list.add(0, badArgsList[i][0]);
                list.add(1, badArgsList[i][1]);
                list.add(2, badArgsList[i][2]);
                list.add(3, badArgsList[i][3]);
                list.add(4, badArgsList[i][4]);
                list.add(5, badArgsList[i][5]);
                list.add(6, badArgsList[i][8]);
                list.add(7, badArgsList[i][9]);
                list.add(8, badArgsList[i][10]);
             logger.log(Level.FINEST, "Trying bad args: {0}", list);
                cons.newInstance(list.toArray());
          throw new TestException(
        "Failed -- took bad args: " + i);
      } catch (java.lang.reflect.InvocationTargetException e) {
    Throwable t = e.getCause();
    if (t instanceof NullPointerException) {
        logger.log(Level.FINEST,
            "Got expected NullPointerException", t);
    } else {
        logger.log(Level.FINEST,
      "Got unexpected Exception", t);
        throw e;
    }
      }
  }

  for (int i=0; i < goodArgsList.length; i++) {
      try {
                list.clear();
                list.add(0, goodArgsList[i][0]);
                list.add(1, goodArgsList[i][1]);
                list.add(2, goodArgsList[i][2]);
                list.add(3, goodArgsList[i][3]);
                list.add(4, goodArgsList[i][4]);
                list.add(5, goodArgsList[i][5]);
                list.add(6, goodArgsList[i][8]);
                list.add(7, goodArgsList[i][9]);
                list.add(8, goodArgsList[i][10]);
             logger.log(Level.FINEST, "Trying good args: {0}", list);
                Object[] args = list.toArray();
                SharedActivatableServiceDescriptor tsd =
        (SharedActivatableServiceDescriptor)
      cons.newInstance(args);
    if (!checkMainArgs(args, tsd)) {
              throw new TestException(
      "Failed -- check main args");
    }
                if (!checkRestart((Boolean)args[6], tsd)) {
              throw new TestException(
      "Failed -- check restart flag");
    }
                if (!checkHost((String)args[7], tsd)) {
              throw new TestException(
      "Failed -- check activation host");
    }
                if (!checkPort((Integer)args[8], tsd)) {
              throw new TestException(
      "Failed -- check activation port");
    }
       } catch (Exception e) {
          throw new TestException(
        "Failed -- failed good args: ["
        + i + "] ", e);
      }
  }
       // Excercise alternate constructor       
        consArgs = new Class[] {
      String.class, String.class, String.class, String.class,
      String.class, String[].class, ProxyPreparer.class,
            ProxyPreparer.class, boolean.class};
  cons = null;
  cons = SharedActivatableServiceDescriptor.class.getConstructor(
        consArgs);
       
        logger.log(Level.FINEST,
            "Trying constructor that takes the following args: {0}",
            Arrays.asList(consArgs));
        //Test bad args
        list = new ArrayList();
  for (int i=0; i < badArgsList.length; i++) {
      try {
                list.clear();
                list.add(0, badArgsList[i][0]);
                list.add(1, badArgsList[i][1]);
                list.add(2, badArgsList[i][2]);
                list.add(3, badArgsList[i][3]);
                list.add(4, badArgsList[i][4]);
                list.add(5, badArgsList[i][5]);
                list.add(6, badArgsList[i][6]);
                list.add(7, badArgsList[i][7]);
                list.add(8, badArgsList[i][8]);
             logger.log(Level.FINEST, "Trying bad args: {0}", list);
                cons.newInstance(list.toArray());
          throw new TestException(
        "Failed -- took bad args: " + i);
      } catch (java.lang.reflect.InvocationTargetException e) {
    Throwable t = e.getCause();
    if (t instanceof NullPointerException) {
        logger.log(Level.FINEST,
            "Got expected NullPointerException", t);
    } else {
        logger.log(Level.FINEST,
      "Got unexpected Exception", t);
        throw e;
    }
      }
  }

  for (int i=0; i < goodArgsList.length; i++) {
      try {
                list.clear();
                list.add(0, goodArgsList[i][0]);
                list.add(1, goodArgsList[i][1]);
                list.add(2, goodArgsList[i][2]);
                list.add(3, goodArgsList[i][3]);
                list.add(4, goodArgsList[i][4]);
                list.add(5, goodArgsList[i][5]);
                list.add(6, goodArgsList[i][6]);
                list.add(7, goodArgsList[i][7]);
                list.add(8, goodArgsList[i][8]);
             logger.log(Level.FINEST, "Trying good args: {0}", list);
                Object[] args = list.toArray();
                SharedActivatableServiceDescriptor tsd =
        (SharedActivatableServiceDescriptor)
      cons.newInstance(args);
    if (!checkMainArgs(args, tsd)) {
              throw new TestException(
      "Failed -- check main args");
    }
                if (!checkRestart((Boolean)args[8], tsd)) {
              throw new TestException(
      "Failed -- check restart flag");
    }
                if (!checkInnerProxyPreparer((ProxyPreparer)args[6], tsd)) {
              throw new TestException(
      "Failed -- check inner proxy preparer");
    }
                if (!checkServicePreparer((ProxyPreparer)args[7], tsd)) {
              throw new TestException(
      "Failed -- check service proxy preparer");
    }       } catch (Exception e) {
          throw new TestException(
        "Failed -- failed good args: ["
        + i + "] ", e);
      }
  }
       // Excercise alternate constructor       
        consArgs = new Class[] {
      String.class, String.class, String.class, String.class,
      String.class, String[].class, boolean.class};
  cons = null;
  cons = SharedActivatableServiceDescriptor.class.getConstructor(
        consArgs);
       
        logger.log(Level.FINEST,
            "Trying constructor that takes the following args: {0}",
            Arrays.asList(consArgs));
        //Test bad args
        list = new ArrayList();
  for (int i=0; i < badArgsList.length; i++) {
      try {
                list.clear();
                list.add(0, badArgsList[i][0]);
                list.add(1, badArgsList[i][1]);
                list.add(2, badArgsList[i][2]);
                list.add(3, badArgsList[i][3]);
                list.add(4, badArgsList[i][4]);
                list.add(5, badArgsList[i][5]);
                list.add(6, badArgsList[i][8]);
             logger.log(Level.FINEST, "Trying bad args: {0}", list);
                cons.newInstance(list.toArray());
          throw new TestException(
        "Failed -- took bad args: " + i);
      } catch (java.lang.reflect.InvocationTargetException e) {
    Throwable t = e.getCause();
    if (t instanceof NullPointerException) {
        logger.log(Level.FINEST,
            "Got expected NullPointerException", t);
    } else {
        logger.log(Level.FINEST,
      "Got unexpected Exception", t);
        throw e;
    }
      }
  }

  for (int i=0; i < goodArgsList.length; i++) {
      try {
                list.clear();
                list.add(0, goodArgsList[i][0]);
                list.add(1, goodArgsList[i][1]);
                list.add(2, goodArgsList[i][2]);
                list.add(3, goodArgsList[i][3]);
                list.add(4, goodArgsList[i][4]);
                list.add(5, goodArgsList[i][5]);
                list.add(6, goodArgsList[i][8]);
             logger.log(Level.FINEST, "Trying good args: {0}", list);
                Object[] args = list.toArray();
                SharedActivatableServiceDescriptor tsd =
        (SharedActivatableServiceDescriptor)
      cons.newInstance(args);
    if (!checkMainArgs(args, tsd)) {
              throw new TestException(
      "Failed -- check main args");
View Full Code Here

        String config = null;
  config =
      ServiceStarterCreateBadTransientServiceTest.getServiceConfigFile().toString();
 

  SharedActivatableServiceDescriptor antiMercuryInnerProxy =
            new SharedActivatableServiceDescriptor(
    codebase,
                policy,
                classpath,
                act_impl,
                sga.getSharedGroupLog().toString(),
                new String[] { config },
    antiMercuryProxyPreparer,
    noOpProxyPreparer,
    true);
        try {
            SharedActivatableServiceDescriptor.Created created =
                (SharedActivatableServiceDescriptor.Created)antiMercuryInnerProxy.create(
        EmptyConfiguration.INSTANCE);
      throw new TestException(
          "Created proxy: " + created.proxy
    + " with a bad inner proxy descriptor: "
    + antiMercuryInnerProxy);
        } catch (Exception e) {
      logger.log(Level.INFO,
    "Caught failure -- with a bad inner proxy descriptor: "
          + e);
            e.printStackTrace();
      if (!antiMercuryException.equals(e)) {
          throw new TestException("Caught unexpected exception");
      } else {
          logger.log(Level.INFO,
        "Expected failure caught.");
      }
        }

  config =
      ServiceStarterCreateBadTransientServiceTest.getServiceConfigFile().toString();
  SharedActivatableServiceDescriptor antiMercuryOuterProxy =
            new SharedActivatableServiceDescriptor(
    codebase,
                policy,
                classpath,
                act_impl,
                sga.getSharedGroupLog().toString(),
                new String[] { config },
    noOpProxyPreparer,
                antiMercuryProxyPreparer,
    true);
        try {
            SharedActivatableServiceDescriptor.Created created =
                (SharedActivatableServiceDescriptor.Created)antiMercuryOuterProxy.create(
        EmptyConfiguration.INSTANCE);
      throw new TestException(
          "Created proxy: " + created.proxy
    + " with a bad outer proxy descriptor: "
    + antiMercuryOuterProxy);
        } catch (Exception e) {
      logger.log(Level.INFO,
    "Caught failure -- with a bad outer proxy descriptor: "
          + e);
            e.printStackTrace();
      if (!antiMercuryException.equals(e)) {
          throw new TestException("Caught unexpected exception");
      } else {
          logger.log(Level.INFO,
        "Expected failure caught.");
      }
        }

  config =
      ServiceStarterCreateBadTransientServiceTest.getServiceConfigFile().toString();
  SharedActivatableServiceDescriptor antiMercuryInnerOuterProxy =
            new SharedActivatableServiceDescriptor(
    codebase,
                policy,
                classpath,
                act_impl,
                sga.getSharedGroupLog().toString(),
                new String[] { config },
    antiMercuryProxyPreparer,
                antiMercuryProxyPreparer,
    true);
        try {
            SharedActivatableServiceDescriptor.Created created =
                (SharedActivatableServiceDescriptor.Created)antiMercuryInnerOuterProxy.create(
        EmptyConfiguration.INSTANCE);
      throw new TestException(
          "Created proxy: " + created.proxy
    + " with a bad inner-outer proxy descriptor: "
    + antiMercuryInnerOuterProxy);
View Full Code Here

TOP

Related Classes of com.sun.jini.start.SharedActivatableServiceDescriptor

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.