Package org.apache.sandesha2.storage

Examples of org.apache.sandesha2.storage.SandeshaStorageException


  public void updateMessageContext(String key,MessageContext msgContext) throws SandeshaStorageException {
    HashMap storageMap = (HashMap) getContext().getProperty(MESSAGE_MAP_KEY);
   
    if (storageMap==null) {
      throw new SandeshaStorageException (SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.storageMapNotPresent));
    }
   
    Object oldEntry = storageMap.get(key);
    if (oldEntry==null)
      throw new SandeshaStorageException (SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.entryNotPresentForUpdating));
   
    HashMap envMap = (HashMap) getContext().getProperty(ENVELOPE_MAP_KEY);

    storageMap.remove(key);
View Full Code Here


      Thread key = Thread.currentThread();
      t = (InMemoryTransaction) transactions.get(key);
      if(t == null) {
        // We attempted to do some work without a transaction in scope
        String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noTransaction);
        SandeshaStorageException e = new SandeshaStorageException(message);
        if(log.isDebugEnabled()) log.debug(message, e);
        throw e;
      }
    }
    t.enlist(bean);
View Full Code Here

      }
    } catch (Exception e) {
      String message = SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.failedToLoadMessage, e.toString());
      if(log.isDebugEnabled()) log.debug(message);
      throw new SandeshaStorageException(message, e);
    }

    if(log.isDebugEnabled()) log.debug("Exit: InMemoryStorageManager::retrieveMessageContext, " + messageContext);
    return messageContext;
  }
View Full Code Here

      }
    } catch(Exception e) {
      String message = SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.failedToStoreMessage, e.toString());
      if(log.isDebugEnabled()) log.debug(message);
      throw new SandeshaStorageException(message, e);
    }
   
    if(log.isDebugEnabled()) log.debug("Exit: InMemoryStorageManager::storeMessageContext, key: " + key);
  }
View Full Code Here

  public void updateMessageContext(String key,MessageContext msgContext) throws SandeshaStorageException {
    if(log.isDebugEnabled()) log.debug("Enter: InMemoryStorageManager::updateMessageContext, key: " + key);

    Object oldEntry = storageMap.remove(key);
    if (oldEntry==null)
      throw new SandeshaStorageException (SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.entryNotPresentForUpdating));
   
    storeMessageContext(key,msgContext);

    if(log.isDebugEnabled()) log.debug("Exit: InMemoryStorageManager::updateMessageContext, key: " + key);
View Full Code Here

      RMBean rmBean = (RMBean) iter.next();
     
      List conflicts = find(rmBean);
      if (conflicts.size()>0) {
        //we only report the first conflict here.
        throw new SandeshaStorageException ("Key conflict occured with the bean " + conflicts.get(0));
      }
    }
  }
View Full Code Here

    return (SenderBean) super.retrieve(MessageId);
  }

  public boolean insert(SenderBean bean) throws SandeshaStorageException {
    if (bean.getMessageID() == null)
      throw new SandeshaStorageException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.nullMsgId));
   
    //checking weather there are any conflicting entries in the current table.
    List findBeanList = new ArrayList ();
   
View Full Code Here

            HashSet set = new HashSet();
            set.add(this);
            while(other != null) {
              if(set.contains(other)) {
                String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.deadlock, this.toString(), bean.toString());
                SandeshaStorageException e = new SandeshaStorageException(message);
               
                // Do our best to get out of the way of the other work in the system
                waitingForTran = null;
                releaseLocks();
               
View Full Code Here

    return (SenderBean) table.get(MessageId);
  }

  public synchronized boolean insert(SenderBean bean) throws SandeshaStorageException {
    if (bean.getMessageID() == null)
      throw new SandeshaStorageException("Key (MessageId) is null. Cant insert.");
    table.put(bean.getMessageID(), bean);
    return true;
  }
View Full Code Here

  public void updateMessageContext(String key,MessageContext msgContext) throws SandeshaStorageException {
    HashMap storageMap = (HashMap) getContext().getProperty(MESSAGE_MAP_KEY);
   
    if (storageMap==null) {
      throw new SandeshaStorageException ("Storage Map not present");
    }
   
    Object oldEntry = storageMap.get(key);
    if (oldEntry==null)
      throw new SandeshaStorageException ("Entry is not present for updating");
   
    storeMessageContext(key,msgContext);
  }
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.storage.SandeshaStorageException

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.