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

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

      
    
Rootfs path

      
    
Size
2266 (2.2 KB)
MD5
e12a8aca66f3e6cacbfe389fbd0fe9cb
SHA1
62a1d79aa9e4b6538a05d7439557e6d6e66b8507
SHA256
87db0955797eaf5844311fd6d860c27bd186b8d3c541b4ec2d68f5470ae39014
SHA512

      
    
SHA1_git
1a314f38ca94c43950a2ef912e6c51a3c6bf867c
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
PojoHolder.java | 2.2 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 PojoHolder implements ClientEndpointHolder { private static final StringManager sm = StringManager.getManager(PojoHolder.class); private final Object pojo; private final ClientEndpointConfig clientEndpointConfig; public PojoHolder(Object pojo, ClientEndpointConfig clientEndpointConfig) { this.pojo = pojo; this.clientEndpointConfig = clientEndpointConfig; } @Override public String getClassName() { return pojo.getClass().getName(); } @Override public Endpoint getInstance(InstanceManager instanceManager) throws DeploymentException { if (instanceManager != null) { try { instanceManager.newInstance(pojo); } catch (ReflectiveOperationException | NamingException e) { throw new DeploymentException(sm.getString("clientEndpointHolder.instanceRegistrationFailed"), e); } } return new PojoEndpointClient(pojo, clientEndpointConfig.getDecoders(), instanceManager); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
51.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