Package org.apache.sandesha2.storage.beans

Examples of org.apache.sandesha2.storage.beans.InvokerBean


        assertTrue(tmp.getMessageContextRefKey().equals("Key4"));
    }

    public void testRetrieve() throws SandeshaStorageException {
        assertNull(mgr.retrieve("Key5"));
        mgr.insert(new InvokerBean("Key5", 1004, "SeqId5"));
        assertNotNull(mgr.retrieve("Key5"));
    }
View Full Code Here


        mgr.insert(new InvokerBean("Key5", 1004, "SeqId5"));
        assertNotNull(mgr.retrieve("Key5"));
    }

    public void testUpdate() throws SandeshaStorageException {
        InvokerBean bean = new InvokerBean("Key6", 1006, "SeqId6");
        mgr.insert(bean);
        bean.setMsgNo(1007);
        mgr.update(bean);
        InvokerBean tmp = mgr.retrieve("Key6");
        assertTrue(tmp.getMsgNo() == 1007);
    }
View Full Code Here

           
            throw new SandeshaException(message);
          }

          Iterator stMapIt = storageMapMgr.find(
              new InvokerBean(null, nextMsgno, sequenceId))
              .iterator();
         
          boolean invoked = false;
         
          while (stMapIt.hasNext()) {

            InvokerBean stMapBean = (InvokerBean) stMapIt
                .next();
            String key = stMapBean.getMessageContextRefKey();


            MessageContext msgToInvoke = storageManager.retrieveMessageContext(key,context);

            RMMsgContext rmMsg = MsgInitializer
View Full Code Here

  public synchronized Collection find(InvokerBean bean) {
    ArrayList beans = new ArrayList();
    Iterator iterator = table.values().iterator();

    InvokerBean temp = new InvokerBean();
    while (iterator.hasNext()) {
      temp = (InvokerBean) iterator.next();
      boolean select = true;

      if (bean.getMessageContextRefKey() != null && !bean.getMessageContextRefKey().equals(temp.getMessageContextRefKey()))
        select = false;

      if (bean.getMsgNo() != 0 && bean.getMsgNo() != temp.getMsgNo())
        select = false;

      if (bean.getSequenceID() != null
          && !bean.getSequenceID().equals(temp.getSequenceID()))
        select = false;
     
      if (bean.isInvoked()!=temp.isInvoked())
        select = false;

      if (select)
        beans.add(temp);
    }
View Full Code Here

  public static void cleanReceivingSideAfterInvocation (ConfigurationContext configContext, String sequenceID) throws SandeshaException {
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configContext);
    InvokerBeanMgr storageMapBeanMgr = storageManager.getStorageMapBeanMgr();
       
    //removing storageMap entries
    InvokerBean findStorageMapBean = new InvokerBean ();
    findStorageMapBean.setSequenceID(sequenceID);
    findStorageMapBean.setInvoked(true);
    Collection collection = storageMapBeanMgr.find(findStorageMapBean);
    Iterator iterator = collection.iterator();
    while (iterator.hasNext()) {
      InvokerBean storageMapBean = (InvokerBean) iterator.next();
      storageMapBeanMgr.delete(storageMapBean.getMessageContextRefKey());
    }
   
    String cleanStatus = (String) receivingSideCleanMap.get(sequenceID);
    if (cleanStatus!=null && CLEANED_ON_TERMINATE_MSG.equals(cleanStatus))
      completeTerminationOfReceivingSide(configContext,sequenceID);
View Full Code Here

      //saving the message.
      try {
        storageManager.storeMessageContext(key,rmMsgCtx
            .getMessageContext());
        storageMapMgr.insert(new InvokerBean(key, msgNo, sequenceId));

        //This will avoid performing application processing more
        // than
        // once.
        rmMsgCtx.setProperty(
View Full Code Here

    public void tearDown() throws Exception {
      transaction.commit();
    }

    public void testDelete() throws SandeshaStorageException {
        mgr.insert(new InvokerBean("Key1", 1001, "SeqId1"));
        mgr.delete("Key1");
        assertNull(mgr.retrieve("Key1"));
    }
View Full Code Here

        mgr.delete("Key1");
        assertNull(mgr.retrieve("Key1"));
    }

    public void testFind() throws SandeshaStorageException {
        mgr.insert(new InvokerBean("Key2", 1002, "SeqId2"));
        mgr.insert(new InvokerBean("Key3", 1003, "SeqId2"));

        InvokerBean bean = new InvokerBean();
        bean.setSequenceID("SeqId2");

        Iterator<InvokerBean> iter = mgr.find(bean).iterator();
        InvokerBean tmp = (InvokerBean) iter.next();

        if (tmp.getMessageContextRefKey().equals("Key2")) {
            tmp = (InvokerBean) iter.next();
            assertTrue(tmp.getMessageContextRefKey().equals("Key3"));
        } else {
            tmp = (InvokerBean) iter.next();
            assertTrue(tmp.getMessageContextRefKey().equals("Key2"));

        }
    }
View Full Code Here

        }
    }

    public void testInsert() throws SandeshaStorageException {
        mgr.insert(new InvokerBean("Key4", 1004, "SeqId4"));
        InvokerBean tmp = mgr.retrieve("Key4");
        assertTrue(tmp.getMessageContextRefKey().equals("Key4"));
    }
View Full Code Here

        assertTrue(tmp.getMessageContextRefKey().equals("Key4"));
    }

    public void testRetrieve() throws SandeshaStorageException {
        assertNull(mgr.retrieve("Key5"));
        mgr.insert(new InvokerBean("Key5", 1004, "SeqId5"));
        assertNotNull(mgr.retrieve("Key5"));
    }
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.storage.beans.InvokerBean

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.