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

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

      
    
Rootfs path

      
    
Size
2581 (2.5 KB)
MD5
44d0fa7d365c28fa94dadf2562e9100c
SHA1
3d1c46e25eb92ef55d6fb2e20f9b186ad7378f42
SHA256
c26aa678cd17a9cfe47233d6eed623ad0efb7719d386fd8546115a9e05a73a39
SHA512

      
    
SHA1_git
a5b404bf81b074a320ca1a70b6288af8eb416ee3
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
SimpleInstanceManager.java | 2.5 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.reflect.InvocationTargetException; import javax.naming.NamingException; /** * SimpleInstanceManager implements the org.apache.tomcat.InstanceManager interface. */ public class SimpleInstanceManager implements InstanceManager { public SimpleInstanceManager() { } @Override public Object newInstance(Class<?> clazz) throws IllegalAccessException, InvocationTargetException, NamingException, InstantiationException, NoSuchMethodException { return prepareInstance(clazz.getConstructor().newInstance()); } @Override public Object newInstance(String className) throws IllegalAccessException, InvocationTargetException, NamingException, InstantiationException, ClassNotFoundException, NoSuchMethodException { Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(className); return prepareInstance(clazz.getConstructor().newInstance()); } @Override public Object newInstance(String fqcn, ClassLoader classLoader) throws IllegalAccessException, InvocationTargetException, NamingException, InstantiationException, ClassNotFoundException, NoSuchMethodException { Class<?> clazz = classLoader.loadClass(fqcn); return prepareInstance(clazz.getConstructor().newInstance()); } @Override public void newInstance(Object o) throws IllegalAccessException, InvocationTargetException, NamingException { // NO-OP } @Override public void destroyInstance(Object o) throws IllegalAccessException, InvocationTargetException { } private Object prepareInstance(Object o) { return o; } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
50.0
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