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

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


     * @param source the source of the <code>URL</code>
     */
    private void checkForLocalHost(final URL url, String source) {
  try {
      if (InetAddress.getByName(url.getHost()).isLoopbackAddress()) {
    Message message = new Message(Reporter.WARNING,
                getString("usedLocalhost", url),
                getString("localhostExp"));
    Reporter.print(message, source);
      }
  } catch (Exception ignore) { // accessibility check handles this failure
View Full Code Here


     *
     * @param url the <code>URL</code> to check
     * @param source the source of the <code>URL</code>
     */
    private void checkAccessibility(final URL url, String source) {
  Message message;
  URLAccessor accessor = new URLAccessor(url);
  Thread t = new Thread(accessor);
  t.setDaemon(true);
  t.start();
  try {
      t.join(5000, 0);
  } catch (Exception e) {
      e.printStackTrace();
  }
  if (t.isAlive()) {
      message = new Message(Reporter.ERROR,
          getString("noresponse", url),
          null);
  } else if (accessor.getException() == null) {
      message = new Message(Reporter.INFO,
          getString("available", url),
          null);
  } else {
      message = new Message(Reporter.ERROR,
          getString("unavailable", url),
          accessor.getException(),
          null);
  }
  Reporter.print(message, source);
View Full Code Here

    if (tld.equals(topLevelDomains[i])) {
        return;
    }
      }
  }
  Message message = new Message(Reporter.WARNING,
              getString("unqualified", url.getHost()),
              getString("unqualifiedExp"));
  Reporter.print(message, source);
    }
View Full Code Here

  // can assume hashcode is present, or url construction would have failed
  String target = url.getFile();
  int lastSemi = target.lastIndexOf(';');
  String hash = target.substring(lastSemi + 1);
  if (hash.startsWith("md5")) {
      Message message = new Message(Reporter.WARNING,
            getString("usesmd5", url),
            getString("usesmd5Exp"));
      Reporter.print(message, source);
  }
    }
View Full Code Here

     *
     * @param gd the group descriptor, or <code>null</code> to check
     *           the command line
     */
    private void checkLoggingConfig(SharedActivationGroupDescriptor gd) {
  Message message;
  String source = gd == null ? getString("cmdline")
                             : getString("groupVM");
  Properties p = gd == null ? envCheck.getProperties()
                            : gd.getServerProperties();
  String task = FileAccessCheckTask.class.getName();
  String name = "java.util.logging.config.file";
  String phrase = getString("loggingconfig");
  String logConfName = p.getProperty(name);
  if (logConfName == null) {
      message = new Message(Reporter.INFO,
          getString("noconfig"),
          getString("loggingconfigExp"));
  } else {
      String[] args = new String[]{name, phrase};
      Object lobj = envCheck.launch(null, gd, task, args);
      if (lobj == null) {
    message = new Message(Reporter.INFO,
              getString("okconfig"),
              getString("loggingconfigExp"));
      } else if (lobj instanceof String) {
    message = new Message(Reporter.ERROR,
              (String) lobj,
              getString("loggingconfigExp"));
      } else {
    message = new Message(Reporter.ERROR,
              getString("accessexception"),
              (Throwable) lobj,
              getString("loggingconfigExp"));
      }
  }
View Full Code Here

     * @param o the object returned by the subtask
     * @param source the source description
     */
    private void processReturn(Object o, String source) {
  if (o instanceof Boolean) {
      Message message;
      if (((Boolean) o).booleanValue()) {
    message = new Message(Reporter.INFO,
              getString("goodjdk"),
              getString("jdkExp"));
      } else {
    message = new Message(Reporter.INFO,
              getString("badjdk"),
              getString("jdkExp"));
      }
      Reporter.print(message, source);
  } else {
View Full Code Here

    private boolean checkArgs(NonActivatableServiceDescriptor d,
            String source)
    {
        String[] args = d.getServerConfigArgs();
        if (args == null || args.length == 0) {
      Message message = new Message(Reporter.ERROR,
            getString("emptydesclist"),
            getString("emptydesclistExp"));
      Reporter.print(message, source);
            return false;
        }
View Full Code Here

  Object lobj =
      launch("com.sun.jini.tool.envcheck.EnvCheck$GetDescriptors", args);
  if (lobj instanceof ServiceDescriptor[]) {
      descriptors = (ServiceDescriptor[]) lobj;
      if (descriptors.length == 0) {
    Reporter.print(new Message(Reporter.ERROR,
             getString("envcheck.emptyconfig"),
             null));
      }
  } else if (lobj instanceof ConfigurationException) {
      System.err.println(getString("envcheck.ssdescfailed"));
View Full Code Here

     * @return true if the load was successful
     */
    private boolean checkConfigLoad(NonActivatableServiceDescriptor d,
            String source)
    {
  Message message;
  String task = taskName("ConfigTask");
  boolean ret = false;
  Object o = envCheck.launch(d, envCheck.getGroupDescriptor(), task);
  if (o instanceof Boolean) {
      if (((Boolean) o).booleanValue()) {
    message = new Message(Reporter.INFO,
              getString("ssconfigOK"),
              getString("ssconfigExp"));
    ret = true;
      } else {
    message = new Message(Reporter.ERROR,
              getString("loadfailed"),
              getString("ssconfigExp"));
      }
      Reporter.print(message, source);
  } else if (o instanceof ConfigurationException) {
      message = new Message(Reporter.ERROR,
          getString("loadfailed"),
          (Throwable) o,
          getString("ssconfigExp"));
      Reporter.print(message, source);
  } else {
View Full Code Here

           String source)
    {
  String task = taskName("GetGroupsTask");
  Object o = envCheck.launch(d, envCheck.getGroupDescriptor(), task);
  if (o instanceof GroupInfo[]) {
      Message message;
      GroupInfo[] info = (GroupInfo[]) o;
      if (info.length == 0) {
    message = new Message(Reporter.INFO,
              getString("notallgroup"),
              getString("allgroupExp"));
    Reporter.print(message, source);
      } else {
    for (int i = 0; i < info.length; i++) {
        GroupInfo gi = info[i];
        if (gi.groups == null) {
      message = new Message(Reporter.WARNING,
                getString("allgroup"),
                getString("allgroupExp"));
        } else {
      StringBuffer groupList = new StringBuffer();
      for (int j = 0; j < gi.groups.length; j++) {
          String group = gi.groups[j];
          if (group.equals("")) {
        group = "public";
          }
          if (j > 0) {
        groupList.append(",");
          }
          groupList.append(group);
      }
      message = new Message(Reporter.INFO,
                getString("groups",
              groupList.toString()),
                getString("allgroupExp"));
        }
        Reporter.print(message, source + ": " + gi.entryName);
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.