Package org.jboss.soa.esb

Examples of org.jboss.soa.esb.ConfigurationException


        listenerNode.setAttribute("name", listener.getName());

    try {
      bus = (HibernateBus) model.getBus(listener.getBusidref());
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <hibernate-listener> must reference a <hibernate-bus>.");
    }
    try {
      provider = (HibernateProvider) model.getProvider(bus);
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <hibernate-provider> instance.  Unexpected exception - this should have caused a validation error!");
    }

    List<HibernateMessageFilter> messageFilters = null;
    messageFilters = listener.getHibernateMessageFilterList();

    if(messageFilters.size() == 0) {
      messageFilters = bus.getHibernateMessageFilterList();
      if(messageFilters == null) {
        throw new ConfigurationException("No <hibernate-message-filter> defined on either <hibernate-listener> [" + listener.getName() + "] or <hibernate-bus> [" + bus.getBusid() + "].");
      }
    }
    // Map the standard listener attributes - common across all listener types...
    MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
    // Map the <property> elements targeted at the listener - from the listener itself.
View Full Code Here


    String pId  = config.getAttribute(Constants.PROCESS_DEFINITION_ID_TAG);
    if (null!=pId) {
      try {
                _processId = Long.parseLong(pId);
            } catch(NumberFormatException e) {
        throw new ConfigurationException("Invalid value for '"+Constants.PROCESS_DEFINITION_ID_TAG+"'");
      }
        }
        _esbToBpm  = ConfigUtil.getMappingConfig(config);
    if (_start) {
      _transitionName  = config.getAttribute(Constants.TRANSITION_NAME_TAG);
View Full Code Here

        Constants.OpCode opCode = null;
        String sAux = config.getRequiredAttribute(Constants.COMMAND_CODE_TAG);
        try {
            opCode = Constants.OpCode.valueOf(sAux);
        } catch (IllegalArgumentException e) {
            throw new ConfigurationException("Attribute '"+Constants.COMMAND_CODE_TAG+"' has an invalid value"
                        +"- see Constants.OpCode enum for possible values");
        }
       
        if (Constants.OpCode.CancelProcessInstanceCommand.equals(opCode))
            return new CancelProcessInstanceFacade(config);
View Full Code Here

  public Command getCommand(String commandString) throws ConfigurationException
  {
    Constants.OpCode opCode = Constants.OpCode.valueOf(commandString);
    Command command = _values.get(opCode);
    if (null==command)
      throw new ConfigurationException(opCode.toString()+" not implemented,");
    return command;
  }
View Full Code Here

     */
    private void setOnEsbMessage(final Mapping mapping, final boolean gblPrcScope, final ExecutionContext executionContext, Message message)
    throws ObjectMappingException, ConfigurationException
    {
        if (mapping.getBpm()==null || "".equals(mapping.getBpm())) {
            throw new ConfigurationException("The 'bpm' attribute is a required attribute");
        }
        if (mapping.getEsb()==null || "".equals(mapping.getEsb())) {
            mapping.setEsb(mapping.getBpm());
        }
        Token token = executionContext.getToken();
View Full Code Here

                    Element mappingElement = (Element) iterator.next();
                    Mapping mapping = Mapping.parseMappingElement(mappingElement);
                    mappingList.add(mapping);
                }
            } catch (DocumentException de) {
                throw new ConfigurationException(de.getMessage(), de);
            }
        }
        return mappingList ;
    }
View Full Code Here

    private Object getObjectFromMessage(Message message, Mapping mapping)
    throws ConfigurationException
    {
        Object value = null;
        if (mapping.getEsb()==null || "".equals(mapping.getEsb())) {
            throw new ConfigurationException("The 'esb' attribute is a required attribute");
        }
        try {
            value = objectMapper.getObjectFromMessage(message, mapping.getEsb());
        } catch (ObjectMappingException ome) {
            log.info(mapping.getEsb() + " not found");
View Full Code Here

    public void execute (ExecutionContext executionContext) throws Exception
    {
        //validation
        if (replyToOriginator != null) {
            if (!(Constants.EPR_REPLY.equals(replyToOriginator) || Constants.EPR_FAULT.equals(replyToOriginator))) {
                throw new ConfigurationException("EPR type (replyToOriginator) must be \"" + Constants.EPR_REPLY + "\" or \"" + Constants.EPR_FAULT + "\"");
            }
        } else {
            if (null == esbCategoryName)
                throw new ConfigurationException(
                    "Service category (esbCategoryName element) must not be null");
            if (null == esbServiceName)
                throw new ConfigurationException(
                    "Service name (esbServiceName element) must not be null");
        }
        if (millisToWaitForResponse !=null) {
            logger.info("millisToWaitForResponse is no longer a valid element, please use a " +
                    "jBPM timer for this node instead.");
        }
        //Create the ESB Message
        JBpmObjectMapper mapper = new JBpmObjectMapper();
      Message message = mapper.mapFromJBpmToEsbMessage(bpmToEsbVars, globalProcessScope, executionContext);
        //Set the replyTo to the JBpmCallback Service
        String esbToBpmVarsXml=null;
        if (esbToBpmVars!=null) {
            esbToBpmVarsXml = esbToBpmVars.asXML();
        }
        EPR replyTo = createReplyTo(esbToBpmVarsXml, globalProcessScope, executionContext);
        message.getHeader().getCall().setReplyTo(replyTo);
        if (exceptionTransition!=null) {
//          Set the replyTo to the JBpmCallback Service
            EPR faultTo = createFaultTo(esbToBpmVarsXml, globalProcessScope, executionContext);
            message.getHeader().getCall().setFaultTo(faultTo);
        }
       
        final ContextInstance contextInstance = executionContext.getContextInstance() ;
       
        if (isReplyToOrFaultToSet(contextInstance))
        {
            setRelatesToMessageId(contextInstance, message);
        }
       
        //Sending the message on its way
        if (logger.isDebugEnabled()) logger.debug("Created ESB message=" + message);
       
        if (replyToOriginator != null) {
            final EPR epr ;
            final Object replyToEPR = contextInstance.getVariable(Constants.REPLY_TO);
            final Object faultToEPR = contextInstance.getVariable(Constants.FAULT_TO);

            if (Constants.EPR_FAULT.equals(replyToOriginator) && (faultToEPR != null)) {
                epr = EPRHelper.fromXMLString(faultToEPR.toString()) ;
            } else if (replyToEPR != null) {
                epr = EPRHelper.fromXMLString(replyToEPR.toString()) ;
            } else {
                throw new ConfigurationException("No EPR present in process instance") ;
            }
           
           
            if(epr instanceof LogicalEPR) {
                final ServiceInvoker invoker = ((LogicalEPR)epr).getServiceInvoker();
View Full Code Here

    String tag = Constants.ACTORS_TAG;
    ConfigTree[] childs = tree.getChildren(tag);
    if (null==childs || childs.length<1)
      return null;
    if (childs.length>1)
      throw new ConfigurationException("Only one <"+tag
          +"> element allowed in configuration");
   
    tag = Constants.ONE_ACTOR_TAG;
    childs  = childs[0].getChildren(tag);
    if (null==childs || childs.length<1)
      throw new ConfigurationException("At least one <"+tag
          +"> child element required for <"+Constants.VARIABLES_TAG+">");
    String[] ret = new String[childs.length];
    int i1=0;
    for (ConfigTree curr: childs)
    {
      String name    = curr.getAttribute("name");
      if (null==name)
      {
        throw new ConfigurationException
        ("You must specify the 'name' attribute for all <"
            +tag+"> element");
      }
      ret[i1++= name;
    }
View Full Code Here

     */
    public void execute (ExecutionContext executionContext) throws Exception
    {
        if (replyToOriginator != null) {
            if (!(Constants.EPR_REPLY.equals(replyToOriginator) || Constants.EPR_FAULT.equals(replyToOriginator))) {
                throw new ConfigurationException("EPR type (replyToOriginator) must be \"" + Constants.EPR_REPLY + "\" or \"" + Constants.EPR_FAULT + "\"");
            }
        } else {
            if (null == esbCategoryName) {
                throw new ConfigurationException(
                    "Service category (esbCategoryName element) must not be null");
            }
            if (null == esbServiceName) {
                throw new ConfigurationException(
                    "Service name (esbServiceName element) must not be null");
            }
        }
        JBpmObjectMapper mapper = new JBpmObjectMapper();
        Message message = mapper.mapFromJBpmToEsbMessage(bpmToEsbVars, globalProcessScope, executionContext);
       
        final ContextInstance contextInstance = executionContext.getContextInstance();
       
        if (isReplyToOrFaultToSet(contextInstance))
        {
            setRelatesToMessageId(contextInstance, message);
        }
       
        if (logger.isDebugEnabled()) logger.debug("Created ESB message=" + message);
        if (replyToOriginator != null) {
            final EPR epr ;
            final Object replyToEPR = contextInstance.getVariable(Constants.REPLY_TO);
            final Object faultToEPR = contextInstance.getVariable(Constants.FAULT_TO);

            if (Constants.EPR_FAULT.equals(replyToOriginator) && (faultToEPR != null)) {
                epr = EPRHelper.fromXMLString(faultToEPR.toString()) ;
            } else if (replyToEPR != null) {
                epr = EPRHelper.fromXMLString(replyToEPR.toString()) ;
            } else {
                throw new ConfigurationException("No EPR present in process instance") ;
            }
            if(epr instanceof LogicalEPR) {
                final ServiceInvoker invoker = ((LogicalEPR)epr).getServiceInvoker();
                invoker.deliverAsync(message);
            } else {
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.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.