Package org.apache.ode.bpel.dao

Examples of org.apache.ode.bpel.dao.MessageExchangeDAO


        dao.release();
    }


    public Element getSourceEPR(String mexId) {
        MessageExchangeDAO dao = _dao.getConnection().getMessageExchange(mexId);
        String epr = dao.getProperty(MessageExchange.PROPERTY_SEP_PARTNERROLE_EPR);
        if (epr == null)
            return null;
        try {
            Element eepr = DOMUtils.stringToDOM(epr);
            return eepr;
View Full Code Here


        return null;
    }

    public String getSourceSessionId(String mexId) {
        MessageExchangeDAO dao = _dao.getConnection().getMessageExchange(mexId);
        return dao.getProperty(MessageExchange.PROPERTY_SEP_PARTNERROLE_SESSIONID);
    }
View Full Code Here

            __log.debug("MatcherEvent handling: nothing to do, route no longer in DB");
            return;
        }

        // Now see if there is a message that matches this selector.
        MessageExchangeDAO mexdao = correlator.dequeueMessage(ckey);
        if (mexdao != null) {
            __log.debug("MatcherEvent handling: found matching message in DB (i.e. message arrived before <receive>)");

            // We have a match, so we can get rid of the routing entries.
            correlator.removeRoutes(mroute.getGroupId(),_dao);
View Full Code Here

      // Assert MessageExchangeDAO
      CorrelatorDAO ic = inst.getInstantiatingCorrelator();
      assertNotNull(ic);
      assertEquals(ic.getCorrelatorId(),CORRELATOR_ID1);
      // The message is dequeued but not persisted
      MessageExchangeDAO me = ic.dequeueMessage(key1);
      assertNotNull(me);
      assertEquals(me.getCallee(),new QName(TEST_NS,"testCallee"));
      assertEquals(me.getPropagateTransactionFlag(),false);
      assertEquals(me.getChannel(),"testChannel");
      assertEquals(me.getCorrelationId(),"testCorrelationId");
      //assertNotNull(me.getCreateTime());
      assertEquals(me.getDirection(),'0');
      assertNotNull(me.getEPR());
      assertEquals(me.getFault().toString(),"testFault");
      assertEquals(me.getFaultExplanation(),"testFaultExplanation");
      assertSame(me.getInstance(),inst);
      assertEquals(me.getOperation(),"testOperation");
      assertNotNull(me.getPartnerLink());
      assertEquals(me.getPartnerLinkModelId(),1);
      assertEquals(me.getPattern(),"testPattern");
      assertEquals(me.getPortType(),new QName(TEST_NS,"testPortType"));
      assertSame(me.getProcess(),p);
      assertEquals(me.getProperty("testProp1Key"),"testProp1");
      assertNotNull(me.getRequest());
      assertNotNull(me.getResponse());
      assertEquals(me.getStatus(),"testStatus");
     
      // Assert MessageDAO
      MessageDAO m = me.getRequest();
      assertNotNull(m.getData());
      assertSame(m.getMessageExchange(),me);
      assertEquals(m.getType(),new QName(TEST_NS,"testRequest"));
     
     
      //Assert Child ScopeDAO
      assertNotNull(inst.getScopes());
      assertTrue(inst.getScopes().size() > 0);
      assertNotNull(inst.getScopes("Child1"));
      assertTrue(inst.getScopes("Child1").size() == 1);
      ScopeDAO childS = inst.getScopes("Child1").iterator().next();
      assertSame(childS,child1);
      assertSame(childS.getParentScope(),rs);
      assertNotNull(childS.getChildScopes());
      assertEquals(childS.getChildScopes().size(), 0);
      assertNotNull(childS.getVariables());
      assertTrue(childS.getVariables().size() > 0);
      assertNotNull(childS.getVariable("var1"));
      XmlDataDAO chsVar = childS.getVariable("var1");
      assertNotNull(childS.getPartnerLinks());
      assertTrue(childS.getPartnerLinks().size() > 0);
      PartnerLinkDAO spl = childS.getPartnerLinks().iterator().next();
      assertSame(spl,me.getPartnerLink());
      assertSame(spl,childS.getPartnerLink(spl.getPartnerLinkModelId()));
      assertNotNull(childS.getCorrelationSets());
      assertTrue(childS.getCorrelationSets().size() > 0);
      assertNotNull(childS.getCorrelationSet("TestCorrelationSet1"));
     
View Full Code Here

    _ds = null;
        _txm = null;
    }
 
  private MessageExchangeDAO createMessageExchange(ProcessDAO p, ProcessInstanceDAO pi, PartnerLinkDAO pl ) throws SAXException, IOException {
    MessageExchangeDAO me = pi.getConnection().createMessageExchange('0');
   
    me.setCallee(new QName(TEST_NS,"testCallee"));
    me.setChannel("testChannel");
    me.setCorrelationId("testCorrelationId");
    me.setCorrelationStatus("testCorrelationStatus");
    me.setEPR(DOMUtils.stringToDOM("<testEPR>EPR</testEPR>"));
    me.setFault(new QName("testFault"));
    me.setFaultExplanation("testFaultExplanation");
    me.setInstance(pi);
    me.setOperation("testOperation");
    me.setPartnerLink(pl);
    me.setPartnerLinkModelId(1);
    me.setPattern("testPattern");
    me.setPortType(new QName(TEST_NS,"testPortType"));
    me.setProcess(p);
    me.setProperty("testProp1Key", "testProp1");
    me.setProperty("testProp2Key", "testProp2");
    me.setRequest(createMessage(me,"testRequest"));
    me.setResponse(createMessage(me,"testResponse"));
    me.setStatus("testStatus");
   
    return me;
  }
View Full Code Here

    pl1.setMyRoleServiceName(new QName(TEST_NS,"testRoleService"));
    pl1.setMySessionId("TestMySessionID");
    pl1.setPartnerEPR(DOMUtils.stringToDOM("<testEPR>testPartnerEPR</testEPR>"));
    pl1.setPartnerSessionId("TestPartnerSessionID");
   
    MessageExchangeDAO mex = createMessageExchange(process,pi,pl1);
   
    corr.addRoute("testRoute", pi, 1, key1);
    corr.enqueueMessage(mex, corrkeys);
   
    return pi;
View Full Code Here

      // Assert MessageExchangeDAO
      CorrelatorDAO ic = inst.getInstantiatingCorrelator();
      assertNotNull(ic);
      assertEquals(ic.getCorrelatorId(),CORRELATOR_ID1);
      // The message is dequeued but not persisted
      MessageExchangeDAO me = ic.dequeueMessage(key1);
      assertNotNull(me);
      assertEquals(me.getCallee(),new QName(TEST_NS,"testCallee"));
      assertEquals(me.getPropagateTransactionFlag(),false);
      assertEquals(me.getChannel(),"testChannel");
      assertEquals(me.getCorrelationId(),"testCorrelationId");
      //assertNotNull(me.getCreateTime());
      assertEquals(me.getDirection(),'0');
      assertNotNull(me.getEPR());
      assertEquals(me.getFault().toString(),"testFault");
      assertEquals(me.getFaultExplanation(),"testFaultExplanation");
      assertSame(me.getInstance(),inst);
      assertEquals(me.getOperation(),"testOperation");
      assertNotNull(me.getPartnerLink());
      assertEquals(me.getPartnerLinkModelId(),1);
      assertEquals(me.getPattern(),"testPattern");
      assertEquals(me.getPortType(),new QName(TEST_NS,"testPortType"));
      assertSame(me.getProcess(),p);
      assertEquals(me.getProperty("testProp1Key"),"testProp1");
      assertNotNull(me.getRequest());
      assertNotNull(me.getResponse());
      assertEquals(me.getStatus(),"testStatus");
     
      // Assert MessageDAO
      MessageDAO m = me.getRequest();
      assertNotNull(m.getData());
      assertSame(m.getMessageExchange(),me);
      assertEquals(m.getType(),new QName(TEST_NS,"testRequest"));
     
     
      //Assert Child ScopeDAO
      assertNotNull(inst.getScopes());
      assertTrue(inst.getScopes().size() > 0);
      assertNotNull(inst.getScopes("Child1"));
      assertTrue(inst.getScopes("Child1").size() == 1);
      ScopeDAO childS = inst.getScopes("Child1").iterator().next();
      assertSame(childS,child1);
      assertSame(childS.getParentScope(),rs);
      assertNotNull(childS.getChildScopes());
      assertEquals(childS.getChildScopes().size(), 0);
      assertNotNull(childS.getVariables());
      assertTrue(childS.getVariables().size() > 0);
      assertNotNull(childS.getVariable("var1"));
      XmlDataDAO chsVar = childS.getVariable("var1");
      assertNotNull(childS.getPartnerLinks());
      assertTrue(childS.getPartnerLinks().size() > 0);
      PartnerLinkDAO spl = childS.getPartnerLinks().iterator().next();
      assertSame(spl,me.getPartnerLink());
      assertSame(spl,childS.getPartnerLink(spl.getPartnerLinkModelId()));
      assertNotNull(childS.getCorrelationSets());
      assertTrue(childS.getCorrelationSets().size() > 0);
      assertNotNull(childS.getCorrelationSet("TestCorrelationSet1"));
     
View Full Code Here

            return createNewMyRoleMex(template, meps);
        }
    }

    private MyRoleMessageExchange createNewMyRoleMex(BpelProcess target, String clientKey, QName targetService, String operation, String pipedMexId) {
        MessageExchangeDAO dao;
        if (target == null || target.isInMemory()) {
            dao = _contexts.inMemDao.getConnection().createMessageExchange(MessageExchangeDAO.DIR_PARTNER_INVOKES_MYROLE);
        } else {
            dao = _contexts.dao.getConnection().createMessageExchange(MessageExchangeDAO.DIR_PARTNER_INVOKES_MYROLE);
        }
        dao.setCorrelationId(clientKey);
        dao.setCorrelationStatus(CorrelationStatus.UKNOWN_ENDPOINT.toString());
        dao.setPattern(MessageExchangePattern.UNKNOWN.toString());
        dao.setCallee(targetService);
        dao.setStatus(Status.NEW.toString());
        dao.setOperation(operation);
        dao.setPipedMessageExchangeId(pipedMexId);
        MyRoleMessageExchangeImpl mex = new MyRoleMessageExchangeImpl(target, this, dao);

        if (target != null) {
            target.initMyRoleMex(mex);
        }
View Full Code Here

     * @throws BpelEngineException
     */
    private MyRoleMessageExchange createNewMyRoleMex(BpelProcess target, List<MyRoleMessageExchange> meps)
            throws BpelEngineException {
        MyRoleMessageExchangeImpl templateMex = (MyRoleMessageExchangeImpl) meps.get(0);
        MessageExchangeDAO templateMexDao = templateMex.getDAO();
        return new BrokeredMyRoleMessageExchangeImpl(target, this, meps, templateMexDao, templateMex);
    }
View Full Code Here

    public MyRoleMessageExchange createMessageExchange(String clientKey, QName targetService, String operation) {
        return createMessageExchange(clientKey, targetService, operation, null);
    }

    private void setMessageExchangeProcess(String mexId, ProcessDAO processDao) {
        MessageExchangeDAO mexdao = _contexts.inMemDao.getConnection().getMessageExchange(mexId);
        if (mexdao == null) mexdao = _contexts.dao.getConnection().getMessageExchange(mexId);
        if (mexdao != null)
            mexdao.setProcess(processDao);
    }
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.dao.MessageExchangeDAO

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.