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 17 java.naming.jmod - Naming Module
JDK 17 java.naming.jmod is the JMOD file for JDK 17 Naming module.
JDK 17 Naming module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.naming.jmod.
JDK 17 Naming module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Naming module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.naming.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/jndi/ldap/pool/ConnectionDesc.java
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.jndi.ldap.pool;
/**
* Represents a description of PooledConnection in Connections.
* Contains a PooledConnection, its state (busy, idle, expired), and idle time.
*
* Any access or update to a descriptor's state is synchronized.
*
* @author Rosanna Lee
*/
final class ConnectionDesc {
private static final boolean debug = Pool.debug;
// Package private because used by Pool.showStats()
static final byte BUSY = (byte)0;
static final byte IDLE = (byte)1;
static final byte EXPIRED = (byte)2;
private final PooledConnection conn;
private byte state = IDLE; // initial state
private long idleSince;
private long useCount = 0; // for stats & debugging only
ConnectionDesc(PooledConnection conn) {
this.conn = conn;
}
ConnectionDesc(PooledConnection conn, boolean use) {
this.conn = conn;
if (use) {
state = BUSY;
++useCount;
}
}
/**
* Two desc are equal if their PooledConnections are the same.
* This is useful when searching for a ConnectionDesc using only its
* PooledConnection.
*/
public boolean equals(Object obj) {
return obj != null
&& obj instanceof ConnectionDesc
&& ((ConnectionDesc)obj).conn == conn;
}
/**
* Hashcode is that of PooledConnection to facilitate
* searching for a ConnectionDesc using only its PooledConnection.
*/
public int hashCode() {
return conn.hashCode();
}
/**
* Changes the state of a ConnectionDesc from BUSY to IDLE and
* records the current time so that we will know how long it has been idle.
* @return true if state change occurred.
*/
synchronized boolean release() {
d("release()");
if (state == BUSY) {
state = IDLE;
idleSince = System.currentTimeMillis();
return true; // Connection released, ready for reuse
} else {
return false; // Connection wasn't busy to begin with
}
}
/**
* If ConnectionDesc is IDLE, change its state to BUSY and return
* its connection.
*
* @return ConnectionDesc's PooledConnection if it was idle; null otherwise.
*/
synchronized PooledConnection tryUse() {
d("tryUse()");
if (state == IDLE) {
state = BUSY;
++useCount;
return conn;
}
return null;
}
/**
* If ConnectionDesc is IDLE and has expired, close the corresponding
* PooledConnection.
*
* @param threshold a connection that has been idle before this time
* have expired.
*
* @return true if entry is idle and has expired; false otherwise.
*/
synchronized boolean expire(long threshold) {
if (state == IDLE && idleSince < threshold) {
d("expire(): expired");
state = EXPIRED;
conn.closeConnection(); // Close real connection
return true; // Expiration successful
} else {
d("expire(): not expired");
return false; // Expiration did not occur
}
}
public String toString() {
return conn.toString() + " " +
(state == BUSY ? "busy" : (state == IDLE ? "idle" : "expired"));
}
// Used by Pool.showStats()
int getState() {
return state;
}
// Used by Pool.showStats()
long getUseCount() {
return useCount;
}
private void d(String msg) {
if (debug) {
System.err.println("ConnectionDesc." + msg + " " + toString());
}
}
}
⏎ com/sun/jndi/ldap/pool/ConnectionDesc.java
Or download all of them as a single archive file:
File name: java.naming-17.0.5-src.zip File size: 490626 bytes Release date: 2022-09-13 Download
⇒ JDK 17 java.net.http.jmod - Net HTTP Module
2023-09-23, ≈27🔥, 0💬
Popular Posts:
How to read XML document with DTD validation from socket connections with the socket\DelayedInput.ja.. .
What JAR files are required to run dom\Counter.java provided in the Apache Xerces package? You can f...
JDK 11 java.sql.jmod is the JMOD file for JDK 11 SQL (Structured Query Language) module. JDK 11 SQL ...
maven-embedder-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Embedder module. Apache Maven is a s...
JDK 8 tools.jar is the JAR file for JDK 8 tools. It contains Java classes to support different JDK t...