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

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

public class CheckConfig
extends AbstractPlugin

Check the configuration files for services identified by service descriptors in the service starter configuration. For each SharedActivatableServiceDescriptor or NonActivatableServiceDescriptor, a check is made that the command line arguments are not null or empty and that a configuration can be instantiated from those arguments. The configuration is searched for all occurrences of initialLookupGroups entries and generates warnings for those set to ALL_GROUPS.


Nested Class Summary
static class CheckConfig.ConfigTask
          Subtask to load the configuration
static class CheckConfig.GetGroupsTask
          Subtask which obtains all initialLookupGroups entries and returns them in an array of GroupInfo objects.
private static class CheckConfig.GroupInfo
          Struct to hold entryName/Group pairs
 
Field Summary
private  EnvCheck envCheck
          reference to the plugin container
 
Constructor Summary
CheckConfig()
           
 
Method Summary
private  boolean checkArgs(NonActivatableServiceDescriptor d, String source)
          Check that the arguments array obtained by calling getServerConfigArgs on the given service descriptor is non-null and has length > 0.
private  boolean checkConfigLoad(NonActivatableServiceDescriptor d, String source)
          Execute the subtask which loads the configuration file.
private  void checkForAllGroups(NonActivatableServiceDescriptor d, String source)
          Execute the subtask which checks for ALL_GROUPS.
private  void checkServiceConfig(NonActivatableServiceDescriptor d, String source)
          Check the service configuration file by instantiating the configuration in a subtask created using the same properties and arguments that would be used to run the actual service.
 void run(EnvCheck envCheck)
          If configured to perform JSK checks, perform checks for each descriptor.
 
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

private EnvCheck envCheck
reference to the plugin container

Constructor Detail

CheckConfig

public CheckConfig()
Method Detail

run

public void run(EnvCheck envCheck)
If configured to perform JSK checks, perform checks for each descriptor. Any service which conforms to the same command line argument convention may be included in a JSK check.

Parameters:
envCheck - the plugin container

checkArgs

private boolean checkArgs(NonActivatableServiceDescriptor d,
                          String source)
Check that the arguments array obtained by calling getServerConfigArgs on the given service descriptor is non-null and has length > 0. This method is silent if the check is successful.

Parameters:
d - the NonActivatableServiceDescriptor to check
Returns:
true if the arguments are 'well formed'

checkServiceConfig

private void checkServiceConfig(NonActivatableServiceDescriptor d,
                                String source)
Check the service configuration file by instantiating the configuration in a subtask created using the same properties and arguments that would be used to run the actual service. If instantiation is successful, the configuration file and overrides are presumed to be well-formed. If the load is successful, another subtask is run in the same way which checks for an initialLookupGroups entry of ALL_GROUPS. A warning is output if such an entry is found.

Parameters:
d - the NonActivatableServiceDescriptor to check

checkConfigLoad

private boolean checkConfigLoad(NonActivatableServiceDescriptor d,
                                String source)
Execute the subtask which loads the configuration file.

Parameters:
d - the service descriptor
source - the source of the arguments
Returns:
true if the load was successful

checkForAllGroups

private void checkForAllGroups(NonActivatableServiceDescriptor d,
                               String source)
Execute the subtask which checks for ALL_GROUPS.

Parameters:
d - the service descriptor
source - the source of the arguments


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.