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

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


  @Override
  public void keptInMemory(final String key, final Object object)
      throws StoreException {
    final Class<? extends Object> objectClass = object.getClass();
    ClassInfo classInfo;
    try {
      classInfo = classInfoFactory.getNoProxyClassInfo(objectClass);
    } catch (ClassInfoException exception) {
      throw new StoreException(exception);
    }
    classInfo.setKeptInMemory(true);
    objectIOManager.addObject(key, object);
  }
View Full Code Here


  @Override
  public void referencedByPesistedStaticField(
      final Class<?> classHavingStaticFieldReferenced)
      throws StoreException {
    ClassInfo classInfo;
    try {
      classInfo = classInfoFactory
          .getNoProxyClassInfo(classHavingStaticFieldReferenced);
      final FieldInfo[] fieldsInfo = classInfo
          .getAllDeclaredStaticFields();
      for (FieldInfo fieldInfo : fieldsInfo) {
        final Object value = helperReflect.getFieldValue(null,
            fieldInfo, true);
        final StringBuilder keyBuilder = new StringBuilder();// NOPMD
        keyBuilder.append(classInfo.getName());
        keyBuilder.append('#');
        keyBuilder.append(fieldInfo.getDeclaringClassInfo().getName());
        keyBuilder.append('#');
        keyBuilder.append(fieldInfo.getFieldName());
        keptInMemory(keyBuilder.toString(), value);
View Full Code Here

  public Object newInstance(final Class<?> objectClass,
      final Class<?>[] parameterTypes, final Object[] initargs) {
    synchronized (mutex) {
      try {
        final Object newInstance;
        final ClassInfo objectClassInfo = classInfoFactory
            .getNoProxyClassInfo(objectClass);
        newInstance = newInstance(objectClassInfo, parameterTypes,
            initargs);
        assert newInstance != null;
        return newInstance;
View Full Code Here

   */
  public void add(final ConversionDefEntry conversionDefEntry)
      throws ConversionException {

    final int from = conversionDefEntry.getIdentifier();
    final ClassInfo classInfo = conversionDefEntry.getClassInfo();
    NavigableMap<Integer, ConversionDefForClass> conversionDefByIdMap = conversionDefByClassAndIdMap
        .get(classInfo);
    if (conversionDefByIdMap == null) {
      conversionDefByIdMap = new TreeMap<Integer, ConversionDefForClass>();
      conversionDefByClassAndIdMap.put(classInfo, conversionDefByIdMap);
View Full Code Here

    builder.append("\ncurrent id: ");
    builder.append(current);
    builder.append('\n');
    for (Map.Entry<ClassInfo, Deque<ClassReplacementDef>> entry : replacementDefByClassMap
        .entrySet()) {
      final ClassInfo classInfo = entry.getKey();
      final Deque<ClassReplacementDef> classReplacementDefs = entry
          .getValue();
      builder.append("- class ");
      builder.append(classInfo);
      builder.append('\n');
View Full Code Here

      final Map<ClassInfo, Deque<ClassReplacementDef>> replacementDefByClassMap)
      throws ConversionException {

    final Deque<ClassReplacementDef> classReplacementDefList = new LinkedList<ClassReplacementDef>();
    ConversionDefForClass intermediateConversionDef = originalConversionDef;
    final ClassInfo originalClassInfo = originalConversionDef
        .getClassInfo();
    final Deque<ClassReplacementDef> previousClassReplacementDef = replacementDefByClassMap
        .put(originalClassInfo, classReplacementDefList);
    do {

      final ClassInfo originalClass = intermediateConversionDef
          .getClassInfo();
      final ClassInfo replacementClass = intermediateConversionDef
          .getReplacementClass();

      final FieldConversionMap fieldConversionMap = intermediateConversionDef
          .getFieldConversionMap();
      final FieldConversionMap staticFieldConversionMap = intermediateConversionDef
          .getStaticFieldConversionMap();

      final ClassInfo converterClass = intermediateConversionDef
          .getConverterClass();
      final ClassInfo staticConverterClass = intermediateConversionDef
          .getStaticConverterClass();

      final ClassReplacementDef classReplacementDef = new ClassReplacementDef(
      /**/originalClass, replacementClass, converterClass,
          staticConverterClass, fieldConversionMap,
View Full Code Here

  }

  private FieldInfo replacementFieldInfo(final int fromIdentifier,
      final FieldInfo originalFieldInfo) throws ConversionException {
    try {
      final ClassInfo declaringClass = originalFieldInfo
          .getDeclaringClassInfo();
      final ClassInfo newDeclaringClass = replacementClass(
          fromIdentifier, declaringClass);

      final ClassInfo fieldType = originalFieldInfo.getFieldTypeInfo();
      final ClassInfo newFieldType = replacementClass(fromIdentifier,
          fieldType);

      final FieldInfo replacementFieldInfo;
      if (newFieldType == null) {
        // replacementFieldInfo = null;//originalFieldInfo;
View Full Code Here

    }
  }

  private ClassInfo replacementClass(final int fromIdentifier,
      final ClassInfo classInfo) {
    final ClassInfo replacementClass;

    final NavigableMap<Integer, ConversionDefForClass> convDefByIdMap = conversionDefByClassAndIdMap
        .get(classInfo);
    if (convDefByIdMap == null) {
      replacementClass = classInfo;
View Full Code Here

  public ClassInfo getClassInfo() {
    return classInfo;
  }

  public ClassInfo getReplacementClass() {
    final ClassInfo classInfo;
    if (replacementDef.isEmpty()) {
      classInfo = this.classInfo;
    } else {
      classInfo = replacementDef.peekLast().getReplacementClass();
    }
View Full Code Here

   * @throws ImportException
   */
  protected ObjectAndPersistInfo setDataRecordIdentifierAssociatedToObject(
      final Object object, final DataRecordIdentifier dataRecordIdentifier)
      throws ImportException {
    final ClassInfo classInfo;
    if (object == null) {
      classInfo = ClassInfo.NULL;
    } else {
      try {
        classInfo = classInfoFactory.getNoProxyClassInfo(object
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.