Spring Framework LoadTimeWeaver - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework LoadTimeWeaver class.

This code example shows how to use the following methods:addTransformer
	@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)); 
	} 
 
	/** 
	 * This implementation delegates to the LoadTimeWeaver, if specified. 
	 */ 
	@Override 
	public ClassLoader getNewTempClassLoader() { 
		ClassLoader tcl = (this.loadTimeWeaver != null ? this.loadTimeWeaver.getThrowawayClassLoader() : 
				new SimpleThrowawayClassLoader(this.classLoader)); 
		String packageToExclude = getPersistenceProviderPackageName(); 
		if (packageToExclude != null && tcl instanceof DecoratingClassLoader) { 
			((DecoratingClassLoader) tcl).excludePackage(packageToExclude); 
		} 
		return tcl; 
6
CodeRank
This code example shows how to use the following methods:addTransformer
			} 
			else { 
				throw new IllegalStateException("No LoadTimeWeaver available");
			} 
		} 
		weaverToUse.addTransformer(new AspectJClassBypassingClassFileTransformer(
					new ClassPreProcessorAgentAdapter())); 
	} 
 
 
	/** 
	 * ClassFileTransformer decorator that suppresses processing of AspectJ 
	 * classes in order to avoid potential LinkageErrors. 
	 * @see org.springframework.context.annotation.LoadTimeWeavingConfiguration 
	 */ 
	private static class AspectJClassBypassingClassFileTransformer implements ClassFileTransformer {
 
		private final ClassFileTransformer delegate;
 
		public AspectJClassBypassingClassFileTransformer(ClassFileTransformer delegate) {
6
CodeRank
This code example shows how to use the following methods:getThrowawayClassLoader
See Code Examples for Spring Framework LoadTimeWeaver Methods: