com.sun.jini.tool.envcheck.plugins
Class CheckPersistence

java.lang.Object
  extended by com.sun.jini.tool.envcheck.AbstractPlugin
      extended by com.sun.jini.tool.envcheck.plugins.CheckPersistence
All Implemented Interfaces:
Plugin

public class CheckPersistence
extends AbstractPlugin

Check that the persistence directory supplied by any SharedActivatableServiceDescriptors 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.


Nested Class Summary
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.
 
Field Summary
(package private)  EnvCheck envCheck
           
 
Constructor Summary
CheckPersistence()
           
 
Method Summary
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.
 
Methods inherited from class com.sun.jini.tool.envcheck.AbstractPlugin
getBundle, getString, getString, getString, getString, handleUnexpectedSubtaskReturn, isPluginOption, taskName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

envCheck

EnvCheck envCheck
Constructor Detail

CheckPersistence

public CheckPersistence()
Method Detail

run

public void run(EnvCheck envCheck)
Check the persistence directory for every SharedActivatableServiceDescriptor in the starter configuration.

Parameters:
envCheck - the plugin container

checkDirectory

private void checkDirectory(SharedActivatableServiceDescriptor d)
Launch a subtask for the given descriptor to obtain all the persistenceDirectory entries. Check each entry found for validity.

Parameters:
d - the descriptor to check, which must be a SharedActivatableServiceDescriptor

checkEntries

private void checkEntries(String[] entries,
                          SharedActivatableServiceDescriptor d,
                          String source)
Check 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.

Parameters:
entries - the array of entry/value pairs
d - the descriptor
source - the source descriptive text

checkDir

private Object checkDir(String dir,
                        SharedActivatableServiceDescriptor d)
Perform a check on the given persistence directory.

Parameters:
dir - the name of the directory to check
d - the service descriptor
Returns:
null 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-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.