Package com.artemis.meta

Examples of com.artemis.meta.ClassMetadata$GlobalConfiguration


 
  @Test
  public void retain_fields_for_ide_friendliness() throws Exception {
    GlobalConfiguration.ideFriendlyPacking = true;
   
    ClassMetadata meta = scan(transform(PackedToBeC.class));
    List<FieldDescriptor> instanceFields = instanceFields(meta);
    assertEquals(instanceFields.toString(), 3, instanceFields.size()); // +1 for $offset
    assertEquals(WeaverType.NONE, meta.annotation);
   
    assertTrue(meta.foundReset);
View Full Code Here


    assertEquals("com/artemis/PackedComponent", meta.superClass);
  }
 
  @Test
  public void remove_fields_no_ide() throws Exception {
    ClassMetadata meta = scan(transform(PackedToBeC.class));
    List<FieldDescriptor> instanceFields = instanceFields(meta);
    assertEquals(instanceFields.toString(), 1, instanceFields.size()); // $offset
    assertEquals(WeaverType.NONE, meta.annotation);
   
    assertTrue(meta.foundReset);
View Full Code Here

@SuppressWarnings("static-method")
public class PackedWithFieldAccessTest {

  @Test
  public void packed_direct_field_access() throws Exception {
    ClassMetadata meta = scan(transform(PackedFields.class));
    assertEquals(WeaverType.NONE, meta.annotation);
    assertTrue(meta.foundReset);
    assertTrue(meta.foundEntityFor);
    assertEquals("com/artemis/PackedComponent", meta.superClass);
  }
View Full Code Here

  private Transformer() {}
 
  static ClassReader transform(Class<?> klazz) throws Exception {
    InputStream classStream = klazz.getResourceAsStream("/" + klazz.getName().replace('.', '/') + ".class");
    ClassReader cr = Weaver.classReaderFor(classStream);
    ClassMetadata meta = Weaver.scan(cr);
    meta.type = Type.getObjectType(cr.getClassName());
   
    ClassWriter cw = null;
    if (meta.annotation != WeaverType.NONE) {
      ComponentTypeTransmuter weaver = new ComponentTypeTransmuter(null, cr, meta);
View Full Code Here

    Timer timer = new Timer();
    List<ClassMetadata> processed = new ArrayList<ClassMetadata>();
   
    ExecutorService threadPool = newThreadPool();
    for (File f : classes) {
      ClassMetadata meta = scan(classReaderFor(f.toString()));
      if (meta.sysetemOptimizable != OptimizationType.NOT_OPTIMIZABLE) {
        processed.add(meta);
        optimizeEntitySystem(threadPool, f.getAbsolutePath());
      }
    }
View Full Code Here

   
    try {
     
      List<ClassMetadata> processed = new ArrayList<ClassMetadata>();
      for (Future<ClassMetadata> result : tasks) {
        ClassMetadata metadata = result.get();
        if (metadata != null)
          processed.add(metadata);
      }
     
      awaitTermination(threadPool);
View Full Code Here

  }

  private static void processClass(ExecutorService threadPool, String file, List<ClassMetadata> processed) {
   
    ClassReader cr = classReaderFor(file);
    ClassMetadata meta = scan(cr);
   
    if (meta.annotation == WeaverType.NONE)
      return;
   
    if (meta.annotation == WeaverType.POOLED && !GlobalConfiguration.enabledPooledWeaving) {
View Full Code Here

//    threadPool.submit(new ComponentAccessTransmuter(file, cr, packed));
//  }
 
  private static void optimizeEntitySystem(ExecutorService threadPool, String file) {
    ClassReader cr = classReaderFor(file);
    ClassMetadata meta = scan(cr);
   
    if (meta.sysetemOptimizable != OptimizationType.NOT_OPTIMIZABLE)
      threadPool.submit(new EsOptimizationTransmuter(file, cr, meta));
  }
View Full Code Here

      threadPool.submit(new EsOptimizationTransmuter(file, cr, meta));
  }

  private static void processProfilers(ExecutorService threadPool, String file) {
    ClassReader cr = classReaderFor(file);
    ClassMetadata meta = scan(cr);
   
    if (meta.profilingEnabled)
      threadPool.submit(new ProfilerTransmuter(file, meta, cr));
  }
View Full Code Here

      }
    }
  }

  public static ClassMetadata scan(ClassReader source) {
    ClassMetadata info = new ClassMetadata();
    source.accept(new MetaScanner(info), 0);
    info.type = Type.getObjectType(source.getClassName());
   
    for (FieldDescriptor fd : info.fields) {
      if ((fd.access & ACC_PUBLIC) == ACC_PUBLIC) {
View Full Code Here

TOP

Related Classes of com.artemis.meta.ClassMetadata$GlobalConfiguration

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.