JUNEAU-140 Provide initial contents of PetStore modules.
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 @@
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 @@
}
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 @@
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
//-----------------------------------------------------------------------------------------------------------------