Examples of TypeManager


Examples of org.apache.chemistry.opencmis.server.support.TypeManager

    public BindingsObjectFactory getObjectFactory() {
        return fObjectFactory;
    }

    public TypeDefinitionContainer getTypeById(String repositoryId, String typeId) {
        TypeManager typeManager = fMapRepositoryToTypeManager.get(repositoryId);
        if (null == typeManager)
            throw new RuntimeException("Unknown repository " + repositoryId);

        return typeManager.getTypeById(typeId);
    }
View Full Code Here

Examples of org.datanucleus.store.types.TypeManager

        ClassLoaderResolver clr = new JDOClassLoaderResolver();
        Properties props = new Properties();
        props.setProperty("bundle-check-action", "EXCEPTION");
        PluginManager pluginMgr = new PluginManager(null, clr, props);

        typeMgr = new TypeManager(null, pluginMgr, clr);
    }
View Full Code Here

Examples of org.datanucleus.store.types.TypeManager

        }

        // Initialise support for API, java types over the top of plugin support
        this.apiAdapter = ApiAdapterFactory.getInstance().getApiAdapter(apiName, pluginManager);
        config.setDefaultProperties(apiAdapter.getDefaultFactoryProperties());
        this.typeManager = new TypeManager(apiAdapter, this.pluginManager, getClassLoaderResolver(null));

        if (type == ContextType.PERSISTENCE)
        {
            // Register the StateManager class with JDOImplHelper for security
            AccessController.doPrivileged(new PrivilegedAction()
View Full Code Here

Examples of org.datanucleus.store.types.TypeManager

            // If we have a current value, use the actual type to define the wrapper type
            typeName = value.getClass().getName();
        }

        // Find the SCO wrapper type most suitable
        TypeManager typeMgr = ownerOP.getExecutionContext().getNucleusContext().getTypeManager();
        StoreManager storeMgr = ownerOP.getExecutionContext().getStoreManager();
        boolean fullWrapper = (storeMgr instanceof BackedSCOStoreManager);
        Class wrapperType = null;
        if (fullWrapper)
        {
            wrapperType = typeMgr.getWrappedTypeBackedForType(typeName);
        }
        else
        {
            wrapperType = typeMgr.getWrapperTypeForType(typeName);
        }

        if (wrapperType == null)
        {
            if (value != null && typeMgr.isSecondClassWrapper(typeName))
            {
                // The passed in value is a wrapper type already, so just return it!
                SCO sco = (SCO)value;
                if (replaceField)
                {
                    // Replace the field with this value
                    ownerOP.replaceField(fmd.getAbsoluteFieldNumber(), sco);
                }
                return sco;
            }
            else
            {
                // typeName not supported directly (no SCO wrapper for the precise type)
                if (instantiatedType != null)
                {
                    // Try the instantiated type
                    if (fullWrapper)
                    {
                        wrapperType = typeMgr.getWrappedTypeBackedForType(instantiatedType.getName());
                    }
                    else
                    {
                        wrapperType = typeMgr.getWrapperTypeForType(instantiatedType.getName());
                    }
                }
                if (wrapperType == null)
                {
                    // Try the declared type
                    if (fullWrapper)
                    {
                        wrapperType = typeMgr.getWrappedTypeBackedForType(declaredType.getName());
                    }
                    else
                    {
                        wrapperType = typeMgr.getWrapperTypeForType(declaredType.getName());
                    }
                }
            }
        }
        if (wrapperType == null)
View Full Code Here

Examples of org.datanucleus.store.types.TypeManager

          // User-defined TypeConverter
          TypeConverter conv = ec.getTypeManager().getTypeConverterForName(mmd.getTypeConverterName());
          value = conv.toMemberType(value);
        } else {
          // Perform any conversions from the stored-type to the field type
          TypeManager typeMgr = ec.getNucleusContext().getTypeManager();
          value = ((DatastoreManager) ec.getStoreManager()).getTypeConversionUtils()
              .datastoreValueToPojoValue(typeMgr, clr, value, mmd);
        }

        if (value != null && !(value instanceof SCO)) {
View Full Code Here

Examples of org.datanucleus.store.types.TypeManager

      // Basic field
      if (value == null) {
        checkSettingToNullValue(mmd, value);
      } else {
        // Perform any conversions from the field type to the stored-type
        TypeManager typeMgr = ec.getNucleusContext().getTypeManager();
        value = ((DatastoreManager) ec.getStoreManager())
            .getTypeConversionUtils()
            .pojoValueToDatastoreValue(typeMgr, clr, value, mmd);

        if (value instanceof SCO) {
View Full Code Here

Examples of org.jpox.TypeManager

            // If we have a current value, use the actual type to define the wrapper type
            typeName = value.getClass().getName();
        }

        // Find the SCO wrapper type most suitable
        TypeManager typeMgr = fmd.getMetaDataManager().getOMFContext().getTypeManager();
        boolean fullWrapper = ownerSM.getStoreManager().getSupportedOptions().contains("ContainerQueueing");
        Class wrapperType = null;
        if (fullWrapper)
        {
            wrapperType = typeMgr.getSecondClassWrapper(typeName);
        }
        else
        {
            wrapperType = typeMgr.getSecondClassWrapperSimple(typeName);
        }

        if (wrapperType == null)
        {
            if (value != null && typeMgr.isSecondClassWrapper(typeName))
            {
                // The passed in value is a wrapper type already, so just return it!
                SCO sco = (SCO)value;
                if (replaceField)
                {
                    // Replace the field with this value
                    ownerSM.replaceField(fmd.getAbsoluteFieldNumber(), sco, false);
                }
                return sco;
            }
            else
            {
                // typeName not supported directly (no SCO wrapper for the precise type)
                if (instantiatedType != null)
                {
                    // Try the instantiated type
                    if (fullWrapper)
                    {
                        wrapperType = typeMgr.getSecondClassWrapper(instantiatedType.getName());
                    }
                    else
                    {
                        wrapperType = typeMgr.getSecondClassWrapperSimple(instantiatedType.getName());
                    }
                }
                if (wrapperType == null)
                {
                    // Try the declared type
                    if (fullWrapper)
                    {
                        wrapperType = typeMgr.getSecondClassWrapper(declaredType.getName());
                    }
                    else
                    {
                        wrapperType = typeMgr.getSecondClassWrapperSimple(declaredType.getName());
                    }
                }
            }
        }
        if (wrapperType == null)
View Full Code Here

Examples of org.jpox.TypeManager

            else
            {
                acmd = datastoreContainer.getStoreManager().getOMFContext().getMetaDataManager().getMetaDataForClass(fmd.getType(), clr);
            }
            MappedStoreManager storeMgr = datastoreContainer.getStoreManager();
            TypeManager typeMgr = storeMgr.getOMFContext().getTypeManager();

            if (fmd.isSerialized())
            {
                // Field is marked as serialised then we have no other option - serialise it
                mc = getMappingClass(fmd.getType(), true, false, fmd.getFullFieldName(),
View Full Code Here

Examples of org.jpox.TypeManager

        else if (fmd.hasArray())
        {
            embedded = fmd.getArray().isEmbeddedElement();
        }

        TypeManager typeMgr = fmd.getMetaDataManager().getOMFContext().getTypeManager();
        Class elementCls = null;
        if (fmd.hasCollection())
        {
            elementCls = clr.classForName(fmd.getCollection().getElementType());
        }
        else if (fmd.hasArray())
        {
            elementCls = clr.classForName(fmd.getArray().getElementType());
        }
        boolean elementReference = typeMgr.isReferenceType(elementCls);

        Class mc = null;
        if (serialised)
        {
            if (elementPC)
View Full Code Here

Examples of org.jpox.TypeManager

        boolean serialised = (fmd.hasMap() && fmd.getMap().isSerializedKey());
        boolean embedded = (fmd.hasMap() && fmd.getMap().isEmbeddedKey());
        boolean embeddedPC = (fmd.getKeyMetaData() != null && fmd.getKeyMetaData().getEmbeddedMetaData() != null);
        boolean keyPC = (fmd.hasMap() && fmd.getMap().getKeyClassMetaData() != null);
        TypeManager typeMgr = fmd.getMetaDataManager().getOMFContext().getTypeManager();
        Class keyCls = clr.classForName(fmd.getMap().getKeyType());
        boolean keyReference = typeMgr.isReferenceType(keyCls);

        Class mc = null;
        if (serialised)
        {
            if (keyPC)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.