ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/InstrumentableClassLoader.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/InstrumentableClassLoader.java
Status
scanned
Type
file
Name
InstrumentableClassLoader.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
3417 (3.3 KB)
MD5
2713371d2a840914f65a8036c12f15d8
SHA1
6fc0e69750d0a4c79aa4ab32ba3cbd8118b97289
SHA256
b2c453a2bded90911ad00d96d0644001441f8b143d24761469bb12f750939c73
SHA512

      
    
SHA1_git
103fef0c91e08b71fd058ba907b6a6038deb3b8d
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
InstrumentableClassLoader.java | 3.3 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tomcat; import java.lang.instrument.ClassFileTransformer; /** * Specifies a class loader capable of being decorated with {@link ClassFileTransformer}s. These transformers can * instrument (or weave) the byte code of classes loaded through this class loader to alter their behavior. Currently * only {@link org.apache.catalina.loader.WebappClassLoaderBase} implements this interface. This allows web application * frameworks or JPA providers bundled with a web application to instrument web application classes as necessary. * <p> * You should always program against the methods of this interface (whether using reflection or otherwise). The methods * in {@code WebappClassLoaderBase} are protected by the default security manager if one is in use. * * @since 8.0, 7.0.64 */ public interface InstrumentableClassLoader { /** * Adds the specified class file transformer to this class loader. The transformer will then be able to instrument * the bytecode of any classes loaded by this class loader after the invocation of this method. * * @param transformer The transformer to add to the class loader * * @throws IllegalArgumentException if the {@literal transformer} is null. */ void addTransformer(ClassFileTransformer transformer); /** * Removes the specified class file transformer from this class loader. It will no longer be able to instrument the * byte code of any classes loaded by the class loader after the invocation of this method. However, any classes * already instrumented by this transformer before this method call will remain in their instrumented state. * * @param transformer The transformer to remove */ void removeTransformer(ClassFileTransformer transformer); /** * Returns a copy of this class loader without any class file transformers. This is a tool often used by Java * Persistence API providers to inspect entity classes in the absence of any instrumentation, something that can't * be guaranteed within the context of a {@link ClassFileTransformer}'s * {@link ClassFileTransformer#transform(ClassLoader, String, Class, java.security.ProtectionDomain, byte[]) * transform} method. * <p> * The returned class loader's resource cache will have been cleared so that classes already instrumented will not * be retained or returned. * * @return the transformer-free copy of this class loader. */ ClassLoader copyWithoutTransformers(); }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
28.07
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9