Package javax.persistence.spi

Examples of javax.persistence.spi.ClassTransformer


    public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties){
            Map nonNullProperties = (properties == null) ? new HashMap() : properties;
       
        EntityManagerSetupImpl emSetupImpl = null;
            boolean isNew = false;
            ClassTransformer transformer = null;
        synchronized (EntityManagerFactoryProvider.emSetupImpls) {
            String puName = PersistenceUnitProcessor.buildPersistenceUnitName(info.getPersistenceUnitRootUrl(), info.getPersistenceUnitName());
            String esiName = puName;
            if (nonNullProperties.get(PersistenceUnitProperties.SESSION_NAME) != null) {
                esiName = puName + nonNullProperties.get(PersistenceUnitProperties.SESSION_NAME);
View Full Code Here


            }
           
            boolean throwExceptionOnFail = "true".equalsIgnoreCase(
                    EntityManagerFactoryProvider.getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.THROW_EXCEPTIONS, predeployProperties, "true", session));               
   
            ClassTransformer transformer = null;
           
            boolean weaveChangeTracking = false;
            boolean weaveLazy = false;
            boolean weaveEager = false;
            boolean weaveFetchGroups = false;
View Full Code Here

                ++ EntityManagerFactoryProvider.PUIUsageCount;
            }
          
   
            // A call to predeploy will partially build the session we will use
            final ClassTransformer transformer = emSetupImpl.predeploy(persistenceUnitInfo, mergedProperties);
   
            registerTransformer(transformer, persistenceUnitInfo);
            return true;
        }
        return false;
View Full Code Here

        Iterator<SEPersistenceUnitInfo> persistenceUnitsIterator = persistenceUnitsList.iterator();
        while (persistenceUnitsIterator.hasNext()) {
            SEPersistenceUnitInfo unitInfo = persistenceUnitsIterator.next();
            unitInfo.setNewTempClassLoader(aclassloader);
            //build class transformer.
            ClassTransformer transformer = buildTransformer(unitInfo,this.logWriter,this.logLevel);
            classTransformers.add(transformer);
        }
    }
View Full Code Here

                session.handleException(new IntegrityException(session.getIntegrityChecker()));
            }
   
            // The transformer is capable of altering domain classes to handle a LAZY hint for OneToOne mappings.  It will only
            // be returned if we we are mean to process these mappings
            ClassTransformer transformer = null;
            if (enableLazyForOneToOne){
                // build a list of entities the persistence unit represented by this EntityManagerSetupImpl will use
                Collection entities = PersistenceUnitProcessor.buildEntityList(processor,privateClassLoader);
                transformer = TransformerFactory.createTransformerAndModifyProject(session, entities, privateClassLoader);
            }
View Full Code Here

            }
            // Make the callback
            AbstractSessionLog.getLog().log(SessionLog.FINER, "cmp_init_invoke_predeploy", persistenceUnitInfo.getPersistenceUnitName());

            // A call to predeploy will partially build the session we will use
            final ClassTransformer transformer = emSetupImpl.predeploy(persistenceUnitInfo, mergedProperties);
   
            // If we got a transformer then register it
            if ((transformer != null) && (globalInstrumentation != null)) {
                AbstractSessionLog.getLog().log(SessionLog.FINER, "cmp_init_register_transformer", persistenceUnitInfo.getPersistenceUnitName());
                globalInstrumentation.addTransformer(new ClassFileTransformer(){
                    // adapt ClassTransformer to ClassFileTransformer interface
                    public byte[] transform(
                            ClassLoader loader, String className,
                            Class<?> classBeingRedefined,
                            ProtectionDomain protectionDomain,
                            byte[] classfileBuffer) throws IllegalClassFormatException {
                        return transformer.transform(loader, className, classBeingRedefined, protectionDomain, classfileBuffer);
                    }
                });
            } else if (transformer == null) {
                AbstractSessionLog.getLog().log(SessionLog.FINER, "cmp_init_transformer_is_null");
            } else if (globalInstrumentation == null) {
View Full Code Here

            }
           
            boolean throwExceptionOnFail = "true".equalsIgnoreCase(
                    EntityManagerFactoryProvider.getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.THROW_EXCEPTIONS, predeployProperties, "true", session));               
   
            ClassTransformer transformer = null;
           
            boolean weaveChangeTracking = false;
            boolean weaveLazy = false;
            boolean weaveEager = false;
            boolean weaveFetchGroups = false;
View Full Code Here

            }
          
            persistenceUnitInfo.setClassLoader(persistenceHelper.getClassLoader(persistenceUnitInfo.getPersistenceUnitName(), m));
   
            // A call to predeploy will partially build the session we will use
            final ClassTransformer transformer = emSetupImpl.predeploy(persistenceUnitInfo, mergedProperties);
   
            registerTransformer(transformer, persistenceUnitInfo);
            return true;
        }
        return false;
View Full Code Here

                ++ EntityManagerFactoryProvider.PUIUsageCount;
            }
          
   
            // A call to predeploy will partially build the session we will use
            final ClassTransformer transformer = emSetupImpl.predeploy(persistenceUnitInfo, mergedProperties);
   
            registerTransformer(transformer, persistenceUnitInfo);
            return true;
        }
        return false;
View Full Code Here

    public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties){
            Map nonNullProperties = (properties == null) ? new HashMap() : properties;
       
        EntityManagerSetupImpl emSetupImpl = null;
        boolean isNew = false;
        ClassTransformer transformer = null;
        String puName = PersistenceUnitProcessor.buildPersistenceUnitName(info.getPersistenceUnitRootUrl(), info.getPersistenceUnitName());
        String esiName = puName;
        if (nonNullProperties.get(PersistenceUnitProperties.SESSION_NAME) != null) {
            esiName = puName + nonNullProperties.get(PersistenceUnitProperties.SESSION_NAME);
        } else {
View Full Code Here

TOP

Related Classes of javax.persistence.spi.ClassTransformer

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.