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

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

      
    
Rootfs path

      
    
Size
2437 (2.4 KB)
MD5
9ec5fe1d860b9f54ecde64dc4162a5f0
SHA1
03bbd013ad16be7d2ed49a0834bed47f1203ed32
SHA256
5d0374a797e45138fea669b73a561de6e105b82abeef697143b58dedac633b41
SHA512

      
    
SHA1_git
42fd02db17eefad44833ba7ee86db78706b4121f
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
PojoClassHolder.java | 2.4 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.websocket; import javax.naming.NamingException; import jakarta.websocket.ClientEndpointConfig; import jakarta.websocket.DeploymentException; import jakarta.websocket.Endpoint; import org.apache.tomcat.InstanceManager; import org.apache.tomcat.util.res.StringManager; import org.apache.tomcat.websocket.pojo.PojoEndpointClient; public class PojoClassHolder implements ClientEndpointHolder { private static final StringManager sm = StringManager.getManager(PojoClassHolder.class); private final Class<?> pojoClazz; private final ClientEndpointConfig clientEndpointConfig; public PojoClassHolder(Class<?> pojoClazz, ClientEndpointConfig clientEndpointConfig) { this.pojoClazz = pojoClazz; this.clientEndpointConfig = clientEndpointConfig; } @Override public String getClassName() { return pojoClazz.getName(); } @Override public Endpoint getInstance(InstanceManager instanceManager) throws DeploymentException { try { Object pojo; if (instanceManager == null) { pojo = pojoClazz.getConstructor().newInstance(); } else { pojo = instanceManager.newInstance(pojoClazz); } return new PojoEndpointClient(pojo, clientEndpointConfig.getDecoders(), instanceManager); } catch (ReflectiveOperationException | SecurityException | NamingException e) { throw new DeploymentException(sm.getString("clientEndpointHolder.instanceCreationFailed"), e); } } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
49.79
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