You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2014/05/30 10:41:25 UTC
svn commit: r1598495 - in /httpcomponents/httpcore/trunk:
httpcore-nio/src/examples/org/apache/http/examples/nio/
httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/
httpcore/src/examples/org/apache/http/examples/
httpcore/src/main/java/org/...
Author: olegk
Date: Fri May 30 08:41:24 2014
New Revision: 1598495
URL: http://svn.apache.org/r1598495
Log:
Renamed classes
Added:
httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java (contents, props changed)
- copied, changed from r1598494, httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java
httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/HttpServer.java (contents, props changed)
- copied, changed from r1598494, httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/Server.java
httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/HttpFileServer.java (contents, props changed)
- copied, changed from r1598494, httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java
httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/HttpServer.java (contents, props changed)
- copied, changed from r1598494, httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/Server.java
Removed:
httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java
httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/Server.java
httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java
httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/Server.java
Modified:
httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/ServerBootstrap.java
httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/ServerBootstrap.java
httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java
Copied: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java (from r1598494, httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java?p2=httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java&p1=httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java&r1=1598494&r2=1598495&rev=1598495&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java Fri May 30 08:41:24 2014
@@ -46,7 +46,7 @@ import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.MethodNotSupportedException;
import org.apache.http.entity.ContentType;
-import org.apache.http.impl.nio.bootstrap.Server;
+import org.apache.http.impl.nio.bootstrap.HttpServer;
import org.apache.http.impl.nio.bootstrap.ServerBootstrap;
import org.apache.http.impl.nio.reactor.IOReactorConfig;
import org.apache.http.nio.entity.NFileEntity;
@@ -63,7 +63,7 @@ import org.apache.http.protocol.HttpCore
* Embedded HTTP/1.1 file server based on a non-blocking I/O model and capable of direct channel
* (zero copy) data transfer.
*/
-public class NHttpServer {
+public class NHttpFileServer {
public static void main(String[] args) throws Exception {
if (args.length < 1) {
@@ -80,7 +80,7 @@ public class NHttpServer {
SSLContext sslcontext = null;
if (port == 8443) {
// Initialize SSL context
- ClassLoader cl = NHttpServer.class.getClassLoader();
+ ClassLoader cl = NHttpFileServer.class.getClassLoader();
URL url = cl.getResource("my.keystore");
if (url == null) {
System.out.println("Keystore not found");
@@ -101,7 +101,7 @@ public class NHttpServer {
.setTcpNoDelay(true)
.build();
- final Server server = ServerBootstrap.bootstrap()
+ final HttpServer server = ServerBootstrap.bootstrap()
.setListenerPort(port)
.setServerInfo("Test/1.1")
.setIOReactorConfig(config)
Propchange: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Copied: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/HttpServer.java (from r1598494, httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/Server.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/HttpServer.java?p2=httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/HttpServer.java&p1=httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/Server.java&r1=1598494&r2=1598495&rev=1598495&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/Server.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/HttpServer.java Fri May 30 08:41:24 2014
@@ -49,7 +49,7 @@ import org.apache.http.nio.reactor.Liste
/**
* @since 4.4
*/
-public class Server {
+public class HttpServer {
enum Status { READY, ACTIVE, STOPPING }
@@ -66,7 +66,7 @@ public class Server {
private volatile ListenerEndpoint endpoint;
- Server(
+ HttpServer(
final int port,
final InetAddress ifAddress,
final IOReactorConfig ioReactorConfig,
Propchange: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/HttpServer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/HttpServer.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/HttpServer.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/ServerBootstrap.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/ServerBootstrap.java?rev=1598495&r1=1598494&r2=1598495&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/ServerBootstrap.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/ServerBootstrap.java Fri May 30 08:41:24 2014
@@ -305,7 +305,7 @@ public class ServerBootstrap {
return this;
}
- public Server create() {
+ public HttpServer create() {
HttpProcessor httpProcessorCopy = this.httpProcessor;
if (httpProcessorCopy == null) {
@@ -385,7 +385,7 @@ public class ServerBootstrap {
httpProcessorCopy, connStrategyCopy, responseFactoryCopy, handlerMapperCopy,
this.expectationVerifier, exceptionLoggerCopy);
- return new Server(this.listenerPort, this.localAddress, this.ioReactorConfig,
+ return new HttpServer(this.listenerPort, this.localAddress, this.ioReactorConfig,
httpService, connectionFactoryCopy, exceptionLoggerCopy);
}
Copied: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/HttpFileServer.java (from r1598494, httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/HttpFileServer.java?p2=httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/HttpFileServer.java&p1=httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java&r1=1598494&r2=1598495&rev=1598495&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/HttpFileServer.java Fri May 30 08:41:24 2014
@@ -55,7 +55,7 @@ import org.apache.http.config.SocketConf
import org.apache.http.entity.ContentType;
import org.apache.http.entity.FileEntity;
import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.bootstrap.Server;
+import org.apache.http.impl.bootstrap.HttpServer;
import org.apache.http.impl.bootstrap.ServerBootstrap;
import org.apache.http.protocol.HttpContext;
import org.apache.http.protocol.HttpCoreContext;
@@ -65,7 +65,7 @@ import org.apache.http.util.EntityUtils;
/**
* Embedded HTTP/1.1 file server based on a classic (blocking) I/O model.
*/
-public class ElementalHttpServer {
+public class HttpFileServer {
public static void main(String[] args) throws Exception {
if (args.length < 1) {
@@ -82,7 +82,7 @@ public class ElementalHttpServer {
SSLContext sslcontext = null;
if (port == 8443) {
// Initialize SSL context
- ClassLoader cl = ElementalHttpServer.class.getClassLoader();
+ ClassLoader cl = HttpFileServer.class.getClassLoader();
URL url = cl.getResource("my.keystore");
if (url == null) {
System.out.println("Keystore not found");
@@ -103,7 +103,7 @@ public class ElementalHttpServer {
.setTcpNoDelay(true)
.build();
- final Server server = ServerBootstrap.bootstrap()
+ final HttpServer server = ServerBootstrap.bootstrap()
.setListenerPort(port)
.setServerInfo("Test/1.1")
.setSocketConfig(socketConfig)
Propchange: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/HttpFileServer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/HttpFileServer.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/HttpFileServer.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Copied: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/HttpServer.java (from r1598494, httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/Server.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/HttpServer.java?p2=httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/HttpServer.java&p1=httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/Server.java&r1=1598494&r2=1598495&rev=1598495&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/Server.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/HttpServer.java Fri May 30 08:41:24 2014
@@ -47,7 +47,7 @@ import org.apache.http.protocol.HttpServ
/**
* @since 4.4
*/
-public class Server {
+public class HttpServer {
enum Status { READY, ACTIVE, STOPPING }
@@ -66,7 +66,7 @@ public class Server {
private volatile ServerSocket serverSocket;
private volatile RequestListener requestListener;
- Server(
+ HttpServer(
final int port,
final InetAddress ifAddress,
final SocketConfig socketConfig,
Propchange: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/HttpServer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/HttpServer.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/HttpServer.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/ServerBootstrap.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/ServerBootstrap.java?rev=1598495&r1=1598494&r2=1598495&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/ServerBootstrap.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/bootstrap/ServerBootstrap.java Fri May 30 08:41:24 2014
@@ -289,7 +289,7 @@ public class ServerBootstrap {
return this;
}
- public Server create() {
+ public HttpServer create() {
HttpProcessor httpProcessorCopy = this.httpProcessor;
if (httpProcessorCopy == null) {
@@ -375,7 +375,7 @@ public class ServerBootstrap {
exceptionLoggerCopy = ExceptionLogger.NO_OP;
}
- return new Server(
+ return new HttpServer(
this.listenerPort > 0 ? this.listenerPort : 0,
this.localAddress,
this.socketConfig != null ? this.socketConfig : SocketConfig.DEFAULT,
Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java?rev=1598495&r1=1598494&r2=1598495&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java Fri May 30 08:41:24 2014
@@ -39,7 +39,6 @@ import org.apache.http.ConnectionClosedE
import org.apache.http.ExceptionLogger;
import org.apache.http.HttpConnectionFactory;
import org.apache.http.config.SocketConfig;
-import org.apache.http.impl.bootstrap.Server;
import org.apache.http.impl.bootstrap.ServerBootstrap;
import org.apache.http.protocol.HttpExpectationVerifier;
import org.apache.http.protocol.HttpRequestHandler;
@@ -52,7 +51,7 @@ public class HttpServer {
private volatile HttpExpectationVerifier expectationVerifier;
private volatile int timeout;
- private volatile Server server;
+ private volatile org.apache.http.impl.bootstrap.HttpServer server;
public HttpServer() throws IOException {
super();
@@ -78,7 +77,7 @@ public class HttpServer {
}
public int getPort() {
- final Server local = this.server;
+ final org.apache.http.impl.bootstrap.HttpServer local = this.server;
if (local != null) {
return this.server.getLocalPort();
} else {
@@ -87,7 +86,7 @@ public class HttpServer {
}
public InetAddress getInetAddress() {
- final Server local = this.server;
+ final org.apache.http.impl.bootstrap.HttpServer local = this.server;
if (local != null) {
return local.getInetAddress();
} else {
@@ -111,7 +110,7 @@ public class HttpServer {
}
public void shutdown() {
- final Server local = this.server;
+ final org.apache.http.impl.bootstrap.HttpServer local = this.server;
this.server = null;
if (local != null) {
local.shutdown(5, TimeUnit.SECONDS);