use of com.sun.enterprise.module.bootstrap.StartupContext in project Payara by payara.
the class CommonClassLoaderServiceImpl method findDerbyClient.
private List<File> findDerbyClient() {
final String DERBY_HOME_PROP = "AS_DERBY_INSTALL";
StartupContext startupContext = env.getStartupContext();
Properties arguments = null;
if (startupContext != null) {
arguments = startupContext.getArguments();
}
String derbyHome = null;
if (arguments != null) {
derbyHome = arguments.getProperty(DERBY_HOME_PROP, System.getProperty(DERBY_HOME_PROP));
}
File derbyLib = null;
if (derbyHome != null) {
derbyLib = new File(derbyHome, "lib");
}
if (derbyLib == null || !derbyLib.exists()) {
// maybe the jdk...
if (System.getProperty("java.version").compareTo("1.6") > 0) {
File jdkHome = new File(System.getProperty("java.home"));
derbyLib = new File(jdkHome, "../db/lib");
}
}
if (!derbyLib.exists()) {
logger.info(KernelLoggerInfo.cantFindDerby);
return Collections.EMPTY_LIST;
}
return Arrays.asList(derbyLib.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
// already mentioned in the Class-Path header of the main jars
return (name.endsWith(".jar") && !name.startsWith("derbyLocale_"));
}
}));
}
use of com.sun.enterprise.module.bootstrap.StartupContext in project Payara by payara.
the class CommonClassLoaderServiceImpl method findH2Client.
private List<File> findH2Client() {
final String H2_HOME_PROP = "AS_H2_INSTALL";
StartupContext startupContext = env.getStartupContext();
Properties arguments = null;
if (startupContext != null) {
arguments = startupContext.getArguments();
}
String h2Home = null;
if (arguments != null) {
h2Home = arguments.getProperty(H2_HOME_PROP, System.getProperty(H2_HOME_PROP));
}
File h2Lib = null;
if (h2Home != null) {
h2Lib = new File(h2Home, "bin");
} else if (env.isMicro() && arguments != null) {
h2Home = arguments.getProperty(INSTALL_ROOT_PROPERTY, System.getProperty(INSTALL_ROOT_PROPERTY));
h2Lib = new File(h2Home, "runtime");
}
if (h2Lib == null || !h2Lib.exists()) {
logger.info(KernelLoggerInfo.cantFindH2);
return Collections.EMPTY_LIST;
}
return Arrays.asList(h2Lib.listFiles((dir, name) -> name.startsWith("h2") && name.endsWith(".jar")));
}
use of com.sun.enterprise.module.bootstrap.StartupContext in project Payara by payara.
the class ModuleConfigurationLoader method addConfigBeanFor.
protected <U extends ConfigBeanProxy> void addConfigBeanFor(Class<U> extensionType) {
if (!RankedConfigBeanProxy.class.isAssignableFrom(extensionType)) {
if (getExtension(extensionType, extensionOwner) != null) {
return;
}
}
StartupContext context = serviceLocator.getService(StartupContext.class);
List<ConfigBeanDefaultValue> configBeanDefaultValueList = configModularityUtils.getDefaultConfigurations(extensionType, configModularityUtils.getRuntimeTypePrefix(context));
configurationParser.parseAndSetConfigBean(configBeanDefaultValueList);
}
Aggregations