Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 11 java.naming.jmod - Naming Module
JDK 11 java.naming.jmod is the JMOD file for JDK 11 Naming module.
JDK 11 Naming module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.naming.jmod.
JDK 11 Naming module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Naming module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.naming.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/naming/internal/FactoryEnumeration.java
/*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.naming.internal;
import java.util.List;
import javax.naming.NamingException;
/**
* The FactoryEnumeration is used for returning factory instances.
*
* @author Rosanna Lee
* @author Scott Seligman
*/
// no need to implement Enumeration since this is only for internal use
public final class FactoryEnumeration {
// List<NamedWeakReference<Class | Object>>
private List<NamedWeakReference<Object>> factories;
private int posn = 0;
private ClassLoader loader;
/**
* Records the input list and uses it directly to satisfy
* hasMore()/next() requests. An alternative would have been to use
* an enumeration/iterator from the list, but we want to update the
* list so we keep the
* original list. The list initially contains Class objects.
* As each element is used, the Class object is replaced by an
* instance of the Class itself; eventually, the list contains
* only a list of factory instances and no more updates are required.
*
* <p> Both Class objects and factories are wrapped in weak
* references so as not to prevent GC of the class loader. Each
* weak reference is tagged with the factory's class name so the
* class can be reloaded if the reference is cleared.
*
* @param factories A non-null list
* @param loader The class loader of the list's contents
*
* This internal method is used with Thread Context Class Loader (TCCL),
* please don't expose this method as public.
*/
FactoryEnumeration(List<NamedWeakReference<Object>> factories,
ClassLoader loader) {
this.factories = factories;
this.loader = loader;
}
public Object next() throws NamingException {
synchronized (factories) {
NamedWeakReference<Object> ref = factories.get(posn++);
Object answer = ref.get();
if ((answer != null) && !(answer instanceof Class)) {
return answer;
}
String className = ref.getName();
try {
if (answer == null) { // reload class if weak ref cleared
Class<?> cls = Class.forName(className, true, loader);
answer = cls;
}
// Instantiate Class to get factory
@SuppressWarnings("deprecation")
Object tmp = ((Class) answer).newInstance();
answer = tmp;
ref = new NamedWeakReference<>(answer, className);
factories.set(posn-1, ref); // replace Class object or null
return answer;
} catch (ClassNotFoundException e) {
NamingException ne =
new NamingException("No longer able to load " + className);
ne.setRootCause(e);
throw ne;
} catch (InstantiationException e) {
NamingException ne =
new NamingException("Cannot instantiate " + answer);
ne.setRootCause(e);
throw ne;
} catch (IllegalAccessException e) {
NamingException ne = new NamingException("Cannot access " + answer);
ne.setRootCause(e);
throw ne;
}
}
}
public boolean hasMore() {
synchronized (factories) {
return posn < factories.size();
}
}
}
⏎ com/sun/naming/internal/FactoryEnumeration.java
Or download all of them as a single archive file:
File name: java.naming-11.0.1-src.zip File size: 461792 bytes Release date: 2018-11-04 Download
⇒ JDK 11 java.net.http.jmod - Net HTTP Module
2020-09-30, ≈99🔥, 0💬
Popular Posts:
JDK 17 jdk.xml.dom.jmod is the JMOD file for JDK 17 XML DOM module. JDK 17 XML DOM module compiled c...
JDK 11 jdk.jconsole.jmod is the JMOD file for JDK 11 JConsole tool, which can be invoked by the "jco...
xml-commons External Source Code Files are provided in the source package file, xml-commons-external...
What is jxl.jar 2.6.12? jxl.jar 2.6.12 is the JAR file for Java Excel API 2.6.12, which is a Java li...
What Is in Xerces-J-bin.2.12.2.zip? Xerces-J-bin.2.12.2.zip file is the distribution package ZIP fil...