javax.persistence.spi.ClassTransformer Java Examples

The following examples show how to use javax.persistence.spi.ClassTransformer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SpringPersistenceUnitInfo.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * This implementation delegates to the LoadTimeWeaver, if specified.
 */
@Override
public void addTransformer(ClassTransformer classTransformer) {
	if (this.loadTimeWeaver == null) {
		throw new IllegalStateException("Cannot apply class transformer without LoadTimeWeaver specified");
	}
	this.loadTimeWeaver.addTransformer(new ClassFileTransformerAdapter(classTransformer));
}
 
Example #2
Source File: SpringPersistenceUnitInfo.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * This implementation delegates to the LoadTimeWeaver, if specified.
 */
@Override
public void addTransformer(ClassTransformer classTransformer) {
	if (this.loadTimeWeaver == null) {
		throw new IllegalStateException("Cannot apply class transformer without LoadTimeWeaver specified");
	}
	this.loadTimeWeaver.addTransformer(new ClassFileTransformerAdapter(classTransformer));
}
 
Example #3
Source File: SpringPersistenceUnitInfo.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This implementation delegates to the LoadTimeWeaver, if specified.
 */
@Override
public void addTransformer(ClassTransformer classTransformer) {
	if (this.loadTimeWeaver == null) {
		throw new IllegalStateException("Cannot apply class transformer without LoadTimeWeaver specified");
	}
	this.loadTimeWeaver.addTransformer(new ClassFileTransformerAdapter(classTransformer));
}
 
Example #4
Source File: SpringPersistenceUnitInfo.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * This implementation delegates to the LoadTimeWeaver, if specified.
 */
@Override
public void addTransformer(ClassTransformer classTransformer) {
	if (this.loadTimeWeaver == null) {
		throw new IllegalStateException("Cannot apply class transformer without LoadTimeWeaver specified");
	}
	this.loadTimeWeaver.addTransformer(new ClassFileTransformerAdapter(classTransformer));
}
 
Example #5
Source File: DynamicEntityUnitInfo.java    From we-cmdb with Apache License 2.0 4 votes vote down vote up
@Override
public void addTransformer(ClassTransformer transformer) {
    transformers.add(transformer);
}
 
Example #6
Source File: DelegatingPuInfo.java    From eclipselink-maven-plugin with Apache License 2.0 4 votes vote down vote up
public void addTransformer(ClassTransformer transformer)
{
    delegate.addTransformer(transformer);
}
 
Example #7
Source File: HibernatePersistenceUnitInfo.java    From tutorials with MIT License 4 votes vote down vote up
@Override
public void addTransformer(ClassTransformer transformer) {
    transformers.add(transformer);
}
 
Example #8
Source File: PersistenceUnitInfoImpl.java    From tutorials with MIT License 4 votes vote down vote up
@Override
public void addTransformer(ClassTransformer transformer) {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #9
Source File: PersistenceUnitInfoImpl.java    From tomee with Apache License 2.0 4 votes vote down vote up
public PersistenceClassFileTransformer(final ClassTransformer classTransformer) {
    this.classTransformer = classTransformer;
}
 
Example #10
Source File: PersistenceUnitInfoImpl.java    From tomee with Apache License 2.0 4 votes vote down vote up
public void addTransformer(final ClassTransformer classTransformer) {
    if (persistenceClassLoaderHandler != null) {
        final PersistenceClassFileTransformer classFileTransformer = new PersistenceClassFileTransformer(classTransformer);
        persistenceClassLoaderHandler.addTransformer(id, classLoader, classFileTransformer);
    }
}
 
Example #11
Source File: MinnalPersistenceUnitInfo.java    From minnal with Apache License 2.0 4 votes vote down vote up
public void addTransformer(ClassTransformer transformer) {
	logger.info("Add transformer called on the persistent unit info. Ignoring");
	// TODO Support adding transformers.
	// Ignore this for now
}
 
Example #12
Source File: PersistenceUnitInfoBuilder.java    From openwebbeans-meecrowave with Apache License 2.0 4 votes vote down vote up
public PersistenceUnitInfo toInfo() {
    if (providerClass == null) {
        providerClass = ServiceLoader.load(PersistenceProvider.class).iterator().next().getClass().getName();
    }
    requireNonNull(dataSource, "datasource not provided");
    return new PersistenceUnitInfo() {
        @Override
        public String getPersistenceUnitName() {
            return unitName;
        }

        @Override
        public String getPersistenceProviderClassName() {
            return providerClass;
        }

        @Override
        public PersistenceUnitTransactionType getTransactionType() {
            return transactionType;
        }

        @Override
        public DataSource getJtaDataSource() {
            return jtaDataSource;
        }

        @Override
        public DataSource getNonJtaDataSource() {
            return dataSource;
        }

        @Override
        public List<String> getMappingFileNames() {
            return mappingFiles;
        }

        @Override
        public List<URL> getJarFileUrls() {
            return jarFiles;
        }

        @Override
        public URL getPersistenceUnitRootUrl() {
            return rootUrl;
        }

        @Override
        public List<String> getManagedClassNames() {
            return managedClasses;
        }

        @Override
        public boolean excludeUnlistedClasses() {
            return excludeUnlistedClasses;
        }

        @Override
        public SharedCacheMode getSharedCacheMode() {
            return sharedCacheMode;
        }

        @Override
        public ValidationMode getValidationMode() {
            return validationMode;
        }

        @Override
        public Properties getProperties() {
            return properties;
        }

        @Override
        public String getPersistenceXMLSchemaVersion() {
            return version;
        }

        @Override
        public ClassLoader getClassLoader() {
            return loader;
        }

        @Override
        public void addTransformer(final ClassTransformer transformer) {
            // no-op: not supported
        }

        @Override
        public ClassLoader getNewTempClassLoader() {
            return new URLClassLoader(new URL[0], Thread.currentThread().getContextClassLoader());
        }
    };
}
 
Example #13
Source File: ClassFileTransformerAdapter.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public ClassFileTransformerAdapter(ClassTransformer classTransformer) {
	Assert.notNull(classTransformer, "ClassTransformer must not be null");
	this.classTransformer = classTransformer;
}
 
Example #14
Source File: MutablePersistenceUnitInfo.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
/**
 * This implementation throws an UnsupportedOperationException.
 */
@Override
public void addTransformer(ClassTransformer classTransformer) {
	throw new UnsupportedOperationException("addTransformer not supported");
}
 
Example #15
Source File: PersistenceUnitInfoBuilder.java    From quickperf with Apache License 2.0 4 votes vote down vote up
public PersistenceUnitInfo build(final DataSource dataSource
                               , final Properties config
                               , final Class<?>... persistentClasses) {
    return new PersistenceUnitInfo(){

        @Override
        public String getPersistenceUnitName() {
            return "my pu";
        }

        @Override
        public String getPersistenceProviderClassName() {
            return "org.hibernate.jpa.HibernatePersistenceProvider";
        }

        @Override
        public PersistenceUnitTransactionType getTransactionType() {
            return PersistenceUnitTransactionType.RESOURCE_LOCAL;
        }

        @Override
        public DataSource getJtaDataSource() {
            return null;
        }

        @Override
        public DataSource getNonJtaDataSource() {
            return dataSource;
        }

        @Override
        public List<String> getMappingFileNames() {
            return emptyList();
        }

        @Override
        public List<URL> getJarFileUrls() {
            return emptyList();
        }

        @Override
        public URL getPersistenceUnitRootUrl() {
            return null;
        }

        @Override
        public List<String> getManagedClassNames() {
            return Arrays.stream(persistentClasses)
                                    .map(c -> c.getName())
                                    .collect(toList());
        }

        @Override
        public boolean excludeUnlistedClasses() {
            return false;
        }

        @Override
        public SharedCacheMode getSharedCacheMode() {
            return SharedCacheMode.NONE;
        }

        @Override
        public ValidationMode getValidationMode() {
            return ValidationMode.NONE;
        }

        @Override
        public Properties getProperties() {
            return config;
        }

        @Override
        public String getPersistenceXMLSchemaVersion() {
            return "2.1";
        }

        @Override
        public ClassLoader getClassLoader() {
            return this.getClass().getClassLoader();
        }

        @Override
        public void addTransformer(ClassTransformer transformer) {

        }

        @Override
        public ClassLoader getNewTempClassLoader() {
            return null;
        }

    };
}
 
Example #16
Source File: MutablePersistenceUnitInfo.java    From spring-analysis-note with MIT License 4 votes vote down vote up
/**
 * This implementation throws an UnsupportedOperationException.
 */
@Override
public void addTransformer(ClassTransformer classTransformer) {
	throw new UnsupportedOperationException("addTransformer not supported");
}
 
Example #17
Source File: ClassFileTransformerAdapter.java    From spring-analysis-note with MIT License 4 votes vote down vote up
public ClassFileTransformerAdapter(ClassTransformer classTransformer) {
	Assert.notNull(classTransformer, "ClassTransformer must not be null");
	this.classTransformer = classTransformer;
}
 
Example #18
Source File: ClassFileTransformerAdapter.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public ClassFileTransformerAdapter(ClassTransformer classTransformer) {
	Assert.notNull(classTransformer, "ClassTransformer must not be null");
	this.classTransformer = classTransformer;
}
 
Example #19
Source File: MutablePersistenceUnitInfo.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
/**
 * This implementation throws an UnsupportedOperationException.
 */
@Override
public void addTransformer(ClassTransformer classTransformer) {
	throw new UnsupportedOperationException("addTransformer not supported");
}
 
Example #20
Source File: DatabaseImpl.java    From jweb-cms with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void addTransformer(ClassTransformer transformer) {
}
 
Example #21
Source File: MutablePersistenceUnitInfo.java    From java-technology-stack with MIT License 4 votes vote down vote up
/**
 * This implementation throws an UnsupportedOperationException.
 */
@Override
public void addTransformer(ClassTransformer classTransformer) {
	throw new UnsupportedOperationException("addTransformer not supported");
}
 
Example #22
Source File: ClassFileTransformerAdapter.java    From java-technology-stack with MIT License 4 votes vote down vote up
public ClassFileTransformerAdapter(ClassTransformer classTransformer) {
	Assert.notNull(classTransformer, "ClassTransformer must not be null");
	this.classTransformer = classTransformer;
}
 
Example #23
Source File: RapidoidPersistenceUnitInfo.java    From rapidoid with Apache License 2.0 2 votes vote down vote up
@Override
public void addTransformer(ClassTransformer transformer) {

}
 
Example #24
Source File: PersistenceUnitInfoImpl.java    From hypersistence-optimizer with Apache License 2.0 2 votes vote down vote up
@Override
public void addTransformer(ClassTransformer transformer) {

}
 
Example #25
Source File: HammockPersistenceUnitInfo.java    From hammock with Apache License 2.0 2 votes vote down vote up
@Override
public void addTransformer(ClassTransformer classTransformer) {

}
 
Example #26
Source File: PersistenceUnitInfoImpl.java    From hibernate-master-class with Apache License 2.0 2 votes vote down vote up
@Override
public void addTransformer(ClassTransformer transformer) {

}
 
Example #27
Source File: PersistenceUnitInfoImpl.java    From hibernate-types with Apache License 2.0 2 votes vote down vote up
@Override
public void addTransformer(ClassTransformer transformer) {

}
 
Example #28
Source File: PersistenceUnitInfoImpl.java    From high-performance-java-persistence with Apache License 2.0 2 votes vote down vote up
@Override
public void addTransformer(ClassTransformer transformer) {

}
 
Example #29
Source File: PersistenceUnitInfoImpl.java    From hibernate-types with Apache License 2.0 2 votes vote down vote up
@Override
public void addTransformer(ClassTransformer transformer) {

}
 
Example #30
Source File: PersistenceUnitInfoImpl.java    From hibernate-types with Apache License 2.0 2 votes vote down vote up
@Override
public void addTransformer(ClassTransformer transformer) {

}