Examples of MsgUnitWrapper


Examples of org.xmlBlaster.engine.MsgUnitWrapper

   /**
    * @return true if no MsgUnitWrapper is found (the 'meat' is not available anymore)<br />
    *         or for msgUnitWrapper in state=DESTROYED
    */
   public boolean isDestroyed() {
      MsgUnitWrapper msgUnitWrapper = getMsgUnitWrapper();
      if (msgUnitWrapper == null)
         return true;
      return msgUnitWrapper.isDestroyed();
   }
View Full Code Here

Examples of org.xmlBlaster.engine.MsgUnitWrapper

    * Gets the message unit but is for read only (dirty read)
    * @return null if expired->destroyed
    * @throws XmlBlasterException
    */
   public MsgUnit getMsgUnitOrNull() {
      MsgUnitWrapper msgUnitWrapper = getMsgUnitWrapper();
      if (msgUnitWrapper == null) {
         return null;
      }
      return msgUnitWrapper.getMsgUnit();
   }
View Full Code Here

Examples of org.xmlBlaster.engine.MsgUnitWrapper

    * Gets the message unit but is for read only (dirty read)
    * @return
    * @throws XmlBlasterException if not found (e.g. forceDestroy and expired)
    */
   public MsgUnit getMsgUnit() throws XmlBlasterException {
      MsgUnitWrapper msgUnitWrapper = getMsgUnitWrapper();
      if (msgUnitWrapper == null) {
         throw new XmlBlasterException(glob, ErrorCode.INTERNAL_UNKNOWN, ME, "Message " + getUniqueId() + " not found");
      }
      return msgUnitWrapper.getMsgUnit();
   }
View Full Code Here

Examples of org.xmlBlaster.engine.MsgUnitWrapper

      try {
         SessionName receiver = new SessionName(glob, "receiver1");
         PublishQosServer publishQosServer = new PublishQosServer(glob, "<qos/>");
         MsgUnit msgUnit = new MsgUnit(glob, "<key oid='XX'/>", new byte[0], publishQosServer.toXml());
         org.xmlBlaster.engine.ServerScope global = new org.xmlBlaster.engine.ServerScope();
         MsgUnitWrapper msgWrapper = new MsgUnitWrapper(glob, msgUnit, storageId);

         int step = 1000;
         int numCreate = 1000000;
         MsgQueueUpdateEntry entryArr[] = new MsgQueueUpdateEntry[numCreate];
         for(int i=0; i<numCreate; i++) {
            entryArr[i] = new MsgQueueUpdateEntry(global, msgWrapper, storageId,
                                             receiver, "__subId", false);
            MsgUnitWrapper w = entryArr[i].getMsgUnitWrapper();
            if ((i % step) == 0) {
               log.info("Overall created #" + i + ": Created " + step + " new MsgQueueUpdateEntry instances, hit a key to create more ...");
               try { System.in.read(); } catch(java.io.IOException e) {}
            }
            if (log.isLoggable(Level.FINE)) log.fine("Dump meat: " + w.toXml());
         }
         //log.info("entry=" + entryArr[0].toXml());
         //log.info("sizeInBytes=" + entryArr[0].getSizeInBytes() + " msgUnit.size()=" + msgUnit.size());
         //log.info("Created " + numCreate + " MsgQueueUpdateEntry instances, hit a key to create more ...");
         //try { System.in.read(); } catch(java.io.IOException e) {}
View Full Code Here

Examples of org.xmlBlaster.engine.MsgUnitWrapper

      StorageId storageId = new StorageId(glob, Constants.RELATING_HISTORY, "historyEntry");
      try {
         PublishQosServer publishQosServer = new PublishQosServer(glob, "<qos/>");
         MsgUnit msgUnit = new MsgUnit(glob, "<key oid='XX'/>", new byte[0], publishQosServer.toXml());
         org.xmlBlaster.engine.ServerScope global = new org.xmlBlaster.engine.ServerScope();
         MsgUnitWrapper msgWrapper = new MsgUnitWrapper(glob, msgUnit, storageId);

         int step = 1000;
         int numCreate = 1000000;
         MsgQueueHistoryEntry entryArr[] = new MsgQueueHistoryEntry[numCreate];
         for(int i=0; i<numCreate; i++) {
            entryArr[i] = new MsgQueueHistoryEntry(global, msgWrapper, storageId);
            MsgUnitWrapper w = entryArr[i].getMsgUnitWrapper();
            if ((i % step) == 0) {
               log.info("Overall created #" + i + ": Created " + step + " new MsgQueueHistoryEntry instances, hit a key to create more ...");
               try { System.in.read(); } catch(java.io.IOException e) {}
            }
            if (log.isLoggable(Level.FINE)) log.fine("Dump meat: " + w.toXml());
         }
      }
      catch (XmlBlasterException ex) {         
         ex.printStackTrace();
         log.severe("exception occured : " + ex.getMessage());
View Full Code Here

Examples of org.xmlBlaster.engine.MsgUnitWrapper

         PublishQosServer publishQosServer = new PublishQosServer(glob, "<qos/>");
         StorageId storageId = new StorageId(glob, Constants.RELATING_MSGUNITSTORE, "msgUnitWrapperEntry");

         int step = 1000;
         int numCreate = 1000000;
         MsgUnitWrapper entryArr[] = new MsgUnitWrapper[numCreate];
         log.info("Hit a key for new MsgUnitWrapper RAM size test ...");
         try { System.in.read(); } catch(java.io.IOException e) {}
         for(int i=0; i<numCreate; i++) {
            MsgUnit msgUnit = new MsgUnit(glob, "<key oid='XX'/>", new byte[0], publishQosServer.toXml());
            entryArr[i] = new MsgUnitWrapper(glob, msgUnit, storageId);
            if (i > 0 && (i % step) == 0) {
               log.info("Overall created #" + i + ": Created " + step + " new MsgUnitWrapper instances, msgUnitSize=" + msgUnit.size() + ", hit a key to create more ...");
               try { System.in.read(); } catch(java.io.IOException e) {}
            }
         }
View Full Code Here

Examples of org.xmlBlaster.engine.MsgUnitWrapper

      {
         for (int i=0; i<msgArr_.length; i++) {
            MsgQueueUpdateEntry entry = (MsgQueueUpdateEntry)msgArr_[i];

            MsgUnitWrapper msgUnitWrapper = entry.getMsgUnitWrapper();
            if (msgUnitWrapper == null) {
               if (log.isLoggable(Level.FINE)) log.fine(ME+": doSend("+entry.getLogId()+") ignoring callback message as no meat is available (assume expired)");
               entry.setReturnObj(new UpdateReturnQosServer(this.glob, Constants.RET_EXPIRED)); //"<qos><state id='EXPIRED'/></qos>";
               continue;
            }
            if (msgUnitWrapper.getMsgQosData().isPtp() && session!=null && !session.getConnectQos().isPtpAllowed()) {
               if (log.isLoggable(Level.FINE)) log.fine(ME+": doSend("+entry.getLogId()+") ignoring callback message as PtP is not wanted");
               entry.setReturnObj(new UpdateReturnQosServer(this.glob, Constants.RET_ERASED));
               continue;
            }

            MsgUnit mu = msgUnitWrapper.getMsgUnit();
            //MsgUnit mu = entry.getMsgUnit(); throws unwanted exception if meat==null (forceDestroy)
            MsgQosData msgQosData = (MsgQosData)mu.getQosData().clone();
            msgQosData.setTopicProperty(null);
            msgQosData.setState(entry.getState());
            msgQosData.setSubscriptionId(entry.getSubscriptionId());
View Full Code Here

Examples of org.xmlBlaster.engine.MsgUnitWrapper

      ArrayList entriesWithNoDistributor = new ArrayList();
      for (int i=0; i < entries.size(); i++) {
         Object obj = entries.get(i);
         if (!(obj instanceof MsgQueueUpdateEntry)) return entries; // Can be removed, was to distinguish client side code which is not necessary anymore (as we are the server side implementation)
         MsgQueueUpdateEntry entry = (MsgQueueUpdateEntry)obj;
         MsgUnitWrapper wrapper = entry.getMsgUnitWrapper();
         boolean hasMsgDistributor = wrapper.getServerScope().getTopicAccessor().hasMsgDistributorPluginDirtyRead(wrapper.getKeyOid());
        
         if (hasMsgDistributor) {
            if (ex != null) { // in this case it is possible that retObj is not set yet
               UpdateReturnQosServer retQos = (UpdateReturnQosServer)entry.getReturnObj();              
               try {
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.