本文整理汇总了Java中org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver.isInstrumentationAvailable方法的典型用法代码示例。如果您正苦于以下问题:Java InstrumentationLoadTimeWeaver.isInstrumentationAvailable方法的具体用法?Java InstrumentationLoadTimeWeaver.isInstrumentationAvailable怎么用?Java InstrumentationLoadTimeWeaver.isInstrumentationAvailable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver
的用法示例。
在下文中一共展示了InstrumentationLoadTimeWeaver.isInstrumentationAvailable方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
}
}
}
示例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");
}
}
}
示例3: 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();
}
示例4: 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);
}
示例5: 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!");
}
}
示例6: detectWeavingMode
import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入方法依赖的package包/类
private String detectWeavingMode() {
LOGGER.info("PersistenceConfiguration.detectWeavingMode()");
return InstrumentationLoadTimeWeaver.isInstrumentationAvailable() ? "true" : "static";
}
示例7: isInitialized
import org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver; //导入方法依赖的package包/类
public static boolean isInitialized() {
return InstrumentationLoadTimeWeaver.isInstrumentationAvailable();
}
示例8: 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();
}
示例9: 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();
}