public class ApplicationPidListener 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 |
---|
ApplicationPidListener()
Create a new
ApplicationPidListener instance using the filename
'application.pid'. |
ApplicationPidListener(File file)
Create a new
ApplicationPidListener instance with a specified file. |
ApplicationPidListener(String filename)
Create a new
ApplicationPidListener instance with a specified filename. |
public ApplicationPidListener()
ApplicationPidListener
instance using the filename
'application.pid'.public ApplicationPidListener(String filename)
ApplicationPidListener
instance with a specified filename.filename
- the name of file containing pidpublic ApplicationPidListener(File file)
ApplicationPidListener
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.