Package com.mobixess.jodb.core.plugin

Examples of com.mobixess.jodb.core.plugin.IClassProcessor


            ClassDescriptor classDescriptor = objectDataContainer.getClassDescriptorForPersistedObject();
            if (classDescriptor == null || fieldsIterator == null) {
                // basically same as >>objectDataContainer.isDeleted()<< or no class available for persistent copy
                return null;
            }
            IClassProcessor processor;
            if (!delayedActivation) {
                int classTypeId = objectDataContainer.getOriginalClassType();
                String className = base.getClassTypeForID(classTypeId);
                Class clazz;
                try {
                    clazz = session.resolveClassForName(className);
                } catch (ClassNotFoundException e) {
                    return null;
                }
                processor = JODBPluginRegistry.getInstance().getClassProcessor(clazz);
                instance = processor.composeInstance(clazz, objectDataContainer, session);
            }else{
                processor = JODBPluginRegistry.getInstance().getClassProcessor(instance.getClass());
            }
            PersistentObjectHandle handle = session.createHandleForObject(instance, offset, objectDataContainer);
            synchronized (handle) {//TODO "get object" must obey this lock or incompletely initialized object could become accessible
                if(!delayedActivation){
                    synchronized (session.getActivationSynchObject()) {//put object into cache to prevent potential recursion
                        //check if some other thread already instantiated the object
                        Object candidate = session.getObjectFromCache(offset);
                        if (candidate != null) {
                            dataContainersCache.pushObjectDataContainer(objectDataContainer);//return container to cache
                            return candidate;
                        }
                        session.putObject(instance, handle);
                    }
                }
   
                processor.activate(instance, objectDataContainer, session, remainingDepth, delayedActivation);
                dataContainersCache.pushObjectDataContainer(objectDataContainer);//return container to cache
                objectDataContainer = null;
            }
        }finally{
            ioTicket.unlock();
View Full Code Here


            return -1;
        }
        IOBase base = ioTicket.getBase();
       
       
        IClassProcessor classProcessor = JODBPluginRegistry.getInstance().getClassProcessor(rootObject.getClass());
       
        Object objectToPersist = classProcessor.translate(rootObject);
       
        ClassDescriptor classDescr = session.getDescriptorForClass(objectToPersist.getClass());
        FieldAndIDRecord[] fields = classDescr.getAllFields();
       
        Vector<IndexingRecord> indexes = null;
View Full Code Here

            if(result == null){
                Class originClass = getObject().getClass();
                if(PrimitiveJavaTypesUtil.isPrimitiveWrapper(originClass)){
                    return getObject();
                }
                IClassProcessor classProcessor = JODBPluginRegistry.getInstance().getClassProcessor(originClass);
                result = classProcessor.translate(getObject());
                _translatedOrigin = new WeakReference(result);
            }
            return result;
        }
View Full Code Here

            if(activeObject!=null){
                if(originClass != activeObject.getClass()){
                    processCompareResult(COMPARE_RESULT.UNKNOWN);
                    return;
                }
                IClassProcessor processor = JODBPluginRegistry.getInstance().getClassProcessor(originClass);
                COMPARE_RESULT compareResult = processor.compare(getObject(),activeObject, context, null);
                processCompareResult(compareResult);
                return;
            }
        }
View Full Code Here

                }
                if(originClass!=persistentObjectClass){
                    processCompareResult(COMPARE_RESULT.UNKNOWN);
                    return;
                }
                IClassProcessor processor = JODBPluginRegistry.getInstance().getClassProcessor(originClass);
                if(_type == CONSTRAINT_TYPE.EQUAL || _type == CONSTRAINT_TYPE.NOT){//equals methods can be better optimized
                    boolean equal = processor.equals(getTranslatedOrigin(), dataContainer, context, null);
                    processCompareResult(equal? COMPARE_RESULT.EQUAL : COMPARE_RESULT.SMALLER);
                    return;
                }else{
                    COMPARE_RESULT compareResult = processor.compare(getTranslatedOrigin(), dataContainer, context, null, originClass);
                    processCompareResult(compareResult);
                    return;
                }
               
            }
View Full Code Here

TOP

Related Classes of com.mobixess.jodb.core.plugin.IClassProcessor

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.