/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Parameters that users will not likely need to set
* but are useful for debugging
*/
class ServerConfig {
static int clockTick;
/* These values must be a reasonable multiple of clockTick */
static long idleInterval;
static int maxIdleConnections;
// The maximum number of request headers allowable
private static int maxReqHeaders;
// max time a request or response is allowed to take
static long maxReqTime;
static long maxRspTime;
static long timerMillis;
static boolean debug;
// the value of the TCP_NODELAY socket-level option
static boolean noDelay;
static {
new PrivilegedAction<Void>() {
DEFAULT_IDLE_INTERVAL) * 1000;
"sun.net.httpserver.maxIdleConnections",
"sun.net.httpserver.maxReqHeaders",
return null;
}
});
}
// legacy properties that are no longer used
// print a warning to logger if they are set.
new PrivilegedAction<Void>() {
!=null)
{
"property is no longer used. "+
"Use sun.net.httpserver.maxReqTime instead."
);
}
!=null)
{
"property is no longer used. Use "+
"sun.net.httpserver.maxRspTime instead."
);
}
!=null)
{
"property is no longer used."
);
}
return null;
}
}
);
}
static boolean debugEnabled () {
return debug;
}
static long getIdleInterval () {
return idleInterval;
}
static int getClockTick () {
return clockTick;
}
static int getMaxIdleConnections () {
return maxIdleConnections;
}
static long getDrainAmount () {
return drainAmount;
}
static int getMaxReqHeaders() {
return maxReqHeaders;
}
static long getMaxReqTime () {
return maxReqTime;
}
static long getMaxRspTime () {
return maxRspTime;
}
static long getTimerMillis () {
return timerMillis;
}
static boolean noDelay() {
return noDelay;
}
}