public
Created

Patch for JERSEY-1641 (Upgrade to Simple 5.0.4 in Jersey 1.x)

  • Download Gist
simple-5.0.4.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
Index: contribs/jersey-simple-server/src/main/java/com/sun/jersey/simple/impl/container/SimpleContainer.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- contribs/jersey-simple-server/src/main/java/com/sun/jersey/simple/impl/container/SimpleContainer.java (revision 5823)
+++ contribs/jersey-simple-server/src/main/java/com/sun/jersey/simple/impl/container/SimpleContainer.java (revision )
@@ -65,7 +65,7 @@
* This is the container that handles all HTTP requests. Requests are adapted
* for the enclosed {@link WebApplication} instances. This container can
* service both HTTP and HTTPS traffic transparently, when created using the
- * factory methods of {@link com.sun.jersey.api.simple.container.SimpleServerFactory}
+ * factory methods of {@link com.sun.jersey.simple.container.SimpleServerFactory}
* or when instantiating it and making a direct connection to the container.
*
* @author Marc.Hadley@Sun.Com
@@ -93,14 +93,14 @@
String method = request.getMethod();
response.setCode(code);
- response.setText(text);
+ response.setDescription(text);
if (!method.equalsIgnoreCase("HEAD") && contentLength != -1 && contentLength < Integer.MAX_VALUE) {
response.setContentLength((int)contentLength);
}
for (Map.Entry<String, List<Object>> e : cResponse.getHttpHeaders().entrySet()) {
for (Object value : e.getValue()) {
- response.add(e.getKey(), ContainerResponse.getHeaderValue(value));
+ response.setValue(e.getKey(), ContainerResponse.getHeaderValue(value));
}
}
return response.getOutputStream();
Index: contribs/jersey-simple-server/src/main/java/com/sun/jersey/simple/container/SimpleServerFactory.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- contribs/jersey-simple-server/src/main/java/com/sun/jersey/simple/container/SimpleServerFactory.java (revision 5823)
+++ contribs/jersey-simple-server/src/main/java/com/sun/jersey/simple/container/SimpleServerFactory.java (revision )
@@ -48,6 +48,8 @@
import javax.net.ssl.SSLContext;
import org.simpleframework.http.core.Container;
+import org.simpleframework.http.core.ContainerServer;
+import org.simpleframework.transport.Server;
import org.simpleframework.transport.connect.Connection;
import org.simpleframework.transport.connect.SocketConnection;
@@ -493,7 +495,8 @@
port = defaultPort;
}
SocketAddress listen = new InetSocketAddress(port);
- Connection connection = new SocketConnection(container);
+ Server server = new ContainerServer(container);
+ Connection connection = new SocketConnection(server);
connection.connect(listen, context);
Index: contribs/jersey-simple-server/pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- contribs/jersey-simple-server/pom.xml (revision 5823)
+++ contribs/jersey-simple-server/pom.xml (revision )
@@ -55,7 +55,7 @@
<dependency>
<groupId>org.simpleframework</groupId>
<artifactId>simple</artifactId>
- <version>4.1.20</version>
+ <version>5.0.4</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
Index: contribs/jersey-simple-server/src/test/java/com/sun/jersey/server/simple/impl/container/AbstractSimpleServerTester.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- contribs/jersey-simple-server/src/test/java/com/sun/jersey/server/simple/impl/container/AbstractSimpleServerTester.java (revision 5823)
+++ contribs/jersey-simple-server/src/test/java/com/sun/jersey/server/simple/impl/container/AbstractSimpleServerTester.java (revision )
@@ -48,6 +48,8 @@
import junit.framework.TestCase;
import org.simpleframework.http.core.Container;
+import org.simpleframework.http.core.ContainerServer;
+import org.simpleframework.transport.Server;
import org.simpleframework.transport.connect.Connection;
import org.simpleframework.transport.connect.SocketConnection;
@@ -103,7 +105,8 @@
}
try {
SocketAddress listen = new InetSocketAddress(port);
- connection = new SocketConnection(container);
+ Server server = new ContainerServer(container);
+ connection = new SocketConnection(server);
connection.connect(listen);
} catch (Exception e) {
throw new RuntimeException(e);
\ No newline at end of file

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.