Examples of CachingMetaDataContext


Examples of org.jboss.metadata.plugins.context.CachingMetaDataContext

      super(name);
   }

   protected MetaDataContext createContext(MetaDataContext parent, List<MetaDataRetrieval> retrievals)
   {
      return new CachingMetaDataContext(parent, retrievals);
   }
View Full Code Here

Examples of org.jboss.metadata.plugins.context.CachingMetaDataContext

      super(name);
   }

   protected MetaDataContext createContext(MetaDataContext parent, List<MetaDataRetrieval> retrievals)
   {
      return new CachingMetaDataContext(parent, retrievals, getFactory());
   }
View Full Code Here

Examples of org.jboss.metadata.plugins.context.CachingMetaDataContext

      super(name);
   }

   protected MetaDataContext createContext(MetaDataContext parent, List<MetaDataRetrieval> retrievals)
   {
      return new CachingMetaDataContext(parent, retrievals, getFactory());
   }
View Full Code Here

Examples of org.jboss.metadata.plugins.context.CachingMetaDataContext

      super(name);
   }

   protected MetaDataContext createContext(MetaDataContext parent, List<MetaDataRetrieval> retrievals)
   {
      return new CachingMetaDataContext(parent, retrievals);
   }
View Full Code Here

Examples of org.jboss.metadata.plugins.context.CachingMetaDataContext

      super(name, true);
   }

   protected MetaData setupMetaData(MetaDataLoader loader)
   {
      CachingMetaDataContext context = createContext(loader);
      return new MetaDataRetrievalToMetaDataBridge(context);
   }
View Full Code Here

Examples of org.jboss.metadata.plugins.context.CachingMetaDataContext

      return new MetaDataRetrievalToMetaDataBridge(context);
   }

   protected CachingMetaDataContext createContext(MetaDataLoader loader)
   {
      return new CachingMetaDataContext(null, loader);
   }
View Full Code Here

Examples of org.jboss.metadata.plugins.context.CachingMetaDataContext

      int size = mix ? 10 : 6;
      MetaDataContext[] contexts = new MetaDataContext[size];
      contexts[0] = new AbstractMetaDataContext(retrievals[0]);
      contexts[1] = new AbstractMetaDataContext(contexts[0], retrievals[1]);
      contexts[2] = new AbstractMetaDataContext(contexts[0], Arrays.asList(retrievals));
      contexts[3] = new CachingMetaDataContext(contexts[0]);
      contexts[4] = new CachingMetaDataContext(contexts[0], retrievals[1]);
      contexts[5] = new CachingMetaDataContext(contexts[0], Arrays.asList(retrievals));
      if (mix)
      {
         contexts[6] = new AbstractMetaDataContext(emptyContext, retrievals[0]);
         contexts[7] = new AbstractMetaDataContext(contexts[0], emptyRetrieval);
         contexts[8] = new CachingMetaDataContext(emptyContext, retrievals[0]);
         contexts[9] = new CachingMetaDataContext(contexts[0], emptyRetrieval);
      }
      return contexts;
   }
View Full Code Here

Examples of org.jboss.metadata.plugins.context.CachingMetaDataContext

      context = new AbstractMetaDataContext(parent, Arrays.asList(aemdl, mmdl));
      assertNotNull(context.getScopedRetrieval(CommonLevels.CLASS));
      assertNotNull(context.getScopedRetrieval(CommonLevels.INSTANCE));

      context = new CachingMetaDataContext(parent, Arrays.asList(aemdl, mmdl, aemdl, mmdl));
      assertNotNull(context.getScopedRetrieval(CommonLevels.CLASS));
      assertNotNull(context.getScopedRetrieval(CommonLevels.INSTANCE));

      MetaDataRetrieval expected1 = context.getScopedRetrieval(CommonLevels.CLASS);
      assertSame(expected1, context.getScopedRetrieval(CommonLevels.CLASS));
      MetaDataRetrieval expected2 = context.getScopedRetrieval(CommonLevels.INSTANCE);
      assertSame(expected2, context.getScopedRetrieval(CommonLevels.INSTANCE));

      context.append(ThreadLocalMetaDataLoader.INSTANCE);
      context.remove(ThreadLocalMetaDataLoader.INSTANCE);

      assertNotNull(context.getScopedRetrieval(CommonLevels.CLASS));
      assertNotNull(context.getScopedRetrieval(CommonLevels.INSTANCE));
      assertNotSame(expected1, context.getScopedRetrieval(CommonLevels.CLASS));
      assertNotSame(expected2, context.getScopedRetrieval(CommonLevels.INSTANCE));

      context = new AbstractMetaDataContext(parent, Arrays.asList(mmdl, mmdl));
      assertNull(context.getScopedRetrieval(CommonLevels.CLASS));
      context = new AbstractMetaDataContext(parent, Arrays.asList(aemdl, aemdl));
      assertNull(context.getScopedRetrieval(CommonLevels.INSTANCE));

      parent = new AbstractMetaDataContext(new MemoryMetaDataLoader(new ScopeKey(CommonLevels.INSTANCE, "0123")));
      context = new CachingMetaDataContext(parent, Arrays.asList(mmdl, mmdl));
      assertNull(context.getScopedRetrieval(CommonLevels.CLASS));
      MetaDataRetrieval scr1 = context.getScopedRetrieval(CommonLevels.INSTANCE);
      assertNotNull(scr1);
      assertTrue(scr1.isEmpty());

      parent = new AbstractMetaDataContext(new MemoryMetaDataLoader(new ScopeKey(CommonLevels.CLASS, "0123")));
      context = new CachingMetaDataContext(parent, Arrays.asList(aemdl, aemdl));
      assertNull(context.getScopedRetrieval(CommonLevels.INSTANCE));
      MetaDataRetrieval scr2 = context.getScopedRetrieval(CommonLevels.CLASS);
      assertNotNull(scr2);
      assertFalse(scr2.isEmpty());
   }
View Full Code Here

Examples of org.jboss.metadata.plugins.context.CachingMetaDataContext

      return new TestMetaDataLoader();
   }

   protected MetaDataContext createContext(MetaDataContext parent, List<MetaDataRetrieval> retrievals)
   {
      return new CachingMetaDataContext(parent, retrievals);
   }
View Full Code Here

Examples of org.jboss.metadata.plugins.context.CachingMetaDataContext

      super(name, false);
   }

   protected MetaData setupMetaData(MetaDataLoader loader)
   {
      CachingMetaDataContext parent = createContext(loader);
      MutableMetaDataLoader empty = createTestMutableMetaDataLoader();
      CachingMetaDataContext context = createContext(parent, empty);
      return new MetaDataRetrievalToMetaDataBridge(context);
   }
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.