This is an automated email from the ASF dual-hosted git repository. jamesbognar pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push: new fb88991 REST refactoring. fb88991 is described below commit fb889914d1cfa2c027abc5549e6630c76f5524ef Author: JamesBognar <james.bog...@salesforce.com> AuthorDate: Mon Jan 11 11:51:16 2021 -0500 REST refactoring. --- .../apache/juneau/microservice/resources/ConfigResource.java | 12 ++++++------ .../src/main/java/org/apache/juneau/rest/RestServlet.java | 5 ----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/juneau-microservice/juneau-microservice-core/src/main/java/org/apache/juneau/microservice/resources/ConfigResource.java b/juneau-microservice/juneau-microservice-core/src/main/java/org/apache/juneau/microservice/resources/ConfigResource.java index 75f39b4..962a51b 100755 --- a/juneau-microservice/juneau-microservice-core/src/main/java/org/apache/juneau/microservice/resources/ConfigResource.java +++ b/juneau-microservice/juneau-microservice-core/src/main/java/org/apache/juneau/microservice/resources/ConfigResource.java @@ -62,7 +62,7 @@ public class ConfigResource extends BasicRestServlet { ) ) public OMap getConfig() { - return getServletConfig().getConfig().toMap(); + return getContext().getConfig().toMap(); } @RestMethod( @@ -79,7 +79,7 @@ public class ConfigResource extends BasicRestServlet { tr(th().child("Contents")), tr(th().child( textarea().name("contents").rows(40).cols(120).style("white-space:pre;word-wrap:normal;overflow-x:scroll;font-family:monospace;") - .text(getServletConfig().getConfig().toString())) + .text(getContext().getConfig().toString())) ) ) ) @@ -156,7 +156,7 @@ public class ConfigResource extends BasicRestServlet { @Body(d="New contents in INI file format.") Reader contents ) throws Exception { - return getServletConfig().getConfig().load(contents, true).toMap(); + return getContext().getConfig().load(contents, true).toMap(); } @RestMethod( @@ -178,7 +178,7 @@ public class ConfigResource extends BasicRestServlet { ) Map<String,Object> contents ) throws Exception { - getServletConfig().getConfig().setSection(section, null, contents); + getContext().getConfig().setSection(section, null, contents); return getSection(section); } @@ -199,7 +199,7 @@ public class ConfigResource extends BasicRestServlet { @Body(d="New value for entry.", ex="servlet:/htdocs/themes/dark.css") String value ) throws SectionNotFound, BadConfig { - getServletConfig().getConfig().set(section + '/' + key, value); + getContext().getConfig().set(section + '/' + key, value); return getSection(section).getString(key); } @@ -232,7 +232,7 @@ public class ConfigResource extends BasicRestServlet { private OMap getSection(String name) throws SectionNotFound, BadConfig { OMap m; try { - m = getServletConfig().getConfig().getSectionAsMap(name); + m = getContext().getConfig().getSectionAsMap(name); } catch (ParseException e) { throw new BadConfig(e); } diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestServlet.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestServlet.java index 13b6e33..44e9df3 100644 --- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestServlet.java +++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestServlet.java @@ -128,11 +128,6 @@ public abstract class RestServlet extends HttpServlet { return ""; } - @Override /* GenericServlet */ - public synchronized RestContextBuilder getServletConfig() { - return builder; - } - //----------------------------------------------------------------------------------------------------------------- // Lifecycle methods //-----------------------------------------------------------------------------------------------------------------