Package org.openbp.core.engine

Examples of org.openbp.core.engine.EngineException


   * (depending on the mode parameter)
   */
  public Object getContextPathValue(String expression, Object base, int mode)
  {
    if (expression == null)
      throw new EngineException("ExpressionIsNull", "Cannot evaluate null expression");

    Object value = null;

    StringParser sp = new StringParser(expression);

View Full Code Here


   * (depending on the mode parameter)
   */
  public void setContextPathValue(String expression, Object value, DataTypeItem topLevelDataType, int mode)
  {
    if (expression == null)
      throw new EngineException("ExpressionIsNull", "Cannot evaluate null expression");

    StringParser sp = new StringParser(expression);

    try
    {
View Full Code Here

        return value;
    }

    if (context == null)
    {
      throw new EngineException("EvaluationContextMissing", "Cannot refer to context object '" + name + "' without a context.");
    }

    String contextName;
    if (TokenContextUtil.isProcessVariableIdentifier(name))
    {
View Full Code Here

   */
  protected void setContextObject(String name, Object value)
  {
    if (context == null)
    {
      throw new EngineException("EvaluationContextMissing", "Cannot refer to context object '" + name + "' without a context.");
    }

    String contextName;
    if (TokenContextUtil.isProcessVariableIdentifier(name))
    {
View Full Code Here

  protected Object createBeanInstance(ComplexTypeItem dataType)
  {
    Class cls = dataType.getJavaClass();
    if (cls == null)
    {
      throw new EngineException("CouldNotCreateInstance", "Cannot create bean instance; no bean class available for data type '" + dataType.getQualifier() + "'");
    }

    Object o = null;
    try
    {
      o = ReflectUtil.instantiate(cls, null, "bean");
    }
    catch (ReflectException e)
    {
      throw new EngineException("CouldNotCreateInstance", "Error instantiating bean object.", e);
    }

    return o;
  }
View Full Code Here

   * @return A new OpenBPException
   */
  private OpenBPException newError(String errorCode, String msg, Throwable throwable, StringParser sp)
  {
    msg = msg + "\nExpression = '" + sp.getSourceString() + "', column = " + sp.getPos();
    return new EngineException(errorCode, throwable);
  }
View Full Code Here

    {
      // Create message.
      String msg = LogUtil.error(getClass(), "Cannot determine user interface adapter class name of type $0.", visualType);

      // Throw an Engine Exception.
      throw new EngineException("UnknownUiAdapter", msg);
    }

    // Instantiate the user interface adapter
    Class cls = null;
    try
    {
      // Get the class for the class name.
      cls = Class.forName(className);

      // We instantiate using the (Model model) constructor
      Constructor constructor = cls.getConstructor(new Class [] { Model.class });

      UIAdapter adapter = (UIAdapter) constructor.newInstance(new Object [] { model });

      // Log that we created a UI adapter.
      LogUtil.debug(getClass(), "UIAdapter for model $0, visual type $1 created.", model.getQualifier(), visualType);

      // Return the created adapter.
      return adapter;
    }
    catch (Exception e)
    {
      // Log message.
      String msg = LogUtil.error(getClass(), "Cannot instantiate user interface adapter $0.", className);

      // Throw an Engine Exception.
      throw new EngineException("CouldNotCreateUiAdapter", msg, e);
    }
  }
View Full Code Here

      if (connectionInfo == null)
        return;

      // Create an RMI registry
      if (connectionInfo.getRmiServerPort() == 0)
        throw new EngineException("Connection.Properties", "No RMI port specified for service registry.");

      // Create an RMI registry
      int rmiServerPort = connectionInfo.getRmiServerPort();

      LogUtil.info(getClass(), "Binding to RMI registry using binding name $0, port {1}.", CoreConstants.RMI_BINDING_NAME, new Integer(rmiServerPort));

      Registry registry = null;
      try
      {
        // This fails, if OpenBP has already been started & stopped in the same VM instance before.
        registry = LocateRegistry.createRegistry(rmiServerPort);
      }
      catch (RemoteException e)
      {
        if (e instanceof java.rmi.server.ExportException)
        {
          // registry probably already exists
          registry = LocateRegistry.getRegistry(rmiServerPort);
        }
        else
          throw e;
      }

      // Bind the service to the RMI registry
      registry.rebind(CoreConstants.RMI_BINDING_NAME, this);
    }
    catch (RemoteException e)
    {
      String msg = LogUtil.error(getClass(), "Error binding remote interface.", e);
      String bindingErrorHandler = SettingUtil.getStringSetting(ServerConstants.SYSPROP_RMIBINDINGERRORHANDLING);
      if ("ignore".equals(bindingErrorHandler))
      {
      }
      else if ("output".equals(bindingErrorHandler))
      {
        LogUtil.error(getClass(), msg);
      }
      else
      {
        throw new EngineException("Initialization", msg, e);
      }
    }
  }
View Full Code Here

      {
        LogUtil.error(getClass(), msg);
      }
      else
      {
        throw new EngineException("Shutdown", msg, e);
      }
    }
  }
View Full Code Here

    // Retrieve an implementation for the given interface
    Object implementation = serviceRegistry.lookup(interfaceName);
    if (implementation == null)
    {
      String msg = LogUtil.error(getClass(), "No implementation found for interface $0.", interfaceName);
      throw new EngineException("Initialization", msg);
    }

    try
    {
      Method method = ReflectUtil.findByUnqualifiedMethodSignature(implementation.getClass(), methodSignature);
View Full Code Here

TOP

Related Classes of org.openbp.core.engine.EngineException

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.