remm 2005/05/18 02:02:32
Modified: util/java/org/apache/tomcat/util/net AprEndpoint.java
Log:
- Remove a useless synchronized, and add some javadoc.
Revision Changes Path
1.28 +31 -4
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java
Index: AprEndpoint.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- AprEndpoint.java 17 May 2005 12:20:20 -0000 1.27
+++ AprEndpoint.java 18 May 2005 09:02:32 -0000 1.28
@@ -43,7 +43,10 @@
* <li>Sendfile thread</li>
* <li>Worker threads pool</li>
* </ul>
- *
+ *
+ * When switching to Java 5, there's an opportunity to use the virtual
+ * machine's thread pool.
+ *
* @author Mladen Turk
* @author Remy Maucherat
*/
@@ -372,7 +375,8 @@
/**
* Initialize the endpoint.
*/
- public void init() throws Exception {
+ public void init()
+ throws Exception {
if (initialized)
return;
@@ -409,7 +413,11 @@
}
- public void start() throws Exception {
+ /**
+ * Start the APR endpoint, creating acceptor, poller and sendfile
threads.
+ */
+ public void start()
+ throws Exception {
// Initialize socket if not done before
if (!initialized) {
init();
@@ -443,6 +451,9 @@
}
+ /**
+ * Pause the endpoint, which will make it stop accepting new sockets.
+ */
public void pause() {
if (running && !paused) {
paused = true;
@@ -450,12 +461,21 @@
}
}
+
+ /**
+ * Resume the endpoint, which will make it start accepting new sockets
+ * again.
+ */
public void resume() {
if (running) {
paused = false;
}
}
+
+ /**
+ * Stop the endpoint. This will cause all processing threads to stop.
+ */
public void stop() {
if (running) {
running = false;
@@ -468,6 +488,10 @@
}
}
+
+ /**
+ * Deallocate APR memory pools, and close server socket.
+ */
public void destroy() throws Exception {
if (running) {
stop();
@@ -540,6 +564,9 @@
}
+ /**
+ * Process the specified connection.
+ */
protected boolean processSocket(long socket, long pool) {
// Process the connection
int step = 1;
@@ -731,7 +758,7 @@
* Create the poller. With some versions of APR, the maximum poller
size will
* be 62 (reocmpiling APR is necessary to remove this limitation).
*/
- protected synchronized void init() {
+ protected void init() {
pool = Pool.create(serverSockPool);
try {
serverPollset = Poll.create(pollerSize, pool, 0, soTimeout *
1000);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]