| package modelbuilder; |
| |
| import org.springframework.web.bind.annotation.GetMapping; |
| import org.springframework.web.bind.annotation.RestController; |
| import org.eclipse.stem.core.graph.provider.GraphTimeProviderAdapterFactory; |
| import org.osgi.framework.Bundle; |
| import org.osgi.framework.BundleContext; |
| import org.osgi.framework.FrameworkUtil; |
| import org.osgi.framework.ServiceReference; |
| @RestController |
| public class GreetingController { |
| |
| private final GreetingProps props; |
| |
| public GreetingController(GreetingProps props) { |
| this.props = props; |
| } |
| |
| @GetMapping("/hello") |
| public String message() { |
| System.out.println(props.getMessage()); |
| return "{}"; |
| } |
| @GetMapping("/osgi") |
| public String osgi() { |
| BundleContext bundleContext = FrameworkUtil.getBundle(org.eclipse.stem.adapters.file.IdentifiableFileAdapterFactory.class).getBundleContext(); |
| System.out.println(props.getMessage()); |
| return props.getMessage(); |
| } |
| |
| |
| } |