You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2018/01/01 19:23:08 UTC
juneau git commit: RestCall should extend BeanSession.
Repository: juneau
Updated Branches:
refs/heads/master 3bf325a65 -> 2da728a51
RestCall should extend BeanSession.
Project: http://git-wip-us.apache.org/repos/asf/juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/juneau/commit/2da728a5
Tree: http://git-wip-us.apache.org/repos/asf/juneau/tree/2da728a5
Diff: http://git-wip-us.apache.org/repos/asf/juneau/diff/2da728a5
Branch: refs/heads/master
Commit: 2da728a516b256061f9718d44a5b5406454352ae
Parents: 3bf325a
Author: JamesBognar <ja...@apache.org>
Authored: Mon Jan 1 14:23:05 2018 -0500
Committer: JamesBognar <ja...@apache.org>
Committed: Mon Jan 1 14:23:05 2018 -0500
----------------------------------------------------------------------
.../main/java/org/apache/juneau/BeanSessionArgs.java | 5 +++++
.../java/org/apache/juneau/rest/client/RestCall.java | 12 ++----------
2 files changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/juneau/blob/2da728a5/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSessionArgs.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSessionArgs.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSessionArgs.java
index 828846a..4a69e82 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSessionArgs.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanSessionArgs.java
@@ -21,6 +21,11 @@ import org.apache.juneau.http.*;
*/
public class BeanSessionArgs extends SessionArgs {
+ /**
+ * Default empty session arguments.
+ */
+ public static final BeanSessionArgs DEFAULT = new BeanSessionArgs(ObjectMap.EMPTY_MAP, null, null, null);
+
final Locale locale;
final TimeZone timeZone;
final MediaType mediaType;
http://git-wip-us.apache.org/repos/asf/juneau/blob/2da728a5/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
index e78655d..a24fee5 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
@@ -69,7 +69,7 @@ import org.apache.juneau.utils.*;
* </ul>
*/
@SuppressWarnings({ "unchecked" })
-public final class RestCall extends Session {
+public final class RestCall extends BeanSession {
private final RestClient client; // The client that created this call.
private final HttpRequestBase request; // The request.
@@ -106,7 +106,7 @@ public final class RestCall extends Session {
* @throws RestCallException If an exception or non-200 response code occurred during the connection attempt.
*/
protected RestCall(RestClient client, HttpRequestBase request, URI uri) throws RestCallException {
- super(SessionArgs.DEFAULT);
+ super(client, BeanSessionArgs.DEFAULT);
this.client = client;
this.request = request;
for (RestCallInterceptor i : this.client.interceptors)
@@ -2083,12 +2083,4 @@ public final class RestCall extends Session {
header("Debug", true);
return this;
}
-
- private boolean isBean(Object o) throws RestCallException {
- return getBeanContext().isBean(o);
- }
-
- private BeanMap<?> toBeanMap(Object o) throws RestCallException {
- return getBeanContext().createSession().toBeanMap(o);
- }
}