public class CheckPersistence extends AbstractPlugin
SharedActivatableServiceDescriptor
s are either non-existant or
empty. Check is performed in a subtask VM started identically to how the
activation system would have started it. The first entry in the service
configuration named persistenceDirectory
is checked. Doesn't
work correctly if multiple services share a configuration. Don't know how to
handle this.Modifier and Type | Class and Description |
---|---|
static class |
CheckPersistence.CheckDirTask
Perform directory check with an active security policy in place.
|
static class |
CheckPersistence.GetEntriesTask
The subtask which obtains the list of persistence directory entries.
|
Constructor and Description |
---|
CheckPersistence() |
Modifier and Type | Method and Description |
---|---|
private Object |
checkDir(String dir,
SharedActivatableServiceDescriptor d)
Perform a check on the given persistence directory.
|
private void |
checkDirectory(SharedActivatableServiceDescriptor d)
Launch a subtask for the given descriptor to obtain all the
persistenceDirectory entries. |
private void |
checkEntries(String[] entries,
SharedActivatableServiceDescriptor d,
String source)
Check
entries for validity. |
void |
run(EnvCheck envCheck)
Check the persistence directory for every
SharedActivatableServiceDescriptor in the starter
configuration. |
getBundle, getString, getString, getString, getString, handleUnexpectedSubtaskReturn, isPluginOption, taskName
EnvCheck envCheck
public void run(EnvCheck envCheck)
SharedActivatableServiceDescriptor
in the starter
configuration.envCheck
- the plugin containerprivate void checkDirectory(SharedActivatableServiceDescriptor d)
persistenceDirectory
entries. Check each
entry found for validity.d
- the descriptor to check, which must be a
SharedActivatableServiceDescriptor
private void checkEntries(String[] entries, SharedActivatableServiceDescriptor d, String source)
entries
for validity. entries
contains a collection of pairs, the first being the fully
qualified name of the persistenceDirectory
entry,
and the second being its value.entries
- the array of entry/value pairsd
- the descriptorsource
- the source descriptive textprivate Object checkDir(String dir, SharedActivatableServiceDescriptor d)
dir
- the name of the directory to checkd
- the service descriptornull
if the specified directory is empty
or non-existant (i.e. OK). Otherwise returns an error message
or Throwable
returned by the subtask.Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.