Package com.sun.jini.tool.envcheck.Reporter

Examples of com.sun.jini.tool.envcheck.Reporter.Message


      envCheck.launch(null, gd, taskName("GetGroupLoginConfigs"));
  if (lobj instanceof Throwable) {
      handleUnexpectedSubtaskReturn(lobj, source);
      return;
  }
  Message message;
  ArrayList configs = (ArrayList) lobj;
  if (configs.size() == 0) {
      message = new Message(Reporter.WARNING,
          getString("noconfigfiles"),
          getString("loginConfigExp"));
      Reporter.print(message, source);
  }
  for (int i = 0; i < configs.size(); i += 2) {
      String errorMsg;
      String desc = (String) configs.get(i + 1);
      if (configs.get(i) instanceof URL) {
    URL url = (URL) configs.get(i);
    errorMsg = Util.checkURL(url, desc);
      } else {
    errorMsg = (String) configs.get(i);
      }
      if (errorMsg == null) {
    message = new Message(Reporter.INFO,
              getString("loginconfigOK"),
              getString("loginConfigExp"));
      } else {
    message = new Message(Reporter.ERROR,
              errorMsg,
              getString("loginConfigExp"));
      }
      Reporter.print(message, source + " " + desc);
  }
  lobj = envCheck.launch(null, gd, taskName("CheckLoginConfigInit"));
  if (lobj == null) {
      message = new Message(Reporter.INFO,
          getString("loginInitOK"),
          getString("loginConfigExp"));
      Reporter.print(message, source);
  } else {
      Throwable cause = ((Throwable) lobj).getCause();
      if (cause instanceof IOException) {
    message = new Message(Reporter.INFO,
              getString("loginInitBad"),
              cause,
              getString("loginConfigExp"));
    Reporter.print(message, source);
      } else // unexpected exception
View Full Code Here


           String source) {
 
  Properties p = (gd == null ? System.getProperties()
                 : gd.getServerProperties());
  if (p == null || p.getProperty(propName) == null) {
      Message message =
    new Message(Reporter.WARNING,
          getString("noprop", propName, desc),
          getString("configExp", desc, propName));
      Reporter.print(message, source);
      return false;
  }
View Full Code Here

     */
    private void checkProvider(SharedActivationGroupDescriptor gd) {
  String source = getSource(gd);
  Object lobj = envCheck.launch(null, gd, taskName("CheckProviderTask"));
  if (lobj instanceof Boolean) {
      Message message;
      if (((Boolean) lobj).booleanValue()) {
    message = new Message(Reporter.INFO,
              getString("providerOK"),
              getString("providerExp"));
      } else {
    message = new Message(Reporter.WARNING,
              getString("providerBad"),
              getString("providerExp"));
      }
      Reporter.print(message, source);
  } else {
View Full Code Here

  String source = getString("descfor", d.getImplClassName());
  Object o = envCheck.launch(d, gd, taskName("GetEntriesTask"));
  if (o instanceof String[]) {
      checkEntries((String[]) o, d, source);
  } else if (o instanceof String) {
      Message message = new Message(Reporter.WARNING,
            (String) o,
            getString("dirExp"));
      Reporter.print(message, source);
  } else {
      handleUnexpectedSubtaskReturn(o, source);
View Full Code Here

    private void checkEntries(String[] entries,
            SharedActivatableServiceDescriptor d,
            String source)
    {
  if (entries.length == 0) {
      Message message = new Message(Reporter.WARNING,
            getString("noentry"),
            getString("dirExp"));
      Reporter.print(message, source);
  }
  for (int i = 0; i < entries.length; i += 2) {
      String name = entries[i];
      String dir = entries[i + 1];
      String loopSource = source + ": " + name + "=" + dir;
      Object lobj = checkDir(dir, d);
      Message message;
      if (lobj == null) {
    message = new Message(Reporter.INFO,
              getString("dirOK"),
              getString("dirExp"));
    Reporter.print(message, loopSource);
      } else if (lobj instanceof String) {
    message = new Message(Reporter.ERROR,
              (String) lobj,
              getString("dirExp"));
    Reporter.print(message, loopSource);
      } else {
    handleUnexpectedSubtaskReturn(lobj, loopSource);
View Full Code Here

     *
     * @param classpath the classpath to check
     * @param source the source description
     */
    private void checkPlatform(String classpath, String source) {
  Message message;
  String[] paths = parseClasspath(classpath, source);
  for (int i = 0; i < paths.length; i++) {
      if (paths[i].endsWith("jsk-platform.jar")) {
    message = new Message(Reporter.INFO,
              getString("hasplatform"),
              getString("platformExp"));
    Reporter.print(message, source);
    return;
      }
  }
  message = new Message(Reporter.WARNING,
            getString("noplatform"),
            getString("platformExp"));
  Reporter.print(message, source);
    }
View Full Code Here

     * @param source the source descriptive text
     * @return the list containing this item and all items referred to by
     *         this item.
     */
    private ArrayList checkItem(String item, String source) {
  Message message;
  ArrayList list = new ArrayList();
  if (seen.contains(item)) {
      return list;
  }
  seen.add(item);
  File itemFile = new File(item);
  if (!itemFile.exists()) {
      message = new Message(Reporter.WARNING,
          getString("nosuchitem", item),
          null);
      Reporter.print(message, source);
      return list;
  }
  if (!itemFile.canRead()) {
      message = new Message(Reporter.WARNING,
          getString("unreadableitem", item),
          null);
      Reporter.print(message, source);
      return list;
  }
View Full Code Here

     * @param source identifies the source of the codebase
     * @param codebase the codebase to check
     * @return true if existence check is successful
     */
    private boolean checkExistance(String source, final String codebase) {
  Message message;
  boolean gotCodebase;
  if (codebase != null && codebase.trim().length() > 0) {
      message = new Message(Reporter.INFO,
          getString("codebaseIs") + " " + codebase,
          getString("existenceExp"));
      gotCodebase = true;
  } else {
      message = new Message(Reporter.INFO,
          getString("nocodebase"),
          getString("existenceExp"));
      gotCodebase = false;
  }
  Reporter.print(message, source);
View Full Code Here

    private URL checkURL(NonActivatableServiceDescriptor d,
       SharedActivationGroupDescriptor g,
       String source,
       final String urlToken)
    {
  Message message;
  URL url = null;
  String[] args = new String[]{urlToken};
  Object lobj = envCheck.launch(d, g, taskName("GetURLTask"), args);
  if (lobj instanceof URL) {
      url = (URL) lobj;
  } else if (lobj instanceof String) {
      String cause = (String) lobj;
      if (cause.equals("nohandler")) {
    message = new Message(Reporter.ERROR,
              getString("nohandler", urlToken),
              getString("httpmdExp"));
    Reporter.print(message, source);
    try {
        url = new URL(urlToken);
    } catch (MalformedURLException e) { // should never happen
        message = new Message(Reporter.ERROR,
            getString("badURL", urlToken),
            e,
            null);
        Reporter.print(message, source);
    }
      } else {
    message =
        new Message(Reporter.ERROR,
        getString("badURL", urlToken) + ": " + cause,
        null);
   
    Reporter.print(message, source);
      }
View Full Code Here

     */
    private void checkForKnownHost(final URL url, String source) {
  try {
      InetAddress.getByName(url.getHost()).getCanonicalHostName();
  } catch (UnknownHostException e) {
      Message message = new Message(Reporter.ERROR,
            getString("noHost",
                url.getHost(),
                url),
            null);
      Reporter.print(message, source);
View Full Code Here

TOP

Related Classes of com.sun.jini.tool.envcheck.Reporter.Message

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.