Package org.shiftone.jrat.core

Examples of org.shiftone.jrat.core.ConfigurationException


  }


    public void setMethodHandlerFactories (List methodHandlerFactories) {
        if (started) {
            throw new ConfigurationException("methodHandlerFactories can not be changed after startup");
        }
        Iterator iterator = methodHandlerFactories.iterator ();
         while (iterator.hasNext ()) {
             Object element = iterator.next ();
             if (element instanceof MethodHandlerFactory) {
                LOG.info ("methodHandlerFactories contains '" + element + "'");
             } else {
                 throw new ConfigurationException("all elements of 'methodHandlerFactories' mist implement '" + MethodHandlerFactory.class.getName () + "'");
             }

        }
        this.methodHandlerFactories = methodHandlerFactories;
    }
View Full Code Here


    Assert.assertNotNull("className", className);
    LOG.debug("newInstance(" + className + ")");
    try {
      klass = CLASS_LOADER.loadClass(className);
    } catch (Exception e) {
      throw new ConfigurationException("unable to load class '" + className + "'", e);
    }
    try {
      instance = klass.newInstance();
    } catch (Exception e) {
      throw new ConfigurationException("unable to instantiate '" + className + "'", e);
    }
    return instance;
  }
View Full Code Here

      LOG.info("resource not found on classpath, trying to open as file");
      try {
        inputStream = new FileInputStream(resourceName);
        LOG.debug("resource opened as file");
      } catch (Exception e) {
        throw new ConfigurationException("unable to locate resource : " + resourceName);
      }
    } else {
      LOG.debug("resource opened from classpath");
    }
    return inputStream;
View Full Code Here

    try {
      for (c = 0; c >= 0; c = reader.read(buffer)) {
        sb.append(buffer, 0, c);
      }
    } catch (IOException e) {
      throw new ConfigurationException("unable to read resource data : " + name, e);
    }
    return sb.toString();
  }
View Full Code Here

    inputStream = loadResourceAsStream(name);
    props = new Properties();
    try {
      props.load(inputStream);
    } catch (Exception e) {
      throw new ConfigurationException("unable to load properties from resource : " + name, e);
    }
    return props;
  }
View Full Code Here

        } else if ("debug".equals (levelName)) {
            level = JclMethodHandler.DEBUG;
        } else if ("info".equals (levelName)) {
            level = JclMethodHandler.INFO;
        } else {
            throw new ConfigurationException("level not supported : " + levelName);
        }

    }
View Full Code Here

        return this;
      } else {
        String part = keyParts[partIndex];
        Node nextChild = (Node) children.get(part);
        if (nextChild == null) {
          throw new ConfigurationException("node not found : " + fullKey(keyParts, partIndex));
        }
        return nextChild.getNode(keyParts, partIndex + 1);
      }
    }
View Full Code Here

      targetType = method.getParameterTypes()[0];
      valueObject = convert(value, targetType);
      try {
        method.invoke(bean, new Object[] { valueObject });
      } catch (Exception e) {
        throw new ConfigurationException("error setting property : " + key, e);
      }
    } else {
      throw new ConfigurationException("no set method for '" + key + "' in class '" + klass.getName() + "'");
    }
  }
View Full Code Here

        return Boolean.TRUE;
      } else if ("false".equalsIgnoreCase(v)) {
        return Boolean.FALSE;
      }
    }
    throw new ConfigurationException("unable to convert '" + v + "' to '" + type.getClass().getName() + "'");
  }
View Full Code Here

        valueObject = method.invoke(bean, new Object[] {});
        if (valueObject != null) {
          stringValue = String.valueOf(valueObject);
        }
      } catch (Exception e) {
        throw new ConfigurationException("error getting property : " + key, e);
      }
    } else {
      throw new ConfigurationException("no get method for '" + key + "' in class '" + klass.getName() + "'");
    }
    return stringValue;
  }
View Full Code Here

TOP

Related Classes of org.shiftone.jrat.core.ConfigurationException

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.