org.neovera.jdiablo.environment
Class ClasspathOptions
java.lang.Object
org.neovera.jdiablo.environment.ClasspathOptions
- All Implemented Interfaces:
- OptionValueProvider
public class ClasspathOptions
- extends Object
- implements OptionValueProvider
Enhances the target object by injecting default values for the target's class. These values are
managed in classpath property files for this class (and any superclasses). This allows runtime
environment default values to be applied to many targets in an environment agnostic manner, by
providing a classpath resource for the common project-specific superclass of many target
classes. Property files are managed as classpath resources using one of these conventions:
1. /full.pkg.qualified.Class-options.properties (at the root package level)
2. /full/pkg/qualified/Class-options.properties
ie /com.company.proj.MailServerMain-options.properties or
/com/company/proj/MailServerMain-options.properties
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClasspathOptions
public ClasspathOptions()
provideOptionValues
public void provideOptionValues(Class<? extends Environment> clz,
Environment environment,
List<? extends OptionPropertyAccessor> list,
Class<? extends Launchable> launchableClass,
Launchable launchable)
- Description copied from interface:
OptionValueProvider
- Called for each environment being used.
- Specified by:
provideOptionValues in interface OptionValueProvider
- Parameters:
clz - Class of the environment (often different from environment.getClass()).environment - Environment instance.list - List of properties relevant to the environment.launchableClass - "Main"'s class.launchable - Main instance.
provideOptionValues
public void provideOptionValues(Class<? extends Launchable> launchableClass,
Launchable launchable,
List<? extends OptionPropertyAccessor> launchProperties)
- Description copied from interface:
OptionValueProvider
- Callback to setup the target (launchable instance) with "default" options using this option
provider.
- Specified by:
provideOptionValues in interface OptionValueProvider
- Parameters:
launchableClass - Class of the "main" class (often different from launchable.getClass())launchable - Main instance.launchProperties - Option properties defined in the "main" launchable that may need to
be populated by the OptionValueProvider.
Copyright © 2014 Neovera Inc.. All rights reserved.