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 0ab8e6b JUNEAU-140 Provide initial contents of PetStore modules.
0ab8e6b is described below
commit 0ab8e6b9781bb8553f4b217a776cb9ad3a73369c
Author: JamesBognar <[email protected]>
AuthorDate: Sun Sep 8 21:02:14 2019 -0400
JUNEAU-140 Provide initial contents of PetStore modules.
---
.../src/main/java/org/apache/juneau/petstore/App.java | 6 +++---
.../java/org/apache/juneau/petstore/AppConfiguration.java | 13 -------------
2 files changed, 3 insertions(+), 16 deletions(-)
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/App.java
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/App.java
index 062b75d..f04953b 100644
---
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/App.java
+++
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/App.java
@@ -15,7 +15,6 @@ package org.apache.juneau.petstore;
import org.apache.juneau.rest.springboot.JuneauRestInitializer;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.context.ConfigurableApplicationContext;
/**
* Entry point for PetStore application.
@@ -28,7 +27,8 @@ public class App {
}
protected void start(String[] args) {
- ConfigurableApplicationContext context = new
SpringApplicationBuilder(App.class).initializers(new
JuneauRestInitializer(App.class)).run(args);
- AppConfiguration.setAppContext(context);
+ new SpringApplicationBuilder(App.class)
+ .initializers(new JuneauRestInitializer(App.class)) // Needed
for Juneau resources as injectible Spring beans.
+ .run(args);
}
}
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/AppConfiguration.java
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/AppConfiguration.java
index b648b06..d3d7370 100644
---
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/AppConfiguration.java
+++
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/AppConfiguration.java
@@ -15,26 +15,13 @@ package org.apache.juneau.petstore;
import org.apache.juneau.petstore.rest.*;
import org.apache.juneau.petstore.service.*;
import org.apache.juneau.rest.springboot.annotation.JuneauRestRoot;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.*;
-import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.*;
import org.springframework.web.filter.*;
@Configuration
public class AppConfiguration {
- @Autowired
- private static volatile ApplicationContext appContext;
-
- public static ApplicationContext getAppContext() {
- return appContext;
- }
-
- public static void setAppContext(ApplicationContext appContext) {
- AppConfiguration.appContext = appContext;
- }
-
//-----------------------------------------------------------------------------------------------------------------
// Services
//-----------------------------------------------------------------------------------------------------------------