ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/naming/factory/EjbFactory.java

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

      
    
Rootfs path

      
    
Size
2608 (2.5 KB)
MD5
4cad5d599b02e9a2ee4b98afcce7bfd6
SHA1
32d2a5de336310b3811cddb01437b398b7b291b2
SHA256
9d97e7a3927d125015e80f1abe966ddaf0f9d70cc0d2120194f0d64da542853f
SHA512

      
    
SHA1_git
c1dc1971dd5b43ab678c08554a818933e6154d1c
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
EjbFactory.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.naming.factory; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.naming.RefAddr; import javax.naming.Reference; import javax.naming.spi.ObjectFactory; import org.apache.naming.EjbRef; import org.apache.naming.StringManager; /** * Object factory for EJBs. */ public class EjbFactory extends FactoryBase { private static final StringManager sm = StringManager.getManager(EjbFactory.class); @Override protected boolean isReferenceTypeSupported(Object obj) { return obj instanceof EjbRef; } @Override protected ObjectFactory getDefaultFactory(Reference ref) throws NamingException { ObjectFactory factory; String javaxEjbFactoryClassName = System.getProperty("jakarta.ejb.Factory", Constants.OPENEJB_EJB_FACTORY); try { factory = (ObjectFactory) Class.forName(javaxEjbFactoryClassName).getConstructor().newInstance(); } catch (Throwable t) { if (t instanceof VirtualMachineError) { throw (VirtualMachineError) t; } NamingException ex = new NamingException(sm.getString("factoryBase.factoryCreationError")); ex.initCause(t); throw ex; } return factory; } @Override protected Object getLinked(Reference ref) throws NamingException { // If ejb-link has been specified, resolving the link using JNDI RefAddr linkRefAddr = ref.get(EjbRef.LINK); if (linkRefAddr != null) { // Retrieving the EJB link String ejbLink = linkRefAddr.getContent().toString(); return (new InitialContext()).lookup(ejbLink); } return null; } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
42.81
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