Package nexj.core.util

Examples of nexj.core.util.HashTab


      {
         loader.addIOFixup(new XMLMetadataHelper.ContextFixup(loader.getHelper())
         {
            public void fixup()
            {
               Lookup aliasQueueMap = new HashTab();

               for (Iterator itr = loader.getMetadata().getChannelIterator(); itr.hasNext(); )
               {
                  Channel channel = (Channel)itr.next();

                  if (channel instanceof MessageQueue)
                  {
                     MessageQueue queue = (MessageQueue)channel;
                     MessageQueue oldQueue = (MessageQueue)aliasQueueMap.put(queue.getAlias(), queue);

                     if (oldQueue == null)
                     {
                        queue.setFirst(true);
                     }
                     else
                     {
                        queue.setFirst(false);
                        aliasQueueMap.put(queue.getAlias(), oldQueue);

                        if (!ObjUtil.equal(queue.getDestination(), oldQueue.getDestination()))
                        {
                           throw new MetadataValidationException("err.meta.integration.mq.destinationMismatch",
                              new Object[]{queue.getName(), oldQueue.getName(), queue.getAlias()});
View Full Code Here


      {
         loader.addIOFixup(new XMLMetadataHelper.ContextFixup(loader.getHelper())
         {
            public void fixup()
            {
               Lookup aliasMailMap = new HashTab();

               for (Iterator itr = loader.getMetadata().getChannelIterator(); itr.hasNext(); )
               {
                  Channel channel = (Channel)itr.next();

                  if (channel instanceof Mail)
                  {
                     Mail mailChannel = (Mail)channel;
                     Mail oldMailChannel = (Mail)aliasMailMap.put(mailChannel.getAlias(), mailChannel);

                     if (oldMailChannel == null)
                     {
                        mailChannel.setFirst(true);
                     }
                     else
                     {
                        mailChannel.setFirst(false);
                        aliasMailMap.put(mailChannel.getAlias(), oldMailChannel);

                        MetadataValidationException e = new MetadataValidationException(
                           "err.meta.mail.duplicateAlias", new Object[]{mailChannel.getName(), oldMailChannel.getName()});

                        mailChannel.setProperties(e);
View Full Code Here

            attrMap.put(head, head);
         }
         else if (head instanceof Pair)
         {
            Pair subAttrList = (Pair)head;
            Lookup subAttrMap = new HashTab();

            if (!(subAttrList.getHead() instanceof Symbol))
            {
               throw new IllegalStateException();
            }
View Full Code Here

    * @param nTF Combination of TF_* flags.
    * @return The converted object.
    */
   public static Object transfer(Object obj, Pair attributes, int nTF)
   {
      return transfer(obj, attributes, null, new HashTab(), nTF);
   }
View Full Code Here

               }
            }
         }
      }

      Lookup out = new HashTab(valueInvDepMap.keyCount());

      // Transfer to a map of arrays
      for (Lookup.Iterator it = valueInvDepMap.iterator(); it.hasNext();)
      {
         AttributeMeta key = (AttributeMeta)it.next();
         Collection col = (Collection)it.getValue();

         out.put(key, col.toArray(new AttributeMeta[col.size()]));
      }

      return out;
   }
View Full Code Here

         {
            s_logger.debug("Formatting object message \"" + composite.getName() + "\"");
            s_logger.dump(tobj);
         }

         m_instanceByTobjMap = new HashTab();
         m_invocationList = new ArrayList();
         m_queryMap = new HashTab2D();
         m_infoObjectByTobjMap = new HashTab();

         Object obj = (composite.isCollection()) ? Collections.singletonList(tobj) : (Object)tobj;

         prepareFind(obj, composite);
         logEvent(Logger.DUMP, "ids.sync.formattingStarted");
View Full Code Here

         }
         else
         {
            s_logger.debug("Error processing the composite message; trying to process it in chunks", e);

            Lookup objectParts = getObjectParts(tobj, message.getRoot(), new HashTab());
            CompoundIntegrationException ex = new CompoundIntegrationException(e.getMessage());

            out.setObject(new FailSafeFormatter(ex, bCommit).divideAndFormat(objectParts));

            if (ex.getExceptionCount() > 0)
View Full Code Here

      public Collection divideAndFormat(Lookup objectParts)
      {
         int nMapSize = objectParts.size();
         Collection result = new ArrayList(nMapSize);
         int nChunkSize = (nMapSize + CHUNK_COUNT - 1) / CHUNK_COUNT;
         Lookup chunk = new HashTab(nChunkSize);

         if (s_logger.isDebugEnabled())
         {
            s_logger.debug("Dividing message of size " + objectParts.size() + " into chunks of size " + nChunkSize);
         }

         for (Lookup.Iterator itr = objectParts.iterator(); itr.hasNext(); )
         {
            chunk.put(itr.next(), itr.getValue());
           
            if (chunk.size() == nChunkSize)
            {
               result.addAll(formatChunk(chunk, 0));
               chunk.clear();
            }
         }

         result.addAll(formatChunk(chunk, 0));
View Full Code Here

      {
         if (m_nRefState == WEAK_REF)
         {
            cleanup();

            Lookup map = new HashTab(m_instanceArray.length);
            boolean bLazy = ((WeakKeyTab)m_instanceMap).m_bLazy;
            int i, k;

            for (i = k = 0; i < m_nCount; ++i)
            {
               Instance instance = m_instanceArray[i].getInstance();

               if (instance != null)
               {
                  map.put(instance, Primitive.createInteger(k));
                  m_instanceArray[k] = instance;
                  ++k;
               }
               else
               {
View Full Code Here

         if ((nFlags & TRACK) != 0 && !m_container.isLoading())
         {
            if (m_changeMap == null)
            {
               m_changeMap = new HashTab(4);
            }

            UnitOfWork uow = m_container.getInvocationContext().getUnitOfWork();
            Change change = new Change(true, uow);

            oldChange = (Change)m_changeMap.put(instance, change);

            if (oldChange != null)
            {
               if (oldChange.uow != uow)
               {
                  m_changeMap.put(instance, oldChange);

                  throw new WorkStateException("err.runtime.collectionChange",
                     new Object[]{m_attribute.getName(), m_container.getLazyClassName()});
               }

               if (!oldChange.added)
               {
                  m_changeMap.remove(instance);
               }
            }
            else
            {
               uow.addChange(this);
            }
         }
      }

      InstanceHolder holder = instance;

      if ((nFlags & WEAK) != 0 && m_nRefState != STRONG_REF)
      {
         if (m_instanceMap == null)
         {
            m_instanceMap = new WeakKeyTab(m_instanceArray.length);
            m_nRefState = WEAK_REF;
         }

         holder = new Ref(instance, ((WeakKeyTab)m_instanceMap).m_refq);
      }
      else
      {
         if (m_instanceMap == null)
         {
            m_instanceMap = new HashTab(m_instanceArray.length);
            m_nRefState = STRONG_REF;
         }
         else if (m_nRefState != STRONG_REF)
         {
            if (nOrdinal == m_nCount)
View Full Code Here

TOP

Related Classes of nexj.core.util.HashTab

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.