Package org.nasutekds.server.types

Examples of org.nasutekds.server.types.InitializationException


    InputStream is = RootCfgDefn.class.getResourceAsStream("/admin/"
        + CORE_MANIFEST);

    if (is == null) {
      Message message = ERR_ADMIN_CANNOT_FIND_CORE_MANIFEST.get(CORE_MANIFEST);
      throw new InitializationException(message);
    }

    try {
      loadDefinitionClasses(is);
    } catch (InitializationException e) {
      if (debugEnabled()) {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }

      Message message = ERR_CLASS_LOADER_CANNOT_LOAD_CORE.get(CORE_MANIFEST,
          stackTraceToSingleLineString(e));
      throw new InitializationException(message);
    }
  }
View Full Code Here


        }

        Message message = ERR_ADMIN_CANNOT_READ_EXTENSION_MANIFEST.get(
            EXTENSION_MANIFEST, jarFile.getName(),
            stackTraceToSingleLineString(e));
        throw new InitializationException(message);
      }

      try {
        loadDefinitionClasses(is);
      } catch (InitializationException e) {
        if (debugEnabled()) {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }

        Message message = ERR_CLASS_LOADER_CANNOT_LOAD_EXTENSION.get(jarFile
            .getName(), EXTENSION_MANIFEST, stackTraceToSingleLineString(e));
        throw new InitializationException(message);
      }
      try {
        // Log build information of extensions in the error log
        String[] information = getBuildInformation(jarFile);
        logError(
View Full Code Here

      try {
        className = reader.readLine();
      } catch (IOException e) {
        Message msg = ERR_CLASS_LOADER_CANNOT_READ_MANIFEST_FILE.get(String
            .valueOf(e.getMessage()));
        throw new InitializationException(msg, e);
      }

      // Break out when the end of the manifest is reached.
      if (className == null) {
        break;
      }

      // Skip blank lines.
      className = className.trim();
      if (className.length() == 0) {
        continue;
      }

      // Skip lines beginning with #.
      if (className.startsWith("#")) {
        continue;
      }

      TRACER.debugMessage(DebugLogLevel.INFO, "Loading class " + className);

      // Load the class and get an instance of it if it is a definition.
      Class<?> theClass;
      try {
        theClass = Class.forName(className, true, loader);
      } catch (Exception e) {
        Message msg = ERR_CLASS_LOADER_CANNOT_LOAD_CLASS.get(className, String
            .valueOf(e.getMessage()));
        throw new InitializationException(msg, e);
      }
      if (AbstractManagedObjectDefinition.class.isAssignableFrom(theClass)) {
        // We need to instantiate it using its getInstance() static method.
        Method method;
        try {
          method = theClass.getMethod("getInstance");
        } catch (Exception e) {
          Message msg = ERR_CLASS_LOADER_CANNOT_FIND_GET_INSTANCE_METHOD.get(
              className, String.valueOf(e.getMessage()));
          throw new InitializationException(msg, e);
        }

        // Get the definition instance.
        AbstractManagedObjectDefinition<?, ?> d;
        try {
          d = (AbstractManagedObjectDefinition<?, ?>) method.invoke(null);
        } catch (Exception e) {
          Message msg = ERR_CLASS_LOADER_CANNOT_INVOKE_GET_INSTANCE_METHOD.get(
              className, String.valueOf(e.getMessage()));
          throw new InitializationException(msg, e);
        }
        definitions.add(d);
      }
    }

    // Initialize any definitions that were loaded.
    for (AbstractManagedObjectDefinition<?, ?> d : definitions) {
      try {
        d.initialize();
      } catch (Exception e) {
        Message msg = ERR_CLASS_LOADER_CANNOT_INITIALIZE_DEFN.get(d.getName(),
            d.getClass().getName(), String.valueOf(e.getMessage()));
        throw new InitializationException(msg, e);
      }
    }
  }
View Full Code Here

        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }

      Message message = ERR_ADMIN_CANNOT_OPEN_JAR_FILE.get(
          jar.getName(), jar.getParent(), stackTraceToSingleLineString(e));
      throw new InitializationException(message);
    }
    return jarFile;
  }
View Full Code Here

          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }

        Message message =
            ERR_JMX_ALERT_HANDLER_CANNOT_REGISTER.get(String.valueOf(e));
        throw new InitializationException(message, e);
      }
    }

    if (configuration != null)
    {
View Full Code Here

    {
      Message message = ERR_JMX_CONNHANDLER_CANNOT_BIND.
          get(String.valueOf(config.dn()), config.getListenPort(),
              getExceptionMessage(e));
      logError(message);
      throw new InitializationException(message);
    }

    if (config.isUseSSL()) {
      protocol = "JMX+SSL";
    } else {
View Full Code Here

  {
    if (arguments.length != 0)
    {
      Message message = ERR_MAKELDIF_TAG_INVALID_ARGUMENT_COUNT.get(
          getName(), lineNumber, 0, arguments.length);
      throw new InitializationException(message);
    }
  }
View Full Code Here

  {
    if (arguments.length != 0)
    {
      Message message = ERR_MAKELDIF_TAG_INVALID_ARGUMENT_COUNT.get(
          getName(), lineNumber, 0, arguments.length);
      throw new InitializationException(message);
    }
  }
View Full Code Here

    if (arguments.length != 1)
    {
      Message message = ERR_MAKELDIF_TAG_INVALID_ARGUMENT_COUNT.get(
          getName(), lineNumber, 1, arguments.length);
      throw new InitializationException(message);
    }

    try
    {
      percentage = Integer.parseInt(arguments[0]);

      if (percentage < 0)
      {
        Message message = ERR_MAKELDIF_TAG_INTEGER_BELOW_LOWER_BOUND.get(
            percentage, 0, getName(), lineNumber);
        throw new InitializationException(message);
      }
      else if (percentage > 100)
      {
        Message message = ERR_MAKELDIF_TAG_INTEGER_ABOVE_UPPER_BOUND.get(
            percentage, 100, getName(), lineNumber);
        throw new InitializationException(message);
      }
    }
    catch (NumberFormatException nfe)
    {
      Message message = ERR_MAKELDIF_TAG_CANNOT_PARSE_AS_INTEGER.get(
          arguments[0], getName(), lineNumber);
      throw new InitializationException(message);
    }
  }
View Full Code Here

                                  int lineNumber, List<Message> warnings)
          throws InitializationException
  {
    if (arguments.length == 0)
    {
      throw new InitializationException(
              ERR_MAKELDIF_TAG_LIST_NO_ARGUMENTS.get(lineNumber));
    }


    valueStrings     = new String[arguments.length];
View Full Code Here

TOP

Related Classes of org.nasutekds.server.types.InitializationException

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.