AbstractEndpoint泛型抽象类

tomcat服务器解析(二) --- Endpoint Endpoint主要用来提供基础的网络I/O服务,封装了网络通讯相关的细节。在AbstractProtocol中对Endpoint有这样一段注释     /**      * Endpoint that provides low - level network I/O - must be matched to the      * ProtocolHandler im 阅读详情

该类是连接请求监听端口类

该类主要用于启动监听连接请求、在请求发送过来的时候创建处理线程并将请求交由工作线程处理
	// -------------------------------------------------------------- Constants
	protected static final StringManager sm = StringManager.getManager("org.apache.tomcat.util.net.res");

	/**
	 * 处理request请求
	 * 
	 * @author songjianc
	 *
	 */
	public static interface Handler {
		
		/**
		 * Different types of socket states to react upon.
		 * socket的不同状态
		 */
		public enum SocketState {
			// TODO Add a new state to the AsyncStateMachine and remove
			// ASYNC_END (if possible)
			OPEN, CLOSED, LONG, ASYNC_END, SENDFILE, UPGRADING_TOMCAT, UPGRADING, UPGRADED
		}

		/**
		 * Obtain the GlobalRequestProcessor associated with the handler.
		 * 获取该handler所关联的GlobalRequestProcessor
		 */
		public Object getGlobal();

		/**
		 * Recycle resources associated with the handler.
		 * 重置该handler所关联的资源
		 */
		public void recycle();
	}

	protected enum BindState {
		UNBOUND, BOUND_ON_INIT, BOUND_ON_START
	}
	
	/**
	 * 请求接收器,接收后将Socket分配给工作线程继续后续处理
	 * 
	 * @author songjianc
	 *
	 */
	public abstract static class Acceptor implements Runnable {
		/**
		 * Acceptor的状态
		 * @author songjianc
		 *
		 */
		public enum AcceptorState {
			// new running paused ended
			NEW, RUNNING, PAUSED, ENDED
		}

		protected volatile AcceptorState state = AcceptorState.NEW;
		
		/**
		 * 获取状态
		 * @return
		 */
		public final AcceptorState getState() {
			return state;
		}
		
		private String threadName;

		protected final void setThreadName(final String threadName) {
			this.threadName = threadName;
		}

		protected final String getThreadName() {
			return threadName;
		}
	}

	private static final int INITIAL_ERROR_DELAY = 50;
	private static final int MAX_ERROR_DELAY = 1600;

	// ----------------------------------------------------------------- 属性

	/**
	 * endpoint的运行状态
	 */
	protected volatile boolean running = false;

	/**
	 * 当endpoint被暂停时该属性为true
	 */
	protected volatile boolean paused = false;

	/**
	 * 是否使用一个内部的executor
	 */
	protected volatile boolean internalExecutor = false;

	/**
	 * counter for nr of connections handled by an endpoint
	 */
	private volatile LimitLatch connectionLimitLatch = null;

	/**
	 * socket的参数配置Socket properties
	 */
	protected SocketProperties socketProperties = new SocketProperties();

	public SocketProperties getSocketProperties() {
		return socketProperties;
	}

	/**
	 * 用来接受一个新的connection并将他们交给线程的线程池
	 * Threads used to accept new connections and pass them to worker threads.
	 */
	protected Acceptor[] acceptors;

	// -----------------------------------------------------------------
	// 属性

	/**
	 * Time to wait for the internal executor (if used) to terminate when the
	 * endpoint is stopped in milliseconds. Defaults to 5000 (5 seconds).
	 */
	private long executorTerminationTimeoutMillis = 5000;

	public long getExecutorTerminationTimeoutMillis() {
		return executorTerminationTimeoutMillis;
	}

	public void setExecutorTerminationTimeoutMillis(
			long executorTerminationTimeoutMillis) {
		this.executorTerminationTimeoutMillis = executorTerminationTimeoutMillis;
	}

	/**
	 * Acceptor线程计数器
	 */
	protected int acceptorThreadCount = 0;

	public void setAcceptorThreadCount(int acceptorThreadCount) {
		this.acceptorThreadCount = acceptorThreadCount;
	}

	public int getAcceptorThreadCount() {
		return acceptorThreadCount;
	}

	/**
	 * acceptor线程的优先级
	 */
	protected int acceptorThreadPriority = Thread.NORM_PRIORITY;

	public void setAcceptorThreadPriority(int acceptorThreadPriority) {
		this.acceptorThreadPriority = acceptorThreadPriority;
	}

	public int getAcceptorThreadPriority() {
		return acceptorThreadPriority;
	}

	private int maxConnections = 10000;

	public void setMaxConnections(int maxCon) {
		this.maxConnections = maxCon;
		LimitLatch latch = this.connectionLimitLatch;
		if (latch != null) {
			// Update the latch that enforces this
			if (maxCon == -1) {
				releaseConnectionLatch();
			} else {
				latch.setLimit(maxCon);
			}
		} else if (maxCon > 0) {
			initializeConnectionLatch();
		}
	}

	public int getMaxConnections() {
		return this.maxConnections;
	}

	/**
	 * Return the current count of connections handled by this endpoint, if the
	 * connections are counted (which happens when the maximum count of
	 * connections is limited), or <code>-1</code> if they are not. This
	 * property is added here so that this value can be inspected through JMX.
	 * It is visible on "ThreadPool" MBean.
	 * 
	 * <p>
	 * The count is incremented by the Acceptor before it tries to accept a new
	 * connection. Until the limit is reached and thus the count cannot be
	 * incremented, this value is more by 1 (the count of acceptors) than the
	 * actual count of connections that are being served.
	 * 
	 * @return The count
	 */
	public long getConnectionCount() {
		LimitLatch latch = connectionLimitLatch;
		if (latch != null) {
			return latch.getCount();
		}
		return -1;
	}

	/**
	 * External Executor based thread pool.
	 */
	private Executor executor = null;

	public void setExecutor(Executor executor) {
		this.executor = executor;
		this.internalExecutor = (executor == null);
	}

	public Executor getExecutor() {
		return executor;
	}

	/**
	 * ServerSocket的监听端口
	 * Server socket port.
	 */
	private int port;

	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}

	public abstract int getLocalPort();

	/**
	 * ServerSocket的监听地址
	 * Address for the server socket.
	 */
	private InetAddress address;

	public InetAddress getAddress() {
		return address;
	}

	public void setAddress(InetAddress address) {
		this.address = address;
	}

	/**
	 * Allows the server developer to specify the backlog that should be used
	 * for server sockets. By default, this value is 100.
	 */
	private int backlog = 100;

	public void setBacklog(int backlog) {
		if (backlog > 0)
			this.backlog = backlog;
	}

	public int getBacklog() {
		return backlog;
	}

	/**
	 * Controls when the Endpoint binds the port. <code>true</code>, the default
	 * binds the port on {@link #init()} and unbinds it on {@link #destroy()}.
	 * If set to <code>false</code> the port is bound on {@link #start()} and
	 * unbound on {@link #stop()}.
	 */
	private boolean bindOnInit = true;

	public boolean getBindOnInit() {
		return bindOnInit;
	}

	public void setBindOnInit(boolean b) {
		this.bindOnInit = b;
	}

	private BindState bindState = BindState.UNBOUND;

	/**
	 * Keepalive timeout, if not set the soTimeout is used.
	 */
	private Integer keepAliveTimeout = null;

	public int getKeepAliveTimeout() {
		if (keepAliveTimeout == null) {
			return getSoTimeout();
		} else {
			return keepAliveTimeout.intValue();
		}
	}

	public void setKeepAliveTimeout(int keepAliveTimeout) {
		this.keepAliveTimeout = Integer.valueOf(keepAliveTimeout);
	}

	/**
	 * Socket TCP no delay.
	 */
	public boolean getTcpNoDelay() {
		return socketProperties.getTcpNoDelay();
	}

	public void setTcpNoDelay(boolean tcpNoDelay) {
		socketProperties.setTcpNoDelay(tcpNoDelay);
	}

	/**
	 * Socket linger.
	 */
	public int getSoLinger() {
		return socketProperties.getSoLingerTime();
	}

	public void setSoLinger(int soLinger) {
		socketProperties.setSoLingerTime(soLinger);
		socketProperties.setSoLingerOn(soLinger >= 0);
	}

	/**
	 * Socket timeout.
	 */
	public int getSoTimeout() {
		return socketProperties.getSoTimeout();
	}

	public void setSoTimeout(int soTimeout) {
		socketProperties.setSoTimeout(soTimeout);
	}

	/**
	 * SSL engine.
	 */
	private boolean SSLEnabled = false;

	public boolean isSSLEnabled() {
		return SSLEnabled;
	}

	public void setSSLEnabled(boolean SSLEnabled) {
		this.SSLEnabled = SSLEnabled;
	}

	private int minSpareThreads = 10;

	public int getMinSpareThreads() {
		return Math.min(minSpareThreads, getMaxThreads());
	}

	public void setMinSpareThreads(int minSpareThreads) {
		this.minSpareThreads = minSpareThreads;
		if (running && executor != null) {
			if (executor instanceof java.util.concurrent.ThreadPoolExecutor) {
				((java.util.concurrent.ThreadPoolExecutor) executor)
						.setCorePoolSize(minSpareThreads);
			} else if (executor instanceof ResizableExecutor) {
				((ResizableExecutor) executor).resizePool(minSpareThreads,
						maxThreads);
			}
		}
	}

	/**
	 * worker线程的最大数量
	 * Maximum amount of worker threads.
	 */
	private int maxThreads = 200;

	public void setMaxThreads(int maxThreads) {
		this.maxThreads = maxThreads;
		if (running && executor != null) {
			if (executor instanceof java.util.concurrent.ThreadPoolExecutor) {
				((java.util.concurrent.ThreadPoolExecutor) executor)
						.setMaximumPoolSize(maxThreads);
			} else if (executor instanceof ResizableExecutor) {
				((ResizableExecutor) executor).resizePool(minSpareThreads,
						maxThreads);
			}
		}
	}

	public int getMaxThreads() {
		return getMaxThreadsExecutor(running);
	}

	protected int getMaxThreadsExecutor(boolean useExecutor) {
		if (useExecutor && executor != null) {
			if (executor instanceof java.util.concurrent.ThreadPoolExecutor) {
				return ((java.util.concurrent.ThreadPoolExecutor) executor)
						.getMaximumPoolSize();
			} else if (executor instanceof ResizableExecutor) {
				return ((ResizableExecutor) executor).getMaxThreads();
			} else {
				return -1;
			}
		} else {
			return maxThreads;
		}
	}

	/**
	 * Max keep alive requests
	 */
	private int maxKeepAliveRequests = 100; // as in Apache HTTPD server

	public int getMaxKeepAliveRequests() {
		return maxKeepAliveRequests;
	}

	public void setMaxKeepAliveRequests(int maxKeepAliveRequests) {
		this.maxKeepAliveRequests = maxKeepAliveRequests;
	}

	/**
	 * The maximum number of headers in a request that are allowed. 100 by
	 * default. A value of less than 0 means no limit.
	 */
	private int maxHeaderCount = 100; // as in Apache HTTPD server

	public int getMaxHeaderCount() {
		return maxHeaderCount;
	}

	public void setMaxHeaderCount(int maxHeaderCount) {
		this.maxHeaderCount = maxHeaderCount;
	}

	/**
	 * Name of the thread pool, which will be used for naming child threads.
	 */
	private String name = "TP";

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	/**
	 * The default is true - the created threads will be in daemon mode. If set
	 * to false, the control thread will not be daemon - and will keep the
	 * process alive.
	 */
	private boolean daemon = true;

	public void setDaemon(boolean b) {
		daemon = b;
	}

	public boolean getDaemon() {
		return daemon;
	}

	/**
	 * Priority of the worker threads.
	 */
	protected int threadPriority = Thread.NORM_PRIORITY;

	public void setThreadPriority(int threadPriority) {
		this.threadPriority = threadPriority;
	}

	public int getThreadPriority() {
		return threadPriority;
	}

	protected abstract boolean getDeferAccept();

	/**
	 * 属性存储Map
	 * Attributes provide a way for configuration to be passed to sub-components
	 * without the {@link org.apache.coyote.ProtocolHandler} being aware of the
	 * properties available on those sub-components. One example of such a
	 * sub-component is the
	 * {@link org.apache.tomcat.util.net.ServerSocketFactory}.
	 */
	protected HashMap<String, Object> attributes = new HashMap<String, Object>();

	/**
	 * 向属性存储map中存放一个key-value
	 * Generic property setter called when a property for which a specific
	 * setter already exists within the
	 * {@link org.apache.coyote.ProtocolHandler} needs to be made available to
	 * sub-components. The specific setter will call this method to populate the
	 * attributes.
	 */
	public void setAttribute(String name, Object value) {
		if (getLog().isTraceEnabled()) {
			getLog().trace(
					sm.getString("abstractProtocolHandler.setAttribute", name,
							value));
		}
		attributes.put(name, value);
	}

	/**
	 * 从属性map中获取一个值
	 * Used by sub-components to retrieve configuration information.
	 */
	public Object getAttribute(String key) {
		Object value = attributes.get(key);
		if (getLog().isTraceEnabled()) {
			getLog().trace(
					sm.getString("abstractProtocolHandler.getAttribute", key,
							value));
		}
		return value;
	}

	/**
	 * 向map中添加一个属性
	 * 
	 * @param name
	 * @param value
	 * @return
	 */
	public boolean setProperty(String name, String value) {
		setAttribute(name, value);
		final String socketName = "socket.";
		try {
			if (name.startsWith(socketName)) {
				return IntrospectionUtils.setProperty(socketProperties,
						name.substring(socketName.length()), value);
			} else {
				return IntrospectionUtils.setProperty(this, name, value, false);
			}
		} catch (Exception x) {
			getLog().error(
					"Unable to set attribute \"" + name + "\" to \"" + value
							+ "\"", x);
			return false;
		}
	}

	public String getProperty(String name) {
		return (String) getAttribute(name);
	}

	/**
	 * Return the amount of threads that are managed by the pool.
	 * 
	 * @return the amount of threads that are managed by the pool
	 */
	public int getCurrentThreadCount() {
		if (executor != null) {
			if (executor instanceof ThreadPoolExecutor) {
				return ((ThreadPoolExecutor) executor).getPoolSize();
			} else if (executor instanceof ResizableExecutor) {
				return ((ResizableExecutor) executor).getPoolSize();
			} else {
				return -1;
			}
		} else {
			return -2;
		}
	}

	/**
	 * Return the amount of threads that are in use
	 * 
	 * @return the amount of threads that are in use
	 */
	public int getCurrentThreadsBusy() {
		if (executor != null) {
			if (executor instanceof ThreadPoolExecutor) {
				return ((ThreadPoolExecutor) executor).getActiveCount();
			} else if (executor instanceof ResizableExecutor) {
				return ((ResizableExecutor) executor).getActiveCount();
			} else {
				return -1;
			}
		} else {
			return -2;
		}
	}

	public boolean isRunning() {
		return running;
	}

	public boolean isPaused() {
		return paused;
	}

	/**
	 * 创建一个线程执行器
	 */
	public void createExecutor() {
		internalExecutor = true;
		TaskQueue taskqueue = new TaskQueue();
		TaskThreadFactory tf = new TaskThreadFactory(getName() + "-exec-",
				daemon, getThreadPriority());
		executor = new ThreadPoolExecutor(getMinSpareThreads(),
				getMaxThreads(), 60, TimeUnit.SECONDS, taskqueue, tf);
		taskqueue.setParent((ThreadPoolExecutor) executor);
	}

	/**
	 * 关闭线程执行器
	 */
	public void shutdownExecutor() {
		if (executor != null && internalExecutor) {
			if (executor instanceof ThreadPoolExecutor) {
				// this is our internal one, so we need to shut it down
				ThreadPoolExecutor tpe = (ThreadPoolExecutor) executor;
				tpe.shutdownNow();
				long timeout = getExecutorTerminationTimeoutMillis();
				if (timeout > 0) {
					try {
						tpe.awaitTermination(timeout, TimeUnit.MILLISECONDS);
					} catch (InterruptedException e) {
						// Ignore
					}
					if (tpe.isTerminating()) {
						getLog().warn(
								sm.getString("endpoint.warn.executorShutdown",
										getName()));
					}
				}
				TaskQueue queue = (TaskQueue) tpe.getQueue();
				queue.setParent(null);
			}
			executor = null;
		}
	}

	/**
	 * 开启ServerSocket
	 * Unlock the server socket accept using a bogus connection.
	 */
	protected void unlockAccept() {
		// Only try to unlock the acceptor if it is necessary
		boolean unlockRequired = false;
		for (Acceptor acceptor : acceptors) {
			if (acceptor.getState() == AcceptorState.RUNNING) {
				unlockRequired = true;
				break;
			}
		}
		if (!unlockRequired) {
			return;
		}

		java.net.Socket s = null;
		InetSocketAddress saddr = null;
		try {
			// Need to create a connection to unlock the accept();
			if (address == null) {
				saddr = new InetSocketAddress("localhost", getLocalPort());
			} else {
				saddr = new InetSocketAddress(address, getLocalPort());
			}
			s = new java.net.Socket();
			int stmo = 2 * 1000;
			int utmo = 2 * 1000;
			if (getSocketProperties().getSoTimeout() > stmo)
				stmo = getSocketProperties().getSoTimeout();
			if (getSocketProperties().getUnlockTimeout() > utmo)
				utmo = getSocketProperties().getUnlockTimeout();
			s.setSoTimeout(stmo);
			// TODO Consider hard-coding to s.setSoLinger(true,0)
			s.setSoLinger(getSocketProperties().getSoLingerOn(),
					getSocketProperties().getSoLingerTime());
			if (getLog().isDebugEnabled()) {
				getLog().debug("About to unlock socket for:" + saddr);
			}
			s.connect(saddr, utmo);
			if (getDeferAccept()) {
				/*
				 * In the case of a deferred accept / accept filters we need to
				 * send data to wake up the accept. Send OPTIONS * to bypass
				 * even BSD accept filters. The Acceptor will discard it.
				 */
				OutputStreamWriter sw;

				sw = new OutputStreamWriter(s.getOutputStream(), "ISO-8859-1");
				sw.write("OPTIONS * HTTP/1.0\r\n"
						+ "User-Agent: Tomcat wakeup connection\r\n\r\n");
				sw.flush();
			}
			if (getLog().isDebugEnabled()) {
				getLog().debug("Socket unlock completed for:" + saddr);
			}

			// Wait for upto 1000ms acceptor threads to unlock
			long waitLeft = 1000;
			for (Acceptor acceptor : acceptors) {
				while (waitLeft > 0
						&& acceptor.getState() == AcceptorState.RUNNING) {
					Thread.sleep(50);
					waitLeft -= 50;
				}
			}
		} catch (Exception e) {
			if (getLog().isDebugEnabled()) {
				getLog().debug(
						sm.getString("endpoint.debug.unlock", "" + getPort()),
						e);
			}
		} finally {
			if (s != null) {
				try {
					s.close();
				} catch (Exception e) {
					// Ignore
				}
			}
		}
	}

	// ---------------------------------------------- Request processing methods

	public abstract void processSocketAsync(SocketWrapper<S> socketWrapper,
			SocketStatus socketStatus);

	// ------------------------------------------------------- Lifecycle methods

	/*
	 * NOTE: There is no maintenance of state or checking for valid transitions
	 * within this class other than ensuring that bind/unbind are called in the
	 * right place. It is expected that the calling code will maintain state and
	 * prevent invalid state transitions.
	 */

	public abstract void bind() throws Exception;

	public abstract void unbind() throws Exception;

	public abstract void startInternal() throws Exception;

	public abstract void stopInternal() throws Exception;

	/**
	 * 调用声明的抽象方法
	 * 
	 * @throws Exception
	 */
	public final void init() throws Exception {
		if (bindOnInit) {
			bind();
			bindState = BindState.BOUND_ON_INIT;
		}
	}

	public final void start() throws Exception {
		if (bindState == BindState.UNBOUND) {
			bind();
			bindState = BindState.BOUND_ON_START;
		}
		startInternal();
	}

	protected final void startAcceptorThreads() {
		int count = getAcceptorThreadCount();
		acceptors = new Acceptor[count];

		for (int i = 0; i < count; i++) {
			acceptors[i] = createAcceptor();
			String threadName = getName() + "-Acceptor-" + i;
			acceptors[i].setThreadName(threadName);
			Thread t = new Thread(acceptors[i], threadName);
			t.setPriority(getAcceptorThreadPriority());
			t.setDaemon(getDaemon());
			t.start();
		}
	}

	/**
	 * Hook to allow Endpoints to provide a specific Acceptor implementation.
	 */
	protected abstract Acceptor createAcceptor();

	/**
	 * Pause the endpoint, which will stop it accepting new connections.
	 */
	public void pause() {
		if (running && !paused) {
			paused = true;
			unlockAccept();
		}
	}

	/**
	 * Resume the endpoint, which will make it start accepting new connections
	 * again.
	 */
	public void resume() {
		if (running) {
			paused = false;
		}
	}

	public final void stop() throws Exception {
		stopInternal();
		if (bindState == BindState.BOUND_ON_START) {
			unbind();
			bindState = BindState.UNBOUND;
		}
	}

	public final void destroy() throws Exception {
		if (bindState == BindState.BOUND_ON_INIT) {
			unbind();
			bindState = BindState.UNBOUND;
		}
	}

	public String adjustRelativePath(String path, String relativeTo) {
		// Empty or null path can't point to anything useful. The assumption is
		// that the value is deliberately empty / null so leave it that way.
		if (path == null || path.length() == 0) {
			return path;
		}
		String newPath = path;
		File f = new File(newPath);
		if (!f.isAbsolute()) {
			newPath = relativeTo + File.separator + newPath;
			f = new File(newPath);
		}
		if (!f.exists()) {
			getLog().warn("configured file:[" + newPath + "] does not exist.");
		}
		return newPath;
	}

	protected abstract Log getLog();

	// Flags to indicate optional feature support
	// Some of these are always hard-coded, some are hard-coded to false (i.e.
	// the endpoint does not support them) and some are configurable.
	public abstract boolean getUseSendfile();

	public abstract boolean getUseComet();

	public abstract boolean getUseCometTimeout();

	public abstract boolean getUsePolling();

	protected LimitLatch initializeConnectionLatch() {
		if (maxConnections == -1)
			return null;
		if (connectionLimitLatch == null) {
			connectionLimitLatch = new LimitLatch(getMaxConnections());
		}
		return connectionLimitLatch;
	}

	protected void releaseConnectionLatch() {
		LimitLatch latch = connectionLimitLatch;
		if (latch != null)
			latch.releaseAll();
		connectionLimitLatch = null;
	}

	protected void countUpOrAwaitConnection() throws InterruptedException {
		if (maxConnections == -1)
			return;
		LimitLatch latch = connectionLimitLatch;
		if (latch != null)
			latch.countUpOrAwait();
	}

	protected long countDownConnection() {
		if (maxConnections == -1)
			return -1;
		LimitLatch latch = connectionLimitLatch;
		if (latch != null) {
			long result = latch.countDown();
			if (result < 0) {
				getLog().warn(
						"Incorrect connection count, multiple socket.close called on the same socket.");
			}
			return result;
		} else
			return -1;
	}

	/**
	 * Provides a common approach for sub-classes to handle exceptions where a
	 * delay is required to prevent a Thread from entering a tight loop which
	 * will consume CPU and may also trigger large amounts of logging. For
	 * example, this can happen with the Acceptor thread if the ulimit for open
	 * files is reached.
	 * 
	 * @param currentErrorDelay
	 *            The current delay being applied on failure
	 * @return The delay to apply on the next failure
	 */
	protected int handleExceptionWithDelay(int currentErrorDelay) {
		// Don't delay on first exception
		if (currentErrorDelay > 0) {
			try {
				Thread.sleep(currentErrorDelay);
			} catch (InterruptedException e) {
				// Ignore
			}
		}

		// On subsequent exceptions, start the delay at 50ms, doubling the delay
		// on every subsequent exception until the delay reaches 1.6 seconds.
		if (currentErrorDelay == 0) {
			return INITIAL_ERROR_DELAY;
		} else if (currentErrorDelay < MAX_ERROR_DELAY) {
			return currentErrorDelay * 2;
		} else {
			return MAX_ERROR_DELAY;
		}

	}

	// -------------------- SSL related properties --------------------

	private String algorithm = KeyManagerFactory.getDefaultAlgorithm();

	public String getAlgorithm() {
		return algorithm;
	}

	public void setAlgorithm(String s) {
		this.algorithm = s;
	}

	private String clientAuth = "false";

	public String getClientAuth() {
		return clientAuth;
	}

	public void setClientAuth(String s) {
		this.clientAuth = s;
	}

	private String keystoreFile = System.getProperty("user.home")
			+ "/.keystore";

	public String getKeystoreFile() {
		return keystoreFile;
	}

	public void setKeystoreFile(String s) {
		keystoreFile = adjustRelativePath(s,
				System.getProperty(Constants.CATALINA_BASE_PROP));
	}

	private String keystorePass = null;

	public String getKeystorePass() {
		return keystorePass;
	}

	public void setKeystorePass(String s) {
		this.keystorePass = s;
	}

	private String keystoreType = "JKS";

	public String getKeystoreType() {
		return keystoreType;
	}

	public void setKeystoreType(String s) {
		this.keystoreType = s;
	}

	private String keystoreProvider = null;

	public String getKeystoreProvider() {
		return keystoreProvider;
	}

	public void setKeystoreProvider(String s) {
		this.keystoreProvider = s;
	}

	private String sslProtocol = "TLS";

	public String getSslProtocol() {
		return sslProtocol;
	}

	public void setSslProtocol(String s) {
		sslProtocol = s;
	}

	private String ciphers = null;

	public String getCiphers() {
		return ciphers;
	}

	public void setCiphers(String s) {
		ciphers = s;
	}

	private String keyAlias = null;

	public String getKeyAlias() {
		return keyAlias;
	}

	public void setKeyAlias(String s) {
		keyAlias = s;
	}

	private String keyPass = null;

	public String getKeyPass() {
		return keyPass;
	}

	public void setKeyPass(String s) {
		this.keyPass = s;
	}

	private String truststoreFile = System
			.getProperty("javax.net.ssl.trustStore");

	public String getTruststoreFile() {
		return truststoreFile;
	}

	public void setTruststoreFile(String s) {
		truststoreFile = adjustRelativePath(s,
				System.getProperty(Constants.CATALINA_BASE_PROP));
	}

	private String truststorePass = System
			.getProperty("javax.net.ssl.trustStorePassword");

	public String getTruststorePass() {
		return truststorePass;
	}

	public void setTruststorePass(String truststorePass) {
		this.truststorePass = truststorePass;
	}

	private String truststoreType = System
			.getProperty("javax.net.ssl.trustStoreType");

	public String getTruststoreType() {
		return truststoreType;
	}

	public void setTruststoreType(String truststoreType) {
		this.truststoreType = truststoreType;
	}

	private String truststoreProvider = null;

	public String getTruststoreProvider() {
		return truststoreProvider;
	}

	public void setTruststoreProvider(String truststoreProvider) {
		this.truststoreProvider = truststoreProvider;
	}

	private String truststoreAlgorithm = null;

	public String getTruststoreAlgorithm() {
		return truststoreAlgorithm;
	}

	public void setTruststoreAlgorithm(String truststoreAlgorithm) {
		this.truststoreAlgorithm = truststoreAlgorithm;
	}

	private String trustManagerClassName = null;

	public String getTrustManagerClassName() {
		return trustManagerClassName;
	}

	public void setTrustManagerClassName(String trustManagerClassName) {
		this.trustManagerClassName = trustManagerClassName;
	}

	private String crlFile = null;

	public String getCrlFile() {
		return crlFile;
	}

	public void setCrlFile(String crlFile) {
		this.crlFile = crlFile;
	}

	private String trustMaxCertLength = null;

	public String getTrustMaxCertLength() {
		return trustMaxCertLength;
	}

	public void setTrustMaxCertLength(String trustMaxCertLength) {
		this.trustMaxCertLength = trustMaxCertLength;
	}

	private String sessionCacheSize = null;

	public String getSessionCacheSize() {
		return sessionCacheSize;
	}

	public void setSessionCacheSize(String s) {
		sessionCacheSize = s;
	}

	private String sessionTimeout = "86400";

	public String getSessionTimeout() {
		return sessionTimeout;
	}

	public void setSessionTimeout(String s) {
		sessionTimeout = s;
	}

	private String allowUnsafeLegacyRenegotiation = null;

	public String getAllowUnsafeLegacyRenegotiation() {
		return allowUnsafeLegacyRenegotiation;
	}

	public void setAllowUnsafeLegacyRenegotiation(String s) {
		allowUnsafeLegacyRenegotiation = s;
	}

	private String[] sslEnabledProtocolsarr = new String[0];

	public String[] getSslEnabledProtocolsArray() {
		return this.sslEnabledProtocolsarr;
	}

	public void setSslEnabledProtocols(String s) {
		if (s == null) {
			this.sslEnabledProtocolsarr = new String[0];
		} else {
			ArrayList<String> sslEnabledProtocols = new ArrayList<String>();
			StringTokenizer t = new StringTokenizer(s, ",");
			while (t.hasMoreTokens()) {
				String p = t.nextToken().trim();
				if (p.length() > 0) {
					sslEnabledProtocols.add(p);
				}
			}
			sslEnabledProtocolsarr = sslEnabledProtocols
					.toArray(new String[sslEnabledProtocols.size()]);
		}
	}


精尽 Dubbo 源码分析 —— NIO 服务器(二)之 Transport 层 1.概述 dubbo-remoting-api 模块, transport 包,网络传输层。 涉及的类图如下: 2.AbstractPeer 实现 Endpoint、ChannelHandler 接口,Peer 抽象类。 /** * AbstractPeer * * Peer 抽象类 */ public abstract class AbstractPeer implements End... 阅读详情

相关推荐

OAI数据集申请与实战:从权限获取到医学影像分析应用

本文详细介绍了OAI数据集的申请流程与医学影像分析实战应用。从NDA账户注册、数据下载技巧到骨盆X光关键点检测的完整实现,帮助医学研究者高效利用这一权威骨关节炎数据集。特别分享使用Pei Y标注数据训练U-Net模型的经验,包括预处理、注意力机制优化等实用技巧。

weixin_30275415的博客 489

Spring Boot之执行器端点(Actuator Endpoint)实现剖析

整体实现思路是将端点(Endpoint)适配委托给MVC层策略端点(MvcEndpoint),再通过端点MVC适配器(EndpointMvcAdapter)将端点暴露为HTTP请求方式的MVC端点,最后分别使用端点自动配置(EndpointAutoConfiguration)和MVC方式暴露端点的配置(EndpointWebMvcManagementContextConfiguration)来注入...

weixin_33828101的博客 588

ADS(Arm Developer Suite)安装的坑!

实验课老师让我们区安装ADS,作为嵌入式开发的工具,原本以为这只是一个简单的软件,但是当我安装的时候,我才发现这软件太难了!安装了我大半天,看了其他的博客之后,最终才安装成功???????? 安装过程的一个巨坑就是:安装路径!以及安装许可注册文件 如果没有注意路径,最后安装成功以后打开软件就是蜜汁报错???? 报错了怎么办?删掉已安装的东西,重新安装吧,而且要删干净 再次安装的时候,打开安装包是这个提示...

weixin_42795819的博客 8224

IO出入口AbstractEndPoint源码分析

AbstractEndpoint这个类的目的就是作为处理Socket套接字IO的基础,从命名上来看其要意是处理TCP连接的两端的数据,这也是两台机器之间通信的端点。 AbstractEndpoint针对不同的IO模型有不同的实现: AbstractEndpoint源码 public abstract class AbstractEndpoint<S> { // ----------------------------------------------------------

yangzsirr的博客 692

scanpy单细胞转录组python教程(四):单样本数据分析之降维聚类及细胞注释

本文介绍了使用scanpy进行单细胞转录组分析的降维聚类和细胞注释流程。首先通过PCA降维并可视化主成分贡献,然后使用不同分辨率参数(0.2-1.0)进行Leiden聚类。通过Wilcoxon检验鉴定marker基因,并基于经典marker基因手动注释细胞类型。最后对低质量细胞群进行过滤,并重新计算邻居图和UMAP可视化。流程中包含PCA方差分析、多分辨率聚类比较、marker基因筛选和基于UMAP的细胞类型可视化等关键步骤,为后续分析奠定基础。

qq_42090739的博客 954

Revit+Deepseek AI插件保姆级安装教程:从零配置到一键生成模型

本文提供Revit集成Deepseek AI插件的完整安装与配置教程。从环境准备、插件获取安装,到Deepseek API密钥配置及界面集成,手把手指导用户实现从自然语言指令到三维模型的智能生成,旨在为建筑设计师带来革命性的高效工作流。

weixin_29050513的博客 1066

浅析Tomcat之AbstractEndpoint

Tomcat中的Connector将具体的协议处理托管给了不同的ProtocolHandler实现类.这些实现类都内置这一个很重要的对象,AbstractEndpoint这是一个抽象类,不同的协议需要提供不同的Endpoint.这个类的作用就是提供底层的网络I/O的处理.不同的ProtocolHandler所内置的Endpoint是不同的.但是AbstractEndpoint为这些类抽象出了一...

泛泛之辈 881

2024年下半年网络规划设计师论文真题

3、深入论述自身参与的工业网络是如何实施的,为实现制造业的智能化,如何实现数据的跨系统互通,促进各种工业数据的充分流动和无缝集成以及数据安全。3、结合自身参与的网络建设,详细叙述针对该网络“去NAT”的规划和设计方案。4、在实施过程中遇到的问题以及如何处理,项目实施后的效果和评价。2、大型园区网络“去NAT”改造和业务融合的整体架构。1、“网络去NAT”对推进ipv6演进和应用的意义。4、改造过程中遇到的问题及解决方案。2、简要叙述自身参与的制造网络建设。1、网络规划在智能制造中的意义。

鹿鸣天涯 2394

Spring Boot之执行器端点Actuator-Endpoint实现剖析

本文从Spring Boot源码层面剖析执行器端点的实现原理。整体实现思路是将端点(Endpoint)适配委托给MVC层策略端点(MvcEndpoint),再通过端点MVC适配器(EndpointMvcAdapter)将端点暴露为HTTP请求方式的MVC端点,最后分别使用端点自动配置(EndpointAutoConfiguration)和MVC方式暴露端点的配置(EndpointWebMvcManagementContextConfiguration)来注入端点组件和端点处理程序映射组件、MVC端点注册表组

简放视野的专栏 1万+

芒果YOLOv11改进175:DCNv4卷积,全网首发纯Pytorch实现代码,无需cuda编译|即插即用,一键运行:高效可变形卷积网络:重新思考视觉应用的动态和稀疏算子

芒果YOLOv11改进:DCNv4卷积,全网首发纯Pytorch实现代码,无需cuda编译|即插即用,一键运行:高效可变形卷积网络:重新思考视觉应用的动态和稀疏算子

包括YOLOv5、YOLOv7、YOLOv8等模型改进 1313

【报错】(pycharm运行程序)OSError: [WinError 1114] 动态链接库(DLL)初始化例程失败。 Error loading

1 报错 OSError: [WinError 1114] 动态链接库(DLL)初始化例程失败。 Error loading 2 分析原因 通过 activate Distance 进行自己创建的 Distance 虚拟环境中,输入python会显示环境中python的版本信息,再依次import,显然不会报错。 这是因为在Anaconda的环境下有支持 import torch 的 dll,而在PyCharm中使用的是自己创建的新环境,还缺少相应支持的dll,仅需在PyCharm中配置环境变量。.

静谧、淡雅 8634

【043】Dubbo3从0到1系列之AbstractEndpoint、Server继承分析

AbstractEndpoint是Dubbo通信层的核心抽象类,继承AbstractPeer并实现Resetable接口,提供端点通用功能。主要特性包括:1) 通过SPI机制管理编解码器(Codec2),支持新旧版本兼容;2) 动态重置配置参数,支持运行时调整连接超时等设置;3) 提供容错机制和日志记录。其子类AbstractServer实现服务端逻辑,管理线程池、连接控制等,通过模板方法(doOpen/doClose)支持不同网络库实现,是Dubbo服务暴露的基础组件。

编程技术圈 950

Oracle EBS 寄销/VMI(1)-->基础设置

名词解释:     BPA:一揽子采购协议     BPR:一揽子发放     SR:来源补充规则     ASL:合格供应商列表     VMI: 供应商管理库存     寄售(Consignment)是把货物放在客户那里,客户要用的时候才付款的库存,一般是指卖方把

陈显平的专栏-Oracle EBS 1万+

06 Tomcat 启动流程详解 Tomcat的Lifecycle生命周期接口 Tomcat 各组件的默认实现类 Server、Service、Container、Executor、Connector

Tomcat 启动流程详解 Tomcat的Lifecycle生命周期接口 Tomcat 各组件的默认实现类 Server、Service、Container、Executor、Connector

思念十年后 615

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Spring Boot 揭秘与实战(九) 应用监控篇 - 自定义监控端点

Spring Boot 提供的端点不能满足我们的业务需求时,我们可以自定义一个端点。 博客地址:blog.720ui.com/ 本文,我将演示一个简单的自定义端点,用来查看服务器的当前时间,它将返回两个参数,一个是标准的包含时区的当前时间格式,一个是当前时间的时间戳格式。 继承 AbstractEndpoint 抽象类 首先,我们需要继承 AbstractEndpoint 抽象类。因为它是 E...

weixin_34146410的博客 166

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Tomcat是如何将请求一步步传递到我们编写的HttpServlet类中的

  我们平常编写好的HttpServlet类后,就可以处理请求了,但是服务器在接收到请求信息以后是如何将这些请求传递到我们编写的Servlet类中的???这个疑问在我心中的已经很久了,现在要来解决它。   我们之前的一篇文章Tomcat中容器是什么以及容器与容器之间的数量关系。简单介绍Tomcat服务器的容器,以及容器与容器之间的关系。现在来讲一下在服务器端口接收到请求后,这些请求是如...

dieyuanjiao9299的博客 475

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

Dubbo-Endpoint

Endpoint接口 Dubbo 抽象出一个 端 的概念,也就是Endpoint接口 端 就是 一个点,点对点之间是可以双向传输 在端的基础上 再衍生出 通道-Channel、客户端-Client以及服务端-Server的概念 在传输层-Transport,Client和Server只是在语义上区别,并不区分 请求 和 应答 职责 在交换层-Exchange,Client和Server也是一个点,但是已经是 有方向的点,区分了明确的请求和应答职责。两者都具备 发送的能力,只是Client和Server所关

星光之子的博客 698

Spring Boot 中的端点是什么,如何使用

Spring Boot 端点是 Spring Boot 框架中的一个重要概念,它提供了许多有用的功能,如健康检查、配置信息、日志信息等。Spring Boot 端点分为内置端点和自定义端点两种类型,开发人员可以根据需要编写自定义端点。Spring Boot 端点的使用非常简单,只需要通过 HTTP GET 请求来访问即可。如果需要修改端点的访问路径和访问权限,可以使用相应的注解进行配置。

徐师兄的博客 2518

Springboot Actuator之七:actuator 中原生endpoint源码解析1

看actuator项目的包结构,如下: 本文中的介绍Endpoints。 Endpoints(端点)介绍 Endpoints 是 Actuator 的核心部分,它用来监视应用程序及交互,spring-boot-actuator中已经内置了非常多的Endpoints(health、info、beans、httptrace、shutdown等等),同时也允许我们扩展自己的端点。 Endpo...

weixin_30823683的博客 442

Tomcat源码分析(4)--StandardService类中涉及到的初始化和启动

Tomcat源码分析

半纸药笺 748

Tomcat链接器Connector的设计概述

Tomcat链接器Connector的实现概述,以及Connector与Mapper、Container的解耦方式。

博风_刺耳的博客(网络记事本) 427

Tomcat简单分析-Connector

1、Connector分析    Conector用于接受请求并将请求封装成Request和Response,最底层采用Sockert来进行连接的,Request和Response是按照HTTP协议进行封装的。所以Conncetor同时实现了 TCP/IP和HTTP协议,Request封装完了交给Container处理,处理完了返回个Connector,最后Connector处理后封装Respon...

Visonws的博客 638

Tomcat源码解析如何支持NIO

Tomcat支持NIO 我们前面介绍过了JDK里的NIO,那在实际生产环节又是如何使用的呢? 目前公司实际业务使用的是Tomcat8,我们以Tomcat8为例简单介绍下。 在Tomcat官网Advanced IO章节有介绍,based on NIO/NIO2,内容相当少。 基于官方文档,我们尝试在tomcat源码中寻找NIO/NIO2相关的类信息: 经过一番搜寻可以很明显的看到NIO相关的信息。channel,selector,pool经验告诉我们这些都不可能是业务处理的核心逻辑,剩下的就只有这个end

Ralap的博客 373

死磕Tomcat系列(2)——EndPoint源码解析

死磕Tomcat系列(2)——EndPoint源码解析 前言 上一节中我们描述了Tomcat的整体架构,我们知道Tomcat分为两大组件,一个连接器和一个容器。而我们这次要讲的 Endpoint的组件就是属于连接器里面的。它是一个通信的端点,就是负责对外实现TCP/IP协议。Endpoint是个接口,它的具体实现类就是AbstractEndpoint,而AbstractEndpoint具体的实现就...

qq_43419105的博客 454

SpringBoot+Actuator打造强大的监控和管理系统

0.前言背景:一直零散的使用着Spring Boot 的各种组件和特性,从未系统性的学习和总结,本次借着这个机会搞一波。共同学习,一起进步。哈哈Spring Boot Actuator 是一个强大的监控和管理框架,它提供了一系列的监控端点,可以用于获取应用程序的状态、度量指标、健康检查、配置信息等。Actuator 的监控端点可以通过 HTTP 请求访问,并返回有关应用程序运行时信息的响应。使用 ...

程序员闪充宝 3211
上一篇: AbstractHttp11Protocol泛型抽象类
下一篇: AbstractHttp11JsseProtocol泛型抽象类
sjcawn
博客等级 码龄16年 3粉丝 39原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值