Is it possible to host a SmartApp written in Java in a Java Servlet container? If so is there an example somewhere?
What I’m trying to do:
I’ve developed an openHAB binding (i.e. connector) that allows openHAB to communicate with a Smartthings hub and control the connected devices. Here is a link. Now that I have that completed I want to make a new version that uses the new Smartthings platform. I see a number of good reasons to do that. Probably the biggest is that the binding could contain all of the code and the user wouldn’t have to deploy code to the hub.
openHAB is written in Java and is an OSGi container. The Jetty Java Servlet engine is used. Therefore I will need this SmartApp to run in the Java OSGi container.
The openHAB organization frowns on external libraries. Therefore I would like to limit the use of external libraries to just the smartapp-core jar.
Does this seem possible?
Is there a working example somewhere?
How would I go about converting an incoming HttpServletRequest into a Smartthing ExecutionRequest and then convert the ExecutionResponse into an HttpServletResponse.
Any and all advice will be appreciated.