当前位置: 首页>>代码示例>>Java>>正文


Java InstrumentationLoadTimeWeaver类代码示例

本文整理汇总了Java中org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver的典型用法代码示例。如果您正苦于以下问题:Java InstrumentationLoadTimeWeaver类的具体用法?Java InstrumentationLoadTimeWeaver怎么用?Java InstrumentationLoadTimeWeaver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


InstrumentationLoadTimeWeaver类属于org.springframework.instrument.classloading包,在下文中一共展示了InstrumentationLoadTimeWeaver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setBeanClassLoader

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
@Override
public void setBeanClassLoader(ClassLoader classLoader) {
	LoadTimeWeaver serverSpecificLoadTimeWeaver = createServerSpecificLoadTimeWeaver(classLoader);
	if (serverSpecificLoadTimeWeaver != null) {
		if (logger.isInfoEnabled()) {
			logger.info("Determined server-specific load-time weaver: " +
					serverSpecificLoadTimeWeaver.getClass().getName());
		}
		this.loadTimeWeaver = serverSpecificLoadTimeWeaver;
	}
	else if (InstrumentationLoadTimeWeaver.isInstrumentationAvailable()) {
		logger.info("Found Spring's JVM agent for instrumentation");
		this.loadTimeWeaver = new InstrumentationLoadTimeWeaver(classLoader);
	}
	else {
		try {
			this.loadTimeWeaver = new ReflectiveLoadTimeWeaver(classLoader);
			logger.info("Using a reflective load-time weaver for class loader: " +
					this.loadTimeWeaver.getInstrumentableClassLoader().getClass().getName());
		}
		catch (IllegalStateException ex) {
			throw new IllegalStateException(ex.getMessage() + " Specify a custom LoadTimeWeaver or start your " +
					"Java virtual machine with Spring's agent: -javaagent:org.springframework.instrument.jar");
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:DefaultContextLoadTimeWeaver.java

示例2: setBeanClassLoader

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
public void setBeanClassLoader(ClassLoader classLoader) {
	LoadTimeWeaver serverSpecificLoadTimeWeaver = createServerSpecificLoadTimeWeaver(classLoader);
	if (serverSpecificLoadTimeWeaver != null) {
		if (logger.isInfoEnabled()) {
			logger.info("Determined server-specific load-time weaver: " +
					serverSpecificLoadTimeWeaver.getClass().getName());
		}
		this.loadTimeWeaver = serverSpecificLoadTimeWeaver;
	}
	else if (InstrumentationLoadTimeWeaver.isInstrumentationAvailable()) {
		logger.info("Found Spring's JVM agent for instrumentation");
		this.loadTimeWeaver = new InstrumentationLoadTimeWeaver(classLoader);
	}
	else {
		try {
			this.loadTimeWeaver = new ReflectiveLoadTimeWeaver(classLoader);
			logger.info("Using a reflective load-time weaver for class loader: " +
					this.loadTimeWeaver.getInstrumentableClassLoader().getClass().getName());
		}
		catch (IllegalStateException ex) {
			throw new IllegalStateException(ex.getMessage() + " Specify a custom LoadTimeWeaver or start your " +
					"Java virtual machine with Spring's agent: -javaagent:org.springframework.instrument.jar");
		}
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:26,代码来源:DefaultContextLoadTimeWeaver.java

示例3: destroy

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
@Override
public void destroy() {
	if (this.loadTimeWeaver instanceof InstrumentationLoadTimeWeaver) {
		logger.info("Removing all registered transformers for class loader: " +
				this.loadTimeWeaver.getInstrumentableClassLoader().getClass().getName());
		((InstrumentationLoadTimeWeaver) this.loadTimeWeaver).removeTransformers();
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:DefaultContextLoadTimeWeaver.java

示例4: afterPropertiesSet

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
@Override
public void afterPropertiesSet() {
	if (this.loadTimeWeaver == null && InstrumentationLoadTimeWeaver.isInstrumentationAvailable()) {
		this.loadTimeWeaver = new InstrumentationLoadTimeWeaver(this.resourcePatternResolver.getClassLoader());
	}
	preparePersistenceUnitInfos();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:DefaultPersistenceUnitManager.java

示例5: createEntityManagerFactoryBean

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
protected LocalContainerEntityManagerFactoryBean createEntityManagerFactoryBean(
		String persistenceXml, Properties props, String entityManagerName) throws Exception {

	// This will be set by DummyPersistenceProvider
	actualPui = null;
	actualProps = null;

	LocalContainerEntityManagerFactoryBean containerEmfb = new LocalContainerEntityManagerFactoryBean();

	containerEmfb.setPersistenceUnitName(entityManagerName);
	containerEmfb.setPersistenceProviderClass(DummyContainerPersistenceProvider.class);
	if (props != null) {
		containerEmfb.setJpaProperties(props);
	}
	containerEmfb.setLoadTimeWeaver(new InstrumentationLoadTimeWeaver());
	containerEmfb.setPersistenceXmlLocation(persistenceXml);
	containerEmfb.afterPropertiesSet();

	assertEquals(entityManagerName, actualPui.getPersistenceUnitName());
	if (props != null) {
		assertEquals(props, actualProps);
	}
	//checkInvariants(containerEmfb);

	return containerEmfb;

	//containerEmfb.destroy();
	//emfMc.verify();
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:30,代码来源:LocalContainerEntityManagerFactoryBeanTests.java

示例6: initialize

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
public static void initialize(final String args, final Instrumentation inst) {
    if (InstrumentationLoadTimeWeaver.isInstrumentationAvailable()) {
        throw new IllegalStateException(
                "Instrumentation is already available, the agent should have been loaded already!");
    }

    InstrumentationSavingAgent.premain(args, inst);
}
 
开发者ID:subes,项目名称:invesdwin-instrument,代码行数:9,代码来源:AgentInstrumentationInitializer.java

示例7: main

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
public static void main(String[] args) {
	DynamicInstrumentationLoader.waitForInitialized();
	DynamicInstrumentationLoader.initLoadTimeWeavingContext();
	if (!InstrumentationLoadTimeWeaver.isInstrumentationAvailable()) {
		throw new IllegalStateException("Instrumentation not available!");
	} else {
		System.out.println("Instrumentation available!");
	}
}
 
开发者ID:subes,项目名称:invesdwin-instrument,代码行数:10,代码来源:Main.java

示例8: destroy

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
public void destroy() {
	if (this.loadTimeWeaver instanceof InstrumentationLoadTimeWeaver) {
		logger.info("Removing all registered transformers for class loader: " +
				this.loadTimeWeaver.getInstrumentableClassLoader().getClass().getName());
		((InstrumentationLoadTimeWeaver) this.loadTimeWeaver).removeTransformers();
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:8,代码来源:DefaultContextLoadTimeWeaver.java

示例9: getLoadTimeWeaver

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
public LoadTimeWeaver getLoadTimeWeaver() {
    return new InstrumentationLoadTimeWeaver();
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:4,代码来源:EclipseLinkJpaProviderSupport.java

示例10: loadTimeWeaver

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
@Bean
public LoadTimeWeaver loadTimeWeaver() {
    return new InstrumentationLoadTimeWeaver();
}
 
开发者ID:mattpwest,项目名称:entelect-spring-webapp-template,代码行数:5,代码来源:JPAConfig.java

示例11: detectWeavingMode

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
private String detectWeavingMode() {
    LOGGER.info("PersistenceConfiguration.detectWeavingMode()");
    return InstrumentationLoadTimeWeaver.isInstrumentationAvailable() ? "true" : "static";
}
 
开发者ID:fdlessard,项目名称:SpringBootMagicEightBallProject,代码行数:5,代码来源:PersistenceConfiguration.java

示例12: isInitialized

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
public static boolean isInitialized() {
    return InstrumentationLoadTimeWeaver.isInstrumentationAvailable();
}
 
开发者ID:subes,项目名称:invesdwin-instrument,代码行数:4,代码来源:DynamicInstrumentationLoader.java

示例13: instrumentationLoadTimeWeaver

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
@Bean
public LoadTimeWeaver instrumentationLoadTimeWeaver() {
	return new InstrumentationLoadTimeWeaver();
}
 
开发者ID:ZelvaJan,项目名称:pa165_haunted_houses,代码行数:5,代码来源:PersistenceTestAplicationContext.java

示例14: afterPropertiesSet

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
public void afterPropertiesSet() {
	if (this.loadTimeWeaver == null && InstrumentationLoadTimeWeaver.isInstrumentationAvailable()) {
		this.loadTimeWeaver = new InstrumentationLoadTimeWeaver(this.resourcePatternResolver.getClassLoader());
	}
	preparePersistenceUnitInfos();
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:7,代码来源:DefaultPersistenceUnitManager.java

示例15: shouldUseShadowLoader

import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入依赖的package包/类
/**
 * Subclasses should override this method if they wish to disable shadow class loading.
 * <p>The default implementation deactivates shadow class loading if Spring's
 * InstrumentationSavingAgent has been configured on VM startup.
 */
protected boolean shouldUseShadowLoader() {
	return !InstrumentationLoadTimeWeaver.isInstrumentationAvailable();
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:9,代码来源:AbstractJpaTests.java


注:本文中的org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。