Examples of RMBean


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

    }
    return true;
  }

  protected boolean delete(Object key) throws SandeshaStorageException {
    RMBean bean = null;
    synchronized (table) {
      bean = (RMBean) table.get(key);
    }
    if(bean != null) {
      mgr.enlistBean(bean);
View Full Code Here

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

    }
    return bean != null;
  }

  protected RMBean retrieve(Object key) throws SandeshaStorageException {
    RMBean bean = null;
    synchronized (table) {
      bean = (RMBean) table.get(key);
    }
    if(bean != null) {
      mgr.enlistBean(bean);
View Full Code Here

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

    return bean;
  }

  protected boolean update(Object key, RMBean bean) throws SandeshaStorageException {
    mgr.enlistBean(bean);
    RMBean oldBean = null;
    synchronized (table) {
      oldBean = (RMBean) table.get(key);
      table.put(key, bean);
    }
    if(oldBean == null) return false;
View Full Code Here

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

      if(matchInfo == null) {
        beans.addAll(table.values());
      } else {
        Iterator i = table.values().iterator();
        while(i.hasNext()) {
          RMBean candidate = (RMBean)i.next();
          if(candidate.match(matchInfo)) {
            beans.add(candidate);
          }
        }
      }
    }
   
    // Now we have a point-in-time view of the beans, lock them all
    Iterator i = beans.iterator();
    while(i.hasNext()) mgr.enlistBean((RMBean) i.next());
   
    // Finally remove any beans that are no longer in the table
    synchronized (table) {
      i = beans.iterator();
      while(i.hasNext()) {
        RMBean bean = (RMBean) i.next();
        if(!table.containsValue(bean)) {
          i.remove();
        }
      }
    }
View Full Code Here

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

    return beans;
  }

  protected RMBean findUnique (RMBean matchInfo) throws SandeshaException {
    RMBean result = null;
    synchronized (table) {
      Iterator i = table.values().iterator();
      while(i.hasNext()) {
        RMBean candidate = (RMBean)i.next();
        if(candidate.match(matchInfo)) {
          if(result == null) {
            result = candidate;
          } else {
            String message = SandeshaMessageHelper.getMessage(
                SandeshaMessageKeys.nonUniqueResult,
                result.toString(),
                candidate.toString());
            log.error(message);
            throw new SandeshaException (message);
          }
        }
      }
View Full Code Here

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

    if(log.isDebugEnabled()) log.debug("Entry: InMemoryTransaction::releaseLocks, " + this);
    manager.removeTransaction(this);

    Iterator beans = enlistedBeans.iterator();
    while(beans.hasNext()) {
      RMBean bean = (RMBean) beans.next();
      synchronized (bean) {
        bean.setTransaction(null);
        bean.notify();
      }
    }
    enlistedBeans.clear();
   
    if(log.isDebugEnabled()) log.debug("Exit: InMemoryTransaction::releaseLocks");
View Full Code Here

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

    }
    return true;
  }

  protected boolean delete(Object key) throws SandeshaStorageException {
    RMBean bean = null;
    synchronized (table) {
      bean = (RMBean) table.get(key);
    }
    if(bean != null) {
      mgr.enlistBean(bean);
View Full Code Here

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

    }
    return bean != null;
  }

  protected RMBean retrieve(Object key) throws SandeshaStorageException {
    RMBean bean = null;
    synchronized (table) {
      bean = (RMBean) table.get(key);
    }
    if(bean != null) {
      mgr.enlistBean(bean);
View Full Code Here

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

    return bean;
  }

  protected boolean update(Object key, RMBean bean) throws SandeshaStorageException {
    mgr.enlistBean(bean);
    RMBean oldBean = null;
    synchronized (table) {
      oldBean = (RMBean) table.get(key);
      table.put(key, bean);
    }
    if(oldBean == null) return false;
View Full Code Here

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

      if(matchInfo == null) {
        beans.addAll(table.values());
      } else {
        Iterator i = table.values().iterator();
        while(i.hasNext()) {
          RMBean candidate = (RMBean)i.next();
          if(candidate.match(matchInfo)) {
            beans.add(candidate);
          }
        }
      }
    }
   
    // Now we have a point-in-time view of the beans, lock them all
    Iterator i = beans.iterator();
    while(i.hasNext()) mgr.enlistBean((RMBean) i.next());
   
    // Finally remove any beans that are no longer in the table
    synchronized (table) {
      i = beans.iterator();
      while(i.hasNext()) {
        RMBean bean = (RMBean) i.next();
        if(!table.containsValue(bean)) {
          i.remove();
        }
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.