Package com.espertech.esper.client

Examples of com.espertech.esper.client.EPException


        map.put(property, value);
      }
    }
    catch (Exception e)
    {
      throw new EPException(e);
    }
    return map;
  }
View Full Code Here


      // allow this scenario for beans as we may want to bring in a subset of properties
      if (beanClass != null) {
        return propertyTypesGiven;
      }
      else {
        throw new EPException("Event type " + eventTypeName + " has already been declared with a different number of parameters");
      }
    }
    for(String property : eventType.getPropertyNames())
    {
            Class type;
            try {
                type = eventType.getPropertyType(property);
            }
            catch (PropertyAccessException e) {
                // thrown if trying to access an invalid property on an EventBean
                throw new EPException(e);
            }
      if(propertyTypesGiven != null && propertyTypesGiven.get(property) == null)
      {
        throw new EPException("Event type " + eventTypeName + "has already been declared with different parameters");
      }
      if(propertyTypesGiven != null && !propertyTypesGiven.get(property).equals(type))
      {
        throw new EPException("Event type " + eventTypeName + "has already been declared with a different type for property " + property);
      }
            // we can't set read-only properties for bean
            if(!eventType.getUnderlyingType().equals(Map.class)) {
              PropertyDescriptor[] pds = ReflectUtils.getBeanProperties(beanClass);
              PropertyDescriptor pd = null;
              for (PropertyDescriptor p :pds) {
                if (p.getName().equals(property))
                  pd = p;
              }
                if (pd == null)
                {
                    continue;
                }
                if (pd.getWriteMethod() == null) {
                if (propertyTypesGiven == null) {
                  continue;
                }
                else {
                  throw new EPException("Event type " + eventTypeName + "property " + property + " is read only");
                }
              }
            }
      propertyTypes.put(property, type);
    }
View Full Code Here

    else if(adapterSpec.getTimestampColumn() != null)
    {
      Long timestamp = resolveTimestamp(map);
      if(timestamp == null)
      {
        throw new EPException("Couldn't resolve the timestamp for record " + map);
      }
      else if(timestamp < 0)
      {
        throw new EPException("Encountered negative timestamp for CSV record : " + map);
      }
      else
      {
        long timestampDifference = 0;
        if(timestamp < lastTimestamp)
        {
          if(!isFirstRow)
          {
            throw new EPException("Subsequent timestamp " + timestamp + " is smaller than previous timestamp " + lastTimestamp);
          }
          else
          {
            timestampDifference = timestamp;
          }
View Full Code Here

    assertValidEventsPerSec(adapterSpec.getEventsPerSec());

    if(adapterSpec.isLooping() && !adapterSpec.getAdapterInputSource().isResettable())
    {
      throw new EPException("Cannot loop on a non-resettable input source");
    }
  }
View Full Code Here

        {
            log.debug(".start");
        }
        if(runtime == null)
    {
      throw new EPException("Attempting to start an Adapter that hasn't had the epService provided");
    }
    startTime = getCurrentTime();
    if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled()))
        {
            log.debug(".start startTime==" + startTime);
View Full Code Here

      {
        Thread.sleep(sleepTime);
      }
      catch (InterruptedException ex)
      {
        throw new EPException(ex);
      }
      return true;
    }
  }
View Full Code Here

    {
        if (!groupView.hasViews())
        {
            String message = "Unexpected empty list of child nodes for group view";
            log.fatal(".copySubViews " + message);
            throw new EPException(message);
        }

        Object subviewHolder;
        if (groupView.getViews().length == 1) {
            subviewHolder = copyChildView(groupView, propertyNames, groupByValues, agentInstanceContext, groupView.getViews()[0]);
View Full Code Here

    private static View copyChildView(GroupByView groupView, String[] propertyNames, Object groupByValues, AgentInstanceViewFactoryChainContext agentInstanceContext, View originalChildView) {
        if (originalChildView instanceof MergeView)
        {
            String message = "Unexpected merge view as child of group-by view";
            log.fatal(".copySubViews " + message);
            throw new EPException(message);
        }

        if (!(originalChildView instanceof CloneableView))
        {
            throw new EPException("Unexpected error copying subview " + originalChildView.getClass().getName());
        }
        CloneableView cloneableView = (CloneableView) originalChildView;

        // Copy child node
        View copyChildView = cloneableView.cloneView();
View Full Code Here

                }
            }

            if (!(subView instanceof CloneableView))
            {
                throw new EPException("Unexpected error copying subview");
            }
            CloneableView cloneableView = (CloneableView) subView;
            View copiedChild = cloneableView.cloneView();
            copyView.addView(copiedChild);
View Full Code Here

            String text = node.getChild(start).getText().toLowerCase().trim();
            if (text.equals("constant") || text.equals("const")) {
                constant = true;
            }
            else {
                throw new EPException("Expected 'constant' or 'const' keyword after create for create-variable syntax but encountered '" + text + "'");
            }
            start++;
        }
        if (node.getChildCount() > start && node.getChild(start).getType() == LBRACK) {
            array = true;
View Full Code Here

TOP

Related Classes of com.espertech.esper.client.EPException

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.