Package org.jbpm.pvm.internal.wire

Examples of org.jbpm.pvm.internal.wire.WireException


      Object value = wireContext.create(descriptor, true);
      // Set the field value
      try {
        ReflectUtil.set(field, target, value);
      } catch (Exception e) {
        throw new WireException("couldn't set "+fieldName+" to "+value, e);
      }
    }
  }
View Full Code Here


    try {
      Object[] args = ObjectDescriptor.getArgs(wireContext, argDescriptors);
      Class<?> clazz = target.getClass();
      Method method = ReflectUtil.findMethod(clazz, methodName, argDescriptors, args);
      if (method==null) {
        throw new WireException("method "+ReflectUtil.getSignature(methodName, argDescriptors, args)+" unavailable");
      }
      ReflectUtil.invoke(method, target, args);
    } catch (WireException e) {
      throw e;
    } catch (Exception e) {
      throw new WireException("couldn't invoke method "+methodName+": "+e.getMessage(), e);
    }
  }
View Full Code Here

    Method method = null;
    Class<?> clazz = target.getClass();
    Object[] args = new Object[]{value};
    method = ReflectUtil.findMethod(clazz, setterName, null, args);
    if (method==null) {
      throw new WireException("couldn't find property setter "+setterName+" for value "+value);
    }
    ReflectUtil.invoke(method, target, args);
  }
View Full Code Here

      }
     
      Class<?> clazz = invocationTarget.getClass();
      Method method = ReflectUtil.findMethod(clazz, methodName, argDescriptors, args);
      if (method==null) {
        throw new WireException("method "+ReflectUtil.getSignature(methodName, argDescriptors, args)+" unavailable");
      }

      Object returnValue = ReflectUtil.invoke(method, invocationTarget, args);
     
      if (variableName!=null) {
        execution.setVariable(variableName, returnValue);
      }
     
    } catch (WireException e) {
      throw e;
    } catch (Exception e) {
      throw new WireException("couldn't invoke method "+methodName+": "+e.getMessage(), e);
    }
  }
View Full Code Here

        }
        load(object, inputStream);
      }
     
    } catch (Exception e) {
      throw new WireException("couldn't read properties from "+description, e);
    }
   
    super.initialize(object, wireContext);
  }
View Full Code Here

    try {
      ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
      return Class.forName(text, true, classLoader);
    } catch (Exception e) {
      Throwable cause = (e.getCause()!=null ? e.getCause() : e);
      throw new WireException("couldn't load class '"+text+"': "+cause.getMessage(), cause);
    }
  }
View Full Code Here

  public Object construct(WireContext wireContext) {
    EnvironmentImpl environment = EnvironmentImpl.getCurrent();
   
    if (environment==null) {
      throw new WireException("no environment to get object "+(objectName!=null ? objectName : typeName));
    }
   
    if (objectName!=null) {
      log.trace("looking up "+objectName+" by name in environment");
      return environment.get(objectName);
    }

    log.trace("looking up an object of type "+typeName+" in environment");
    if (type==null) {
      try {
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        type = classLoader.loadClass(typeName);
      } catch (Exception e) {
        throw new WireException("couldn't load class "+typeName, e);
      }
    }
    return environment.get(type);
  }
View Full Code Here

  protected String connectionName;

  public Object construct(WireContext wireContext) {
    EnvironmentImpl environment = EnvironmentImpl.getCurrent();
    if (environment==null) {
      throw new WireException("no environment");
    }

    // get the hibernate-session-factory
    SessionFactory sessionFactory = null;
    if (factoryName!=null) {
      sessionFactory = (SessionFactory) wireContext.get(factoryName);
    } else {
      sessionFactory = environment.get(SessionFactory.class);
    }
    if (sessionFactory==null) {
      throw new WireException("couldn't find hibernate-session-factory "+(factoryName!=null ? "'"+factoryName+"'" : "by type ")+"to open a hibernate-session");
    }

    // open the hibernate-session
    Session session = null;
    if (useCurrent) {
View Full Code Here

          object = Collections.synchronizedCollection((Collection) object);
        }
      }

    } catch (Exception e) {
      throw new WireException("couldn't create '"+(name!=null ? name : className)+"': "+e.getMessage(), e);
    }
    return object;
  }
View Full Code Here

        }
      }
    } catch (WireException e) {
      throw e;
    } catch (Exception e) {
      throw new WireException("couldn't initialize object '"+(name!=null ? name : className)+"'", e);
    }
  }
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.wire.WireException

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.