Package org.jpox

Examples of org.jpox.ClassLoaderResolver


     * @param fv the initial field values of the object.
     */
    public void checkInheritance(FieldValues fv)
    {
        // Inheritance case, check the level of the instance
        ClassLoaderResolver clr = myOM.getClassLoaderResolver();
        String className = getStoreManager().getClassNameForObjectID(myID, clr, myOM);
        if (className == null)
        {
            // className is null when id class exists, and object has been validated and doesn't exist.
            throw new JPOXObjectNotFoundException(LOCALISER.msg("026013"), myID);
View Full Code Here


        // Make a copy of the field values from the original object - basic fields + PC fields + SCO fields (omit SCO containers)
        int[] allFieldNumbers = getAllFieldNumbers();
        boolean[] l2loadedFields = new boolean[allFieldNumbers.length];

        // Pass 1 to find the number of cacheable fields TODO Embody this in AbstractMemberMetaData
        ClassLoaderResolver clr = getObjectManager().getClassLoaderResolver();
        int numCacheableFields = 0;
        for (int i=0;i<allFieldNumbers.length;i++)
        {
            AbstractMemberMetaData fmd = cmd.getMetaDataForManagedMemberAtAbsolutePosition(i);
            if (fmd.getRelationType(clr) == Relation.NONE)
View Full Code Here

        else if (myLC != null)
        {
            boolean loadedOldValue = false;
            Object oldValue = currentValue;
            AbstractMemberMetaData fmd = cmd.getMetaDataForManagedMemberAtAbsolutePosition(field);
            ClassLoaderResolver clr = myOM.getClassLoaderResolver();
            int relationType = fmd.getRelationType(clr);
            if (!loadedFields[field] && currentValue == null)
            {
                // Updating value of a field that isnt currently loaded
                if (myOM.getOMFContext().getPersistenceConfiguration().getBooleanProperty("org.jpox.manageRelationships") &&
View Full Code Here

        while (iter.hasNext())
        {
            Map.Entry entry = (Map.Entry)iter.next();
            int fieldNumber = ((Integer)entry.getKey()).intValue();
            AbstractMemberMetaData mmd = cmd.getMetaDataForManagedMemberAtAbsolutePosition(fieldNumber);
            ClassLoaderResolver clr = om.getClassLoaderResolver();
            Object oldValue = entry.getValue();
            int relationType = mmd.getRelationType(clr);
            if (relationType == Relation.ONE_TO_ONE_BI)
            {
                // 1-1 bidirectional
View Full Code Here

        while (iter.hasNext())
        {
            Map.Entry entry = (Map.Entry)iter.next();
            int fieldNumber = ((Integer)entry.getKey()).intValue();
            AbstractMemberMetaData mmd = cmd.getMetaDataForManagedMemberAtAbsolutePosition(fieldNumber);
            ClassLoaderResolver clr = om.getClassLoaderResolver();
            Object oldValue = entry.getValue();
            int relationType = mmd.getRelationType(clr);
            if (relationType == Relation.ONE_TO_ONE_BI)
            {
                // 1-1 bidirectional
View Full Code Here

            {
                // Log the PMF configuration
                logConfiguration();

                // Set user classloader
                ClassLoaderResolver clr = getOMFContext().getClassLoaderResolver(null);
                clr.registerUserClassLoader((ClassLoader)getProperty("org.jpox.primaryClassLoader"));

                // Set up the StoreManager
                initialiseStoreManager(clr);

                // Set up the Level 2 Cache
View Full Code Here

            if (!SCOUtils.mapHasSerialisedKeysAndValues(fmd) &&
                fmd.getPersistenceModifier() == FieldPersistenceModifier.PERSISTENT)
            {
                try
                {
                    ClassLoaderResolver clr = ownerSM.getObjectManager().getClassLoaderResolver();
                    this.backingStore = (MapStore) ownerSM.getStoreManager().getBackingStoreForField(clr, fmd, java.util.SortedMap.class);
                    this.valueType = clr.classForName(this.backingStore.getValueType());
                }
                catch(UnsupportedOperationException ex)
                {
                    //some datastores do not support backingStores
                }
View Full Code Here

            if (!SCOUtils.collectionHasSerialisedElements(fmd) &&
                fmd.getPersistenceModifier() == FieldPersistenceModifier.PERSISTENT)
            {
                try
                {
                    ClassLoaderResolver clr = ownerSM.getObjectManager().getClassLoaderResolver();
                    this.backingStore = (ListStore)ownerSM.getStoreManager().getBackingStoreForField(clr,fmd,java.util.ArrayList.class);
                    this.elementType = clr.classForName(this.backingStore.getElementType());
                }
                catch(UnsupportedOperationException ex)
                {
                    //some datastores do not support backingStores
                }
View Full Code Here

            if (!SCOUtils.mapHasSerialisedKeysAndValues(fmd) &&
                fmd.getPersistenceModifier() == FieldPersistenceModifier.PERSISTENT)
            {
                try
                {
                    ClassLoaderResolver clr = ownerSM.getObjectManager().getClassLoaderResolver();
                    this.backingStore = (MapStore) ownerSM.getStoreManager().getBackingStoreForField(clr, fmd, java.util.Map.class);
                    this.valueType = clr.classForName(backingStore.getValueType());
                }
                catch(UnsupportedOperationException ex)
                {
                    //some datastores do not support backingStores
                }
View Full Code Here

         * @param myOM ObjectManager
         * @param pcClass The class of the object that this will manage the state for
         */
        protected Initialization(ObjectManager myOM, Class pcClass)
        {
            ClassLoaderResolver clr = myOM.getClassLoaderResolver();
            if (myOM.getOMFContext().getTypeManager().isReferenceType(pcClass))
            {
                // TODO interfaces
                // in this case JPOX supports only one level for interfaces. in case of many levels, JPOX supports only one branch
                cmd = myOM.getMetaDataManager().getMetaDataForImplementationOfReference(pcClass, null, clr);
   
                // calling the CLR will make sure the class is initialized
                this.pcClass = clr.classForName(cmd.getFullClassName(), pcClass.getClassLoader(), true);
            }
            else
            {
                try
                {
                    // calling the CLR will make sure the class is initialized
                    this.pcClass = clr.classForName(pcClass.getName(), pcClass.getClassLoader(), true);
   
                    cmd = myOM.getMetaDataManager().getMetaDataForClass(pcClass, clr);
                }
                catch (ClassNotResolvedException e)
                {
View Full Code Here

TOP

Related Classes of org.jpox.ClassLoaderResolver

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.