简体   繁体   English

如何向Java应用程序添加启动/停止功能以注册为服务

[英]How to add start/stop functionality to a Java application for registering as a service

We are writing an application in Java and it needs to be start/stoppable by another application, like a service/daemon. 我们正在用Java编写应用程序,它需要由其他应用程序(例如服务/守护程序)启动/停止。 We package it in a .jar which encapsulates everything it needs to run, and put it in a "working directory" which contains configuration files, variable resources, logs, etc. 我们将其打包在一个.jar文件中,该文件封装了它需要运行的所有内容,并将其放在包含配置文件,可变资源,日志等的“工作目录”中。

Is there a good way to be able to start/stop this application from a script or any other application by calling something on it? 是否可以通过调用脚本或其他任何应用程序来启动/停止该应用程序?

Thank you very much for any help! 非常感谢您的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Java Application启动和停止RESTful服务 - start & stop RESTful service from Java Application JAVA-Raspberry-pi-作为服务的应用程序,该服务启动后立即停止 - JAVA - Raspberry-pi - Application as a service who start then stop immediately 如何使用procrun将Java应用程序作为Windows服务启动? - How to start a java application as a windows service with procrun? 如何使用 web 服务启动/停止/重新启动 spring 引导应用程序 - How to start / stop / restart spring boot application using a web service 如何在Java Windows服务包装程序YAJSW停止和启动时实现逻辑? - How to implement logic on stop and start of Java windows service wrapper YAJSW? 如何使用Java Service Wrapper启动/停止Glassfish 2.1.1? - How to start/stop Glassfish 2.1.1 with Java Service Wrapper? 如何通过Java应用程序启动/停止无线路由器? - How can I start/stop a Wireless Router through a Java Application? 如何从Java远程启动/停止IIS 6.0中的应用程序池 - how to start/stop an application pool in IIS 6.0 from Java remotely 如何在 junit 集成测试期间启动/停止 java 应用程序 - How to start/stop java application during junit integration test 在Java中等待Windows服务启动/停止? - In java waiting for a windows service to start/stop?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM