Package com.gemstone.gemfire

Examples of com.gemstone.gemfire.Instantiator


      }
    });
  }

  public Instantiator getInstantiator(Class<? extends DataSerializable> clazz, int classId) {
    Instantiator instantiator = cache.get(clazz);
    if (instantiator == null) {
      synchronized (cache) {
        instantiator = cache.get(clazz);
        if (instantiator == null) {
          // create Instantiator
View Full Code Here


    asmFactory = new AsmInstantiatorGenerator();
  }

  @Test
  public void testClassGeneration() throws Exception {
    Instantiator instantiator = asmFactory.getInstantiator(SomeClass.class, 100);
    assertEquals(100, instantiator.getId());
    assertEquals(SomeClass.class, instantiator.getInstantiatedClass());
    Object instance = instantiator.newInstance();
    assertEquals(SomeClass.class, instance.getClass());
    assertTrue(SomeClass.instantiated);
  }
View Full Code Here

    assertTrue(SomeClass.instantiated);
  }

  @Test
  public void testGeneratedClassName() throws Exception {
    Instantiator instantiator = asmFactory.getInstantiator(SomeClass.class, 100);
    assertTrue(instantiator.getClass().getName().contains("$"));
  }
View Full Code Here

    assertTrue(instantiator.getClass().getName().contains("$"));
  }

  @Test
  public void testInterfaces() throws Exception {
    Instantiator instantiator = asmFactory.getInstantiator(SomeClass.class, 100);
    assertTrue(instantiator instanceof Serializable);
  }
View Full Code Here

    assertTrue(instantiator instanceof Serializable);
  }

  @Test
  public void testCacheInPlace() throws Exception {
    Instantiator instance1 = asmFactory.getInstantiator(SomeClass.class, 120);
    Instantiator instance2 = asmFactory.getInstantiator(SomeClass.class, 125);
    assertSame(instance1, instance2);
  }
View Full Code Here

TOP

Related Classes of com.gemstone.gemfire.Instantiator

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.