Examples of ComponentException


Examples of org.jspresso.framework.model.component.ComponentException

      if (toStringValue == null) {
        return "";
      }
      return toStringValue.toString();
    } catch (IllegalAccessException ex) {
      throw new ComponentException(ex);
    } catch (InvocationTargetException ex) {
      if (ex.getCause() instanceof RuntimeException) {
        throw (RuntimeException) ex.getCause();
      }
      throw new ComponentException(ex.getCause());
    } catch (NoSuchMethodException ex) {
      throw new ComponentException(ex);
    }
  }
View Full Code Here

Examples of org.jspresso.framework.model.component.ComponentException

    } catch (NoSuchMethodException ex) {
      try {
        return delegate.getClass().getMethod(method.getName(),
            method.getParameterTypes()).invoke(delegate, args);
      } catch (IllegalArgumentException ex1) {
        throw new ComponentException(method.toString()
            + " is not supported on the component " + getComponentContract());
      } catch (IllegalAccessException ex1) {
        throw new ComponentException(method.toString()
            + " is not supported on the component " + getComponentContract());
      } catch (InvocationTargetException ex1) {
        if (ex1.getCause() instanceof RuntimeException) {
          throw (RuntimeException) ex1.getCause();
        }
        throw new ComponentException(ex1.getCause());
      }
    }
  }
View Full Code Here

Examples of org.jspresso.framework.model.component.ComponentException

  protected Object retrievePropertyValue(String propertyName) {
    try {
      return getAccessorFactory().createPropertyAccessor(propertyName,
          getComponentContract()).getValue(delegate);
    } catch (IllegalAccessException ex) {
      throw new ComponentException(ex);
    } catch (InvocationTargetException ex) {
      if (ex.getCause() instanceof RuntimeException) {
        throw (RuntimeException) ex.getCause();
      }
      throw new ComponentException(ex.getCause());
    } catch (NoSuchMethodException ex) {
      throw new ComponentException(ex);
    }
  }
View Full Code Here

Examples of org.jspresso.framework.model.component.ComponentException

  protected void storeProperty(String propertyName, Object propertyValue) {
    try {
      getAccessorFactory().createPropertyAccessor(propertyName,
          getComponentContract()).setValue(delegate, propertyValue);
    } catch (IllegalAccessException ex) {
      throw new ComponentException(ex);
    } catch (InvocationTargetException ex) {
      if (ex.getCause() instanceof RuntimeException) {
        throw (RuntimeException) ex.getCause();
      }
      throw new ComponentException(ex.getCause());
    } catch (NoSuchMethodException ex) {
      throw new ComponentException(ex);
    }
  }
View Full Code Here

Examples of org.jvnet.hk2.component.ComponentException

        final ClassLoader cl = getClassLoader();
        try {
            Class<T> c = (Class<T>) cl.loadClass(typeName);
            return c;
        } catch (ClassNotFoundException e) {
            throw new ComponentException("Failed to load "+typeName+" from " + cl, e);
        }
    }
View Full Code Here

Examples of org.ofbiz.base.component.ComponentException

        String parentPath;
        try {
            parentPath = FileUtil.getFile(System.getProperty("ofbiz.home")).getCanonicalFile().toString().replaceAll("\\\\", "/");
        } catch (MalformedURLException e) {
            throw new ComponentException(e.getMessage(), e);
        } catch (IOException e) {
            throw new ComponentException(e.getMessage(), e);
        }
        // load each component
        if (components != null) {
            for (ComponentLoaderConfig.ComponentDef def: components) {
                this.loadComponentFromConfig(parentPath, def);
View Full Code Here

Examples of org.ofbiz.base.component.ComponentException

        String parentPath;
        try {
            parentPath = FileUtil.getFile(System.getProperty("ofbiz.home")).getCanonicalFile().toString().replaceAll("\\\\", "/");
        } catch (MalformedURLException e) {
            throw new ComponentException(e.getMessage(), e);
        } catch (IOException e) {
            throw new ComponentException(e.getMessage(), e);
        }
        // load each component
        if (components != null) {
            for (ComponentLoaderConfig.ComponentDef def: components) {
                this.loadComponentFromConfig(parentPath, def);
View Full Code Here

Examples of org.osgi.service.component.ComponentException

        }
        if (type == String.class)
        {
            return coerceToString(raw);
        }
        throw new ComponentException ("unexpected output type " + type);
    }
View Full Code Here

Examples of org.osgi.service.component.ComponentException

            {
                return Byte.parseByte( (String)o );
            }
            catch ( NumberFormatException e )
            {
                throw new ComponentException(e);
            }
        }
        if (o instanceof Boolean)
        {
            return (Boolean)o? 1: byte0;
        }
        if (o instanceof Character)
        {
            return ( byte ) ((Character)o).charValue();
        }
        if (o instanceof Number)
        {
            return ((Number)o).byteValue();
        }
        if (o == null)
        {
            return 0;
        }
        throw new ComponentException( "Unrecognized input type: " + o);
    }
View Full Code Here

Examples of org.osgi.service.component.ComponentException

            {
                return Double.parseDouble((String)o );
            }
            catch ( NumberFormatException e )
            {
                throw new ComponentException(e);
            }
        }
        if (o instanceof Boolean)
        {
            return (Boolean)o? 1: 0;
        }
        if (o instanceof Character)
        {
            return ( double ) ((Character)o).charValue();
        }
        if (o instanceof Number)
        {
            return ((Number)o).doubleValue();
        }
        if (o == null)
        {
            return 0;
        }
        throw new ComponentException( "Unrecognized input type: " + o);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.