Package net.sf.joafip.store.entity.classinfo

Examples of net.sf.joafip.store.entity.classinfo.ClassInfo


    final NavigableMap<String, EnumStoreMode> storeModeMap =
    /**/new TreeMap<String, EnumStoreMode>();
    storeModeMap.put("net.sf.joafip.store.service.objectfortest",
        EnumStoreMode.STORE_NOT_LAZY);
    classInfoFactory.setStoreMode(storeModeMap);
    ClassInfo classInfo = classInfoFactory.getNoProxyClassInfo(Bob1.class);
    assertTrue("Bob1 must be in not lazy mode", classInfo.isStoreNotLazy());
    classInfo = classInfoFactory.getNoProxyClassInfo(Bob2.class);
    assertTrue("Bob2 must be in not lazy mode", classInfo.isStoreNotLazy());
    classInfo = classInfoFactory.getNoProxyClassInfo(PTreeMap.class);
    assertFalse("PTreeMap must be in lazy mode", classInfo.isStoreNotLazy());
  }
View Full Code Here


    final NavigableMap<String, EnumStoreMode> storeModeMap =
    /**/new TreeMap<String, EnumStoreMode>();
    storeModeMap.put("net.sf.joafip.store.service.objectfortest.Bob1",
        EnumStoreMode.STORE_NOT_LAZY);
    classInfoFactory.setStoreMode(storeModeMap);
    ClassInfo classInfo = classInfoFactory.getNoProxyClassInfo(Bob1.class);
    assertTrue("Bob1 must be in not lazy mode", classInfo.isStoreNotLazy());
    classInfo = classInfoFactory.getNoProxyClassInfo(Bob2.class);
    assertFalse("Bob2 must be in lazy mode", classInfo.isStoreNotLazy());
  }
View Full Code Here

      ConversionException, ClassInfoException {

    final int dataModelIdentifier = 0;
    final int joafipReleaseId = Version.releaseId("2.2.2");
    final String className = "net.sf.joafip.java.util.support.ArrayListSupportIterator";
    final ClassInfo classInfo = classInfoFactory.getClassInfo(className);
    final Deque<ClassReplacementDef> replacementDef = classInfo
        .getReplacementDef(joafipReleaseId, dataModelIdentifier);
    assertFalse("must have replacement definition",
        replacementDef.isEmpty());
    if (_LOG.debugEnabled) {
      _LOG.debug("net.sf.joafip.java.util.support.ArrayListSupportIterator replacement def:\n"
          + replacementDef.toString());
    }
    final ClassReplacementDef classReplacementDef = replacementDef
        .peekFirst();
    assertEquals("bad original class", classInfo,
        classReplacementDef.getOriginalClass());
    final ClassInfo replacementClass = classInfoFactory
        .getNoProxyClassInfo(ArrayListSupportIterator.class);
    assertEquals("bad replacement class", replacementClass,
        classReplacementDef.getReplacementClass());
    // FIXMELUC x check other replacement definition
  }
View Full Code Here

  public void testPTreeMapFieldreplacement() throws FilePersistenceException,
      ClassNotFoundException, ConversionException, ClassInfoException {
    final int dataModelIdentifier = 0;
    final int joafipReleaseId = Version.releaseId("2.2.2");
    final String className = "net.sf.joafip.java.util.PTreeMap";
    final ClassInfo classInfo = classInfoFactory.getClassInfo(className);
    final Deque<ClassReplacementDef> replacementDef = classInfo
        .getReplacementDef(joafipReleaseId, dataModelIdentifier);
    final ClassReplacementDef classReplacementDef = replacementDef
        .peekFirst();
    assertFalse("must have replacement definition",
        replacementDef.isEmpty());
    if (_LOG.debugEnabled) {
      _LOG.debug("net.sf.joafip.java.util.PTreeMap replacement def:\n"
          + replacementDef.toString());
    }
    assertEquals("bad original class", classInfo,
        classReplacementDef.getOriginalClass());
    final ClassInfo replacementClass = classInfoFactory
        .getNoProxyClassInfo(PTreeMap.class);
    assertEquals("bad replacement class", replacementClass,
        classReplacementDef.getReplacementClass());

    final ClassInfo fieldType = classInfoFactory
        .getClassInfo("net.sf.joafip.java.util.IPNavigableTreeSet");
    final FieldInfo originalFieldInfo = new FieldInfo(classInfo,
        "pTreeSet", fieldType/* fieldType */, null/* staticField */, null/* transientField */);
    final FieldReplacementDef replacementFieldinfo = classReplacementDef
        .getReplacementFieldInfo(originalFieldInfo);
View Full Code Here

    intercepted = null;// NOPMD
    final ClassInfoFactory classInfoFactory = new ClassInfoFactory(1);
    classInfoFactory.setConversionManager(new ConversionManager(
        classInfoFactory));

    final ClassInfo classInfo = classInfoFactory
        .getNoProxyClassInfo(objectClass);
    final StorageInfo storageInfo = new StorageInfo();
    final ClassLoaderProvider classLoaderProvider = new ClassLoaderProvider();
    final ProxyManager2 proxyManager2 = new ProxyManager2(
        classLoaderProvider, classInfoFactory);
View Full Code Here

  @Override
  public Object newInstance(final Class<?> objectClass,
      final Class<?>[] parameterTypes, final Object[] initargs) {
    try {
      final ClassInfo objectClassInfo = classInfoFactory
          .getNoProxyClassInfo(objectClass);
      return proxyManager2.newInstanceConstruct(objectClassInfo,
          parameterTypes, initargs, new StorageInfo(), this,
          null/* dataRecordIdentifier */, true/* persisted */);
    } catch (ClassInfoException exception) {
View Full Code Here

  }

  @Override
  public Object newInstance(final Class<?> objectClass) {
    try {
      final ClassInfo objectClassInfo = classInfoFactory
          .getNoProxyClassInfo(objectClass);
      return proxyManager2.newInstanceConstruct(objectClassInfo,
          new StorageInfo(), this, null/* dataRecordIdentifier */,
          true/* persisted */);
    } catch (ClassInfoException exception) {
View Full Code Here

  @Override
  public ObjectAndPersistInfo getOrCreateObjectPersistInfoOfObject(
      final Object object, final Boolean proxyInstance,
      final boolean persisted) throws ObjectIOException,
      ObjectIODataCorruptedException {
    final ClassInfo objectClassInfo;
    try {
      objectClassInfo = classInfoFactory.getNoProxyClassInfo(object
          .getClass());
    } catch (ClassInfoException exception) {
      throw new ObjectIOException(exception);
View Full Code Here

  public void testPTreeSetReplacement() throws FilePersistenceException,
      ClassInfoException, ConversionException {
    final int previousJoafipRelesase = Version.releaseId("3.0.0");
    final int previousDataModelIdentifier = 1;
    final ClassInfo originalClass = classInfoFactory
        .getNoProxyClassInfo(PTreeSet.class);

    final ReplacementDefMap joafipReplacementDefMap = conversionManager
        .getJoafipReplacementDefMap();
    final Map<ClassInfo, NavigableMap<Integer, ConversionDefForClass>> replacementDefMap =
View Full Code Here

  private void test() throws EnhanceException, InstantiationException,
      IllegalAccessException, ReflectException,
      ReflectInvalidClassException, ClassInfoException {
    final Class<?> clazz = PTreeMap.class;
    final ClassInfo objectClassInfo = classInfoFactory.getClassInfo(clazz);
    Class<?> enhancedClass = classEnhancer.enhanceClass(objectClassInfo, 0);

    /*
     * create instance
     */
 
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.entity.classinfo.ClassInfo

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.