gpt4 book ai didi

org.springframework.instrument.classloading.WeavingTransformer类的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 15:31:05 24 4
gpt4 key购买 nike

本文整理了Java中org.springframework.instrument.classloading.WeavingTransformer类的一些代码示例,展示了WeavingTransformer类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WeavingTransformer类的具体详情如下:
包路径:org.springframework.instrument.classloading.WeavingTransformer
类名称:WeavingTransformer

WeavingTransformer介绍

[英]ClassFileTransformer-based weaver, allowing for a list of transformers to be applied on a class byte array. Normally used inside class loaders.

Note: This class is deliberately implemented for minimal external dependencies, since it is included in weaver jars (to be deployed into application servers).
[中]基于ClassFileTransformer的weaver,允许在类字节数组上应用变压器列表。通常在类装入器中使用。
注意:这个类是为了尽量减少外部依赖而特意实现的,因为它包含在weaver JAR中(要部署到应用服务器中)。

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Create a new SimpleInstrumentableClassLoader for the given ClassLoader.
 * @param parent the ClassLoader to build an instrumentable ClassLoader for
 */
public SimpleInstrumentableClassLoader(@Nullable ClassLoader parent) {
  super(parent);
  this.weavingTransformer = new WeavingTransformer(parent);
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Add a {@link ClassFileTransformer} to be applied by this ClassLoader.
 * @param transformer the {@link ClassFileTransformer} to register
 */
public void addTransformer(ClassFileTransformer transformer) {
  this.weavingTransformer.addTransformer(transformer);
}

代码示例来源:origin: spring-projects/spring-framework

@Override
protected byte[] transformIfNecessary(String name, byte[] bytes) {
  return this.weavingTransformer.transformIfNecessary(name, bytes);
}

代码示例来源:origin: org.springframework/spring-context

@Override
protected byte[] transformIfNecessary(String name, byte[] bytes) {
  return this.weavingTransformer.transformIfNecessary(name, bytes);
}

代码示例来源:origin: org.springframework/spring-context

/**
 * Create a new SimpleInstrumentableClassLoader for the given ClassLoader.
 * @param parent the ClassLoader to build an instrumentable ClassLoader for
 */
public SimpleInstrumentableClassLoader(@Nullable ClassLoader parent) {
  super(parent);
  this.weavingTransformer = new WeavingTransformer(parent);
}

代码示例来源:origin: org.springframework/spring-context

/**
 * Add a {@link ClassFileTransformer} to be applied by this ClassLoader.
 * @param transformer the {@link ClassFileTransformer} to register
 */
public void addTransformer(ClassFileTransformer transformer) {
  this.weavingTransformer.addTransformer(transformer);
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Apply transformation on a given class byte definition.
 * The method will always return a non-null byte array (if no transformation has taken place
 * the array content will be identical to the original one).
 * @param className the full qualified name of the class in dot format (i.e. some.package.SomeClass)
 * @param bytes class byte definition
 * @return (possibly transformed) class byte definition
 */
public byte[] transformIfNecessary(String className, byte[] bytes) {
  String internalName = StringUtils.replace(className, ".", "/");
  return transformIfNecessary(className, internalName, bytes, null);
}

代码示例来源:origin: org.springframework/spring-instrument-tomcat

/**
 * Create a new {@code TomcatInstrumentableClassLoader} with the
 * supplied class loader as parent.
 * @param parent the parent {@link ClassLoader} to be used
 */
public TomcatInstrumentableClassLoader(ClassLoader parent) {
  super(parent);
  this.weavingTransformer = new WeavingTransformer(this);
}

代码示例来源:origin: org.springframework/spring-instrument-tomcat

/**
 * Delegate for LoadTimeWeaver's {@code addTransformer} method.
 * Typically called through ReflectiveLoadTimeWeaver.
 * @see org.springframework.instrument.classloading.LoadTimeWeaver#addTransformer
 * @see org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
 */
public void addTransformer(ClassFileTransformer transformer) {
  this.weavingTransformer.addTransformer(transformer);
}

代码示例来源:origin: org.springframework/spring-context

/**
 * Apply transformation on a given class byte definition.
 * The method will always return a non-null byte array (if no transformation has taken place
 * the array content will be identical to the original one).
 * @param className the full qualified name of the class in dot format (i.e. some.package.SomeClass)
 * @param bytes class byte definition
 * @return (possibly transformed) class byte definition
 */
public byte[] transformIfNecessary(String className, byte[] bytes) {
  String internalName = StringUtils.replace(className, ".", "/");
  return transformIfNecessary(className, internalName, bytes, null);
}

代码示例来源:origin: org.springframework/spring-instrument-classloading

/**
 * Create a new <code>TomcatInstrumentableClassLoader</code> using the
 * current context class loader.
 * @see #TomcatInstrumentableClassLoader(ClassLoader)
 */
public TomcatInstrumentableClassLoader() {
  super();
  this.weavingTransformer = new WeavingTransformer(this);
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Add a {@link ClassFileTransformer} to be applied by this ClassLoader.
 * @param transformer the {@link ClassFileTransformer} to register
 */
public void addTransformer(ClassFileTransformer transformer) {
  this.weavingTransformer.addTransformer(transformer);
}

代码示例来源:origin: apache/servicemix-bundles

@Override
protected byte[] transformIfNecessary(String name, byte[] bytes) {
  return this.weavingTransformer.transformIfNecessary(name, bytes);
}

代码示例来源:origin: org.springframework/spring-instrument-tomcat

/**
 * Create a new {@code TomcatInstrumentableClassLoader} using the
 * current context class loader.
 * @see #TomcatInstrumentableClassLoader(ClassLoader)
 */
public TomcatInstrumentableClassLoader() {
  super();
  this.weavingTransformer = new WeavingTransformer(this);
}

代码示例来源:origin: org.springframework/spring-tomcat-weaver

/**
 * Delegate for LoadTimeWeaver's <code>addTransformer</code> method.
 * Typically called through ReflectiveLoadTimeWeaver.
 * @see org.springframework.instrument.classloading.LoadTimeWeaver#addTransformer
 * @see org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
 */
public void addTransformer(ClassFileTransformer transformer) {
  this.weavingTransformer.addTransformer(transformer);
}

代码示例来源:origin: org.springframework/spring-instrument-tomcat

/**
 * Apply transformation on a given class byte definition.
 * The method will always return a non-null byte array (if no transformation has taken place
 * the array content will be identical to the original one).
 * @param className the full qualified name of the class in dot format (i.e. some.package.SomeClass)
 * @param bytes class byte definition
 * @return (possibly transformed) class byte definition
 */
public byte[] transformIfNecessary(String className, byte[] bytes) {
  String internalName = className.replace(".", "/");
  return transformIfNecessary(className, internalName, bytes, null);
}

代码示例来源:origin: org.springframework/spring-tomcat-weaver

/**
 * Create a new <code>TomcatInstrumentableClassLoader</code> using the
 * current context class loader.
 * @see #TomcatInstrumentableClassLoader(ClassLoader)
 */
public TomcatInstrumentableClassLoader() {
  super();
  this.weavingTransformer = new WeavingTransformer(this);
}

代码示例来源:origin: org.springframework/spring-instrument-classloading

/**
 * Delegate for LoadTimeWeaver's <code>addTransformer</code> method.
 * Typically called through ReflectiveLoadTimeWeaver.
 * @see org.springframework.instrument.classloading.LoadTimeWeaver#addTransformer
 * @see org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
 */
public void addTransformer(ClassFileTransformer transformer) {
  this.weavingTransformer.addTransformer(transformer);
}

代码示例来源:origin: org.springframework/spring-tomcat-weaver

/**
 * Apply transformation on a given class byte definition.
 * The method will always return a non-null byte array (if no transformation has taken place
 * the array content will be identical to the original one).
 * @param className the full qualified name of the class in dot format (i.e. some.package.SomeClass)
 * @param bytes class byte definition
 * @return (possibly transformed) class byte definition
 */
public byte[] transformIfNecessary(String className, byte[] bytes) {
  String internalName = className.replace(".", "/");
  return transformIfNecessary(className, internalName, bytes, null);
}

代码示例来源:origin: org.springframework/spring-tomcat-weaver

/**
 * Create a new <code>TomcatInstrumentableClassLoader</code> with the
 * supplied class loader as parent.
 * @param parent the parent {@link ClassLoader} to be used
 */
public TomcatInstrumentableClassLoader(ClassLoader parent) {
  super(parent);
  this.weavingTransformer = new WeavingTransformer(this);
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com