I'm building an OSGi application containing (at the moment) only business logic. Since I want my users to interact with my software via browser I'm thinking on trying to add an application server inside my application via commands like:
public void startApplicationServer();
public void stopApplciationServer();
public void deployApp(App appToDeploy);
public void undeployApp(App appToUndeploy);
After some thought, the application server I've chosen is "wildfly 10". However, I'm failing to find any resource allowing me to call wildfly programmatically. My question is do you know a procedure to follow or general steps in order to achieve my goal?
Some info you can find useful to help me:
I'm a newbie in the whole "application server" world, so it's highly possible that I'm missing something.
Thanks for any kind reply.
You might want to have a look at WildFly Swarm .
While not documented, there is also the WildFly launcher API . You can see some examples of how it's used in the wildfly-maven-plugn
.
Another option would be the application client . Though I'd probably lean towards WildFly Swarm for your use case.
I ended up embedding tomcat 8 within OSGi environment. I really wanted to use the same JVM process for both OSGi and application server (at least to me having 2 separate processes with all the ensuing overhead made no sense), hence embedding tomcat was perfect. Giving up Java EE 7 Full Profile wasn't a big loss since I only needed Web Profile (+ Jersey for web services).
I've written a guide on how to embed tomcat on OSGi here : in case the link will break down, I'll write down here the most important phases:
JarScanner
from StandardJarScanner
where URIs like "http:// .extensions: /" are ignored; context.setJarScanner(JarScanner js)
method for every context= tomcat.addWebApp(String, String)
call; ServiceRegistration
procedure; I won't mark this answer as the correct one simply because my question was related to wildfly. I consider this answer only as a workaround (even though for me this answer definitely solve my issue)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.