@ManagedResource(value="The working directory of jadice server") public class WorkingDirectory extends Object implements org.springframework.context.Lifecycle, org.springframework.jmx.export.naming.SelfNaming
Constructor and Description |
---|
WorkingDirectory() |
Modifier and Type | Method and Description |
---|---|
File |
getBaseDirectory() |
int |
getNumberOfFiles()
Counts the number of all files in the working directory recursively
|
ObjectName |
getObjectName() |
BigInteger |
getSize()
Counts the size of the working directory recursively (sum of the length of all files).
|
boolean |
isPurgeOnStart() |
boolean |
isPurgeOnStop() |
boolean |
isRunning() |
void |
purge()
Purges the temp directory.
|
void |
setBaseDirectory(File baseDir)
Sets the location of the jadice server's working directory
|
void |
setPurgeOnStart(boolean purgeOnStart) |
void |
setPurgeOnStop(boolean purgeOnStop)
Set if the working directory shall be purged on shutdown
|
void |
start() |
void |
stop() |
@ManagedAttribute(description="The base directory") public File getBaseDirectory()
public void setBaseDirectory(File baseDir)
baseDir
- the base directory to use@ManagedMetric(description="Size of the working directory", metricType=GAUGE, unit="Bytes") public BigInteger getSize()
@ManagedMetric(description="Number of files in the working directory", metricType=GAUGE) public int getNumberOfFiles()
@ManagedOperation(description="Purges the working directory. Use carefully!") public void purge() throws IOException
baseDir
is mis-configured. We do this by checking whether a marker file exists.
This operation does not consider if there are Job
s in progress that need a file which
is stored in this working directory
IOException
- if the marker file cannot be (re-)created.public ObjectName getObjectName() throws MalformedObjectNameException
getObjectName
in interface org.springframework.jmx.export.naming.SelfNaming
MalformedObjectNameException
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
@ManagedAttribute(description="Purge the working directory on start") public boolean isPurgeOnStart()
true
iff the working directory is purged on startpublic void setPurgeOnStart(boolean purgeOnStart)
@ManagedAttribute(description="Purge the working directory on shutdown") public boolean isPurgeOnStop()
true
iff the working directory shall be purged on shutdown@ManagedAttribute public void setPurgeOnStop(boolean purgeOnStop)
purgeOnStop
- if true
the working directory shall be purgedCopyright © 2018 levigo holding gmbh. All rights reserved.