public class ApplicationPidFileWriter extends Object implements ApplicationListener<ApplicationStartedEvent>, Ordered
ApplicationListener
that saves application PID into file. This application
listener will be triggered exactly once per JVM, and the file name can be overridden at
runtime with a System property or environment variable named "PIDFILE" (or "pidfile").HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
ApplicationPidFileWriter()
Create a new
ApplicationPidFileWriter instance using the filename
'application.pid'. |
ApplicationPidFileWriter(File file)
Create a new
ApplicationPidFileWriter instance with a specified file. |
ApplicationPidFileWriter(String filename)
Create a new
ApplicationPidFileWriter instance with a specified filename. |
public ApplicationPidFileWriter()
ApplicationPidFileWriter
instance using the filename
'application.pid'.public ApplicationPidFileWriter(String filename)
ApplicationPidFileWriter
instance with a specified filename.filename
- the name of file containing pidpublic ApplicationPidFileWriter(File file)
ApplicationPidFileWriter
instance with a specified file.file
- the file containing pidpublic void onApplicationEvent(ApplicationStartedEvent event)
onApplicationEvent
in interface ApplicationListener<ApplicationStartedEvent>
public void setOrder(int order)
Copyright © 2014 Pivotal Software, Inc.. All rights reserved.