Package nexj.core.util

Examples of nexj.core.util.Holder


            {
               work.setValue(attrMapping.getColumn(), null);

               if (obj instanceof SerializablePropertyMap)
               {
                  Holder identitySet = null;

                  for (PropertyIterator itr = ((SerializablePropertyMap)obj).getIterator(); itr.hasNext();)
                  {
                     itr.next();
View Full Code Here


   {
      verifyNotReadOnly();

      if (m_dependency != null)
      {
         Holder set = new IdentityHashHolder();

         set.add(this);
         verifyDependency(m_metaclass, m_dependency, set);

         List stack = new ArrayList();

         stack.add(this);
View Full Code Here

   /**
    * @see nexj.core.meta.ui.AttributeMeta#getReadPrivilegeOrdinals()
    */
   public Holder getReadPrivilegeOrdinals()
   {
      Holder set = new HashHolder(2);

      if (m_readPrivilege != null && m_readPrivilege.getOrdinal() >= 0)
      {
         set.add(Primitive.createInteger(m_readPrivilege.getOrdinal()));
      }
     
      if (m_type instanceof ClassMeta)
      {
         if (((ClassMeta)m_type).getReadPrivilegeOrdinal() >= 0)
         {
            set.add(Primitive.createInteger(((ClassMeta)m_type).getReadPrivilegeOrdinal()));
         }
      }

      if (set.size() == 0)
      {
         return null;
      }
     
      return set;
View Full Code Here

      int nSize = m_updateMappingSet.size();
      List updateList = new ArrayList(nSize);
      BitSet updateSet = (BitSet)updateAttributeSet.clone();

      // Compute cover
      Holder potentialMappingSet = new HashHolder(nSize);

      for (int i = 0; i < nSize; i++)
      {
         potentialMappingSet.add(m_updateMappingSet.get(i));
      }

      boolean bSelectUnbatchable = false;

      while (!(potentialMappingSet.isEmpty() || updateSet.isEmpty()))
      {
         int nBestScore = 0;
         UpdateMappingCase bestMapping = null;

         for (Iterator itr = potentialMappingSet.iterator(); itr.hasNext(); )
         {
            UpdateMappingCase candidateMapping = (UpdateMappingCase)itr.next();

            if (candidateMapping.isBatch() ^ bSelectUnbatchable)
            {
               BitSet candidateSet = (BitSet)candidateMapping.getAttributeSet().clone();

               candidateSet.and(updateSet);

               int nScore = candidateSet.cardinality();

               if (nScore > nBestScore)
               {
                  nBestScore = nScore;
                  bestMapping = candidateMapping;
               }
            }
         }

         if (bestMapping != null)
         {
            potentialMappingSet.remove(bestMapping);
            updateList.add(bestMapping);
            updateSet.andNot(bestMapping.getAttributeSet());
         }
         else
         {
View Full Code Here

    *
    * @return The set of in-doubt transaction Xids.
    */
   protected synchronized Holder recoverInternal()
   {
      Holder indoubtSet = new HashHolder();
      RecordIterator itr = new RecordIterator(m_journal);

      while (itr.hasNext())
      {
         GenericJournalRecord currentRec = (GenericJournalRecord)itr.next();
         Xid currentXid = currentRec.getXid();

         if (s_logger.isDumpEnabled())
         {
            s_logger.dump("Recovering record: " + currentRec);
         }

         if (currentRec.getOpCode() == JournalRecordPrepared.OPCODE)
         {
            indoubtSet.add(currentXid);
         }
         else if (currentRec.getOpCode() == JournalRecordCompleted.OPCODE)
         {
            indoubtSet.remove(currentXid);
         }
      }

      if (s_logger.isDebugEnabled())
      {
View Full Code Here

      };

      forEachMixin(baseMetaFolderURL, mixinElementHandler);
      forEachMixin(rootElement, mixinElementHandler);

      Holder registeredList = new HashHolder(mixinSet.size());

      while (!mixinSet.isEmpty())
      {
         Pair p = (Pair)mixinSet.removeFirst();

         if (registeredList.add(p))
         {
            String sNamespace = (String)p.getHead();

            p = p.getNext();
            forEachMixin(handler.handle(sNamespace, (String)p.getHead(), (String)p.getTail()), mixinElementHandler);
View Full Code Here

    * inheritance resolution shall be performed.
    */
   public static void resolveInheritance(Iterator txfIterator)
   {
      MetadataCompoundValidationException comp = null;
      Holder circularTxfSet = new IdentityHashHolder();
      Holder resolvedTxfSet = new IdentityHashHolder();

      while (txfIterator.hasNext())
      {
         Transformation transformation = (Transformation)txfIterator.next();

         circularTxfSet.add(transformation);

         if (transformation.m_base == null)
         {
            try
            {
               transformation.resolveInheritance(resolvedTxfSet);
            }
            catch (UncheckedException ex)
            {
               if (comp == null)
               {
                  comp = new MetadataCompoundValidationException();
               }

               transformation.addException(comp, ex);
            }
         }
      }

      // Inheritance cycles have no transformation where m_base == null, so they are never resolved.
      if (circularTxfSet.size() != resolvedTxfSet.size())
      {
         circularTxfSet.removeAll(resolvedTxfSet);

         if (comp == null)
         {
View Full Code Here

    * order they are resolved. Can be null.
    */
   public static void resolveInheritance(Iterator msgIterator, List sortedMessageList)
   {
      MetadataCompoundValidationException comp = null;
      Holder circularMessageSet = new IdentityHashHolder();
      Holder resolvedMessageSet = new IdentityHashHolder();

      while (msgIterator.hasNext())
      {
         Message message = (Message)msgIterator.next();

         circularMessageSet.add(message);

         // Process inheritance starting on the root messages.
         if (message.m_base == null)
         {
            try
            {
               message.resolveInheritance(resolvedMessageSet, sortedMessageList);
            }
            catch (UncheckedException ex)
            {
               if (comp == null)
               {
                  comp = new MetadataCompoundValidationException();
               }

               message.addException(comp, ex);
            }
         }
      }

      // Inheritance cycles have no message where m_base == null, so they are never resolved.
      if (circularMessageSet.size() != resolvedMessageSet.size())
      {
         circularMessageSet.removeAll(resolvedMessageSet);

         if (comp == null)
         {
View Full Code Here

TOP

Related Classes of nexj.core.util.Holder

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.