本文整理汇总了Java中org.kuali.rice.core.impl.config.property.JAXBConfigImpl类的典型用法代码示例。如果您正苦于以下问题:Java JAXBConfigImpl类的具体用法?Java JAXBConfigImpl怎么用?Java JAXBConfigImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JAXBConfigImpl类属于org.kuali.rice.core.impl.config.property包,在下文中一共展示了JAXBConfigImpl类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getRootConfig
import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; //导入依赖的package包/类
/**
* Gets the {@link Config} from both the current configuration and the ones in {@code loaded}, at {@code location},
* and in the {@code servletContext}.
*
* @param loaded the loaded properties
* @param location the location of additional properties
* @param servletContext the servlet context in which to add more properties
*
* @return the final configuration
*/
public static Config getRootConfig(Properties loaded, String location, ServletContext servletContext) {
// Get the Rice config object the listener created
Config config = ConfigContext.getCurrentContextConfig();
Preconditions.checkNotNull(config, "'config' cannot be null");
Properties listenerProperties = getProperties(config);
// Parse config from the location indicated, using listener properties in the process of doing so
JAXBConfigImpl parsed = parseConfig(location, listenerProperties);
// Add and override loaded properties with parsed properties
addAndOverride(loaded, parsed.getRawProperties());
// Priority is servlet -> env -> system
// Override anything we've loaded with servlet, env, and system properties
Properties servlet = PropertySources.convert(servletContext);
Properties global = PropertyUtils.getGlobalProperties(servlet);
addAndOverride(loaded, global);
logger.info("Using {} distinct properties", Integer.valueOf(loaded.size()));
// Use JAXBConfigImpl in order to perform Rice's custom placeholder resolution logic now that everything is loaded
return new JAXBConfigImpl(loaded);
}
开发者ID:kuali,项目名称:kc-rice,代码行数:34,代码来源:RiceConfigUtils.java
示例2: initializeKfs
import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; //导入依赖的package包/类
public static void initializeKfs() {
long startInit = System.currentTimeMillis();
LOG.info("Initializing Kuali Rice Application...");
String bootstrapSpringBeans = "ole-startup.xml";
Properties baseProps = new Properties();
baseProps.putAll(System.getProperties());
JAXBConfigImpl config = new JAXBConfigImpl(baseProps);
ConfigContext.init(config);
context = new ClassPathXmlApplicationContext(bootstrapSpringBeans);
context.start();
long endInit = System.currentTimeMillis();
LOG.info("...Kuali Rice Application successfully initialized, startup took " + (endInit - startInit) + " ms.");
SpringContext.finishInitializationAfterRiceStartup();
SpringContext.initMemoryMonitor();
SpringContext.initMonitoringThread();
}
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:22,代码来源:SpringContextForBatchRunner.java
示例3: initializeKfs
import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; //导入依赖的package包/类
public static void initializeKfs() {
long startInit = System.currentTimeMillis();
LOG.info("Initializing Kuali Rice Application...");
String bootstrapSpringBeans = "kfs-workflow-importer-startup.xml";
Properties baseProps = new Properties();
baseProps.putAll(System.getProperties());
JAXBConfigImpl config = new JAXBConfigImpl(baseProps);
ConfigContext.init(config);
context = new ClassPathXmlApplicationContext(bootstrapSpringBeans);
context.start();
long endInit = System.currentTimeMillis();
LOG.info("...Kuali Rice Application successfully initialized, startup took " + (endInit - startInit) + " ms.");
}
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:18,代码来源:WorkflowImporter.java
示例4: initializeKfs
import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; //导入依赖的package包/类
public static void initializeKfs() {
long startInit = System.currentTimeMillis();
LOG.info("Initializing Kuali Rice Application...");
String bootstrapSpringBeans = "kfs-startup.xml";
Properties baseProps = new Properties();
baseProps.putAll(System.getProperties());
JAXBConfigImpl config = new JAXBConfigImpl(baseProps);
ConfigContext.init(config);
context = new ClassPathXmlApplicationContext(bootstrapSpringBeans);
context.start();
long endInit = System.currentTimeMillis();
if (LOG.isInfoEnabled()) {
LOG.info("...Kuali Rice Application successfully initialized, startup took " + (endInit - startInit) + " ms.");
}
SpringContext.finishInitializationAfterRiceStartup();
SpringContext.initMemoryMonitor();
SpringContext.initMonitoringThread();
}
开发者ID:kuali,项目名称:kfs,代码行数:24,代码来源:SpringContextForBatchRunner.java
示例5: loadBaseProperties
import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; //导入依赖的package包/类
protected static void loadBaseProperties() {
if (BASE_PROPERTIES.isEmpty()) {
List<String> riceXmlConfigurations = new ArrayList<String>();
riceXmlConfigurations.add("classpath:META-INF/common-config-defaults.xml");
JAXBConfigImpl riceXmlConfigurer = new JAXBConfigImpl(riceXmlConfigurations);
try {
riceXmlConfigurer.parseConfig();
} catch (IOException ex) {
ex.printStackTrace();
}
BASE_PROPERTIES.putAll(riceXmlConfigurer.getProperties());
loadProperties(BASE_PROPERTIES, new StringBuilder("classpath:").append(KFS_DEFAULT_CONFIGURATION_FILE_NAME).append(".properties").toString());
loadProperties(BASE_PROPERTIES, new StringBuilder("classpath:").append(KFS_RICE_DEFAULT_CONFIGURATION_FILE_NAME).append(".properties").toString());
loadProperties(BASE_PROPERTIES, new StringBuilder("classpath:").append(KFS_SECURITY_DEFAULT_CONFIGURATION_FILE_NAME).append(".properties").toString());
loadExternalProperties(BASE_PROPERTIES, ADDITIONAL_KFS_CONFIG_LOCATIONS_PARAM);
loadExternalProperties(BASE_PROPERTIES, ADDITIONAL_KFS_TEST_CONFIG_LOCATIONS_PARAM);
}
}
开发者ID:kuali,项目名称:kfs,代码行数:21,代码来源:PropertyLoadingFactoryBean.java
示例6: parseConfig
import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; //导入依赖的package包/类
/**
* Parse the configuration stored at {@code location}, adding any additional properties from {@code properties}.
*
* @param location the location to get properties from
* @param properties any additional properties to add
*
* @return the new configuration
*/
public static JAXBConfigImpl parseConfig(String location, Properties properties) {
try {
JAXBConfigImpl config = new JAXBConfigImpl(location, properties);
config.parseConfig();
return config;
} catch (IOException e) {
throw new IllegalStateException("Unexpected error parsing config", e);
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:RiceConfigUtils.java
示例7: getProperties
import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; //导入依赖的package包/类
/**
* Returns the {@link Properties} from the given {@code config}.
*
* @param config the {@link Config} to get the {@link Properties} from
*
* @return the {@link Properties}
*/
public static Properties getProperties(Config config) {
if (config instanceof JAXBConfigImpl) {
JAXBConfigImpl jci = (JAXBConfigImpl) config;
return jci.getRawProperties();
} else {
logger.warn("Unable to access raw Rice config properties.");
return config.getProperties();
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:RiceConfigUtils.java
示例8: initializeKfsTestContext
import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; //导入依赖的package包/类
public static void initializeKfsTestContext() {
long startInit = System.currentTimeMillis();
LOG.info("Initializing Kuali Rice Application...");
String bootstrapSpringBeans = "classpath:kfs-startup-test.xml";
Properties baseProps = new Properties();
baseProps.putAll(System.getProperties());
JAXBConfigImpl config = new JAXBConfigImpl(baseProps);
ConfigContext.init(config);
context = new ClassPathXmlApplicationContext();
context.setConfigLocation(bootstrapSpringBeans);
try {
context.refresh();
} catch (RuntimeException e) {
LOG.error("problem during context.refresh()", e);
throw e;
}
context.start();
long endInit = System.currentTimeMillis();
LOG.info("...Kuali Rice Application successfully initialized, startup took " + (endInit - startInit) + " ms.");
SpringContext.finishInitializationAfterRiceStartup();
}
开发者ID:kuali,项目名称:kfs,代码行数:28,代码来源:KFSTestStartup.java
示例9: getTestHarnessConfig
import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; //导入依赖的package包/类
protected Config getTestHarnessConfig() throws Exception {
Config config = new JAXBConfigImpl(getConfigLocations(), System.getProperties());
config.parseConfig();
return config;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:6,代码来源:RiceTestCase.java
示例10: contextInitialized
import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; //导入依赖的package包/类
/**
* ServletContextListener interface implementation that schedules the start of the lifecycle
*/
@Override
public void contextInitialized(ServletContextEvent sce) {
long startInit = System.currentTimeMillis();
LOG.info("Initializing Kuali Rice Application...");
// Stop Quartz from "phoning home" on every startup
System.setProperty("org.terracotta.quartz.skipUpdateCheck", "true");
List<String> configLocations = new ArrayList<String>();
String additionalConfigLocations = System.getProperty(KewApiConstants.ADDITIONAL_CONFIG_LOCATIONS_PARAM);
if (!StringUtils.isBlank(additionalConfigLocations)) {
String[] additionalConfigLocationArray = additionalConfigLocations.split(",");
for (String additionalConfigLocation : additionalConfigLocationArray) {
configLocations.add(additionalConfigLocation);
}
}
String bootstrapSpringBeans = "";
if (!StringUtils.isBlank(System.getProperty(WEB_BOOTSTRAP_SPRING_FILE))) {
bootstrapSpringBeans = System.getProperty(WEB_BOOTSTRAP_SPRING_FILE);
} else if (!StringUtils.isBlank(sce.getServletContext().getInitParameter(WEB_BOOTSTRAP_SPRING_FILE))) {
String bootstrapSpringInitParam = sce.getServletContext().getInitParameter(WEB_BOOTSTRAP_SPRING_FILE);
// if the value comes through as ${bootstrap.spring.beans}, we ignore it
if (!DEFAULT_SPRING_BEANS_REPLACEMENT_VALUE.equals(bootstrapSpringInitParam)) {
bootstrapSpringBeans = bootstrapSpringInitParam;
LOG.info("Found bootstrap Spring Beans file defined in servlet context: " + bootstrapSpringBeans);
}
}
Properties baseProps = new Properties();
baseProps.putAll(getContextParameters(sce.getServletContext()));
baseProps.putAll(System.getProperties());
JAXBConfigImpl config = new JAXBConfigImpl(baseProps);
ConfigContext.init(config);
context = new XmlWebApplicationContext();
if (!StringUtils.isEmpty(bootstrapSpringBeans)) {
context.setConfigLocation(bootstrapSpringBeans);
}
context.setServletContext(sce.getServletContext());
// Provide an optional method for bootstrapping a Spring property source
Optional<PropertySource<?>> ps = PropertySources.getPropertySource(sce, "web.bootstrap.spring.psc");
if (ps.isPresent()) {
PropertySources.addFirst(context, ps.get());
}
try {
context.refresh();
} catch (RuntimeException e) {
LOG.error("problem during context.refresh()", e);
throw e;
}
context.start();
long endInit = System.currentTimeMillis();
LOG.info("...Kuali Rice Application successfully initialized, startup took " + (endInit - startInit) + " ms.");
}
开发者ID:kuali,项目名称:kc-rice,代码行数:63,代码来源:KualiInitializeListener.java
示例11: contextInitialized
import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent sce) {
configureInitialLogging();
// Set env.code from param, if present, dev if not.
// Add some settings to allow for dynamic environment prefix changes.
if (System.getProperty("env.code") == null) {
System.setProperty("env.code", "dev");
}
long startInit = System.currentTimeMillis();
LOG.info("Initializing Kuali Rice Application...");
List<String> configLocations = new ArrayList<String>();
String additionalConfigLocations = System.getProperty(KewApiConstants.ADDITIONAL_CONFIG_LOCATIONS_PARAM);
if (!StringUtils.isBlank(additionalConfigLocations)) {
String[] additionalConfigLocationArray = additionalConfigLocations.split(",");
for (String additionalConfigLocation : additionalConfigLocationArray) {
configLocations.add(additionalConfigLocation);
}
}
String bootstrapSpringBeans = "";
if (!StringUtils.isBlank(System.getProperty(WEB_BOOTSTRAP_SPRING_FILE))) {
bootstrapSpringBeans = System.getProperty(WEB_BOOTSTRAP_SPRING_FILE);
} else if (!StringUtils.isBlank(sce.getServletContext().getInitParameter(WEB_BOOTSTRAP_SPRING_FILE))) {
String bootstrapSpringInitParam = sce.getServletContext().getInitParameter(WEB_BOOTSTRAP_SPRING_FILE);
// if the value comes through as ${bootstrap.spring.beans}, we ignore it
if (!DEFAULT_SPRING_BEANS_REPLACEMENT_VALUE.equals(bootstrapSpringInitParam)) {
bootstrapSpringBeans = bootstrapSpringInitParam;
LOG.info("Found bootstrap Spring Beans file defined in servlet context: " + bootstrapSpringBeans);
}
}
Properties baseProps = new Properties();
try {
baseProps.putAll(getContextParameters(sce.getServletContext()));
baseProps.putAll(System.getProperties());
JAXBConfigImpl config = new JAXBConfigImpl(baseProps);
ConfigContext.init(config);
} catch (Throwable t){
LOG.error("Error caught in init "+t);
}
context = new XmlWebApplicationContext();
if (!StringUtils.isEmpty(bootstrapSpringBeans)) {
context.setConfigLocation(bootstrapSpringBeans);
}
context.setServletContext(sce.getServletContext());
try {
context.refresh();
} catch (RuntimeException e) {
LOG.error("problem during context.refresh()", e);
throw e;
}
context.start();
long endInit = System.currentTimeMillis();
LOG.info("...Kuali Rice Application successfully initialized, startup took " + (endInit - startInit) + " ms.");
}
开发者ID:kuali-mirror,项目名称:kpme,代码行数:64,代码来源:EdoInitializeListener.java
示例12: contextInitialized
import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; //导入依赖的package包/类
/**
* ServletContextListener interface implementation that schedules the start of the lifecycle
*/
@Override
public void contextInitialized(ServletContextEvent sce) {
long startInit = System.currentTimeMillis();
LOG.info("Initializing Kuali Rice Application...");
List<String> configLocations = new ArrayList<String>();
String additionalConfigLocations = System.getProperty(KewApiConstants.ADDITIONAL_CONFIG_LOCATIONS_PARAM);
if (!StringUtils.isBlank(additionalConfigLocations)) {
String[] additionalConfigLocationArray = additionalConfigLocations.split(",");
for (String additionalConfigLocation : additionalConfigLocationArray) {
configLocations.add(additionalConfigLocation);
}
}
String bootstrapSpringBeans = "";
if (!StringUtils.isBlank(System.getProperty(WEB_BOOTSTRAP_SPRING_FILE))) {
bootstrapSpringBeans = System.getProperty(WEB_BOOTSTRAP_SPRING_FILE);
} else if (!StringUtils.isBlank(sce.getServletContext().getInitParameter(WEB_BOOTSTRAP_SPRING_FILE))) {
String bootstrapSpringInitParam = sce.getServletContext().getInitParameter(WEB_BOOTSTRAP_SPRING_FILE);
// if the value comes through as ${bootstrap.spring.beans}, we ignore it
if (!DEFAULT_SPRING_BEANS_REPLACEMENT_VALUE.equals(bootstrapSpringInitParam)) {
bootstrapSpringBeans = bootstrapSpringInitParam;
LOG.info("Found bootstrap Spring Beans file defined in servlet context: " + bootstrapSpringBeans);
}
}
Properties baseProps = new Properties();
baseProps.putAll(getContextParameters(sce.getServletContext()));
baseProps.putAll(System.getProperties());
JAXBConfigImpl config = new JAXBConfigImpl(baseProps);
ConfigContext.init(config);
context = new XmlWebApplicationContext();
if (!StringUtils.isEmpty(bootstrapSpringBeans)) {
context.setConfigLocation(bootstrapSpringBeans);
}
context.setServletContext(sce.getServletContext());
try {
context.refresh();
} catch (RuntimeException e) {
LOG.error("problem during context.refresh()", e);
throw e;
}
context.start();
long endInit = System.currentTimeMillis();
LOG.info("...Kuali Rice Application successfully initialized, startup took " + (endInit - startInit) + " ms.");
}
开发者ID:aapotts,项目名称:kuali_rice,代码行数:54,代码来源:KualiInitializeListener.java
示例13: parseAndInit
import org.kuali.rice.core.impl.config.property.JAXBConfigImpl; //导入依赖的package包/类
/**
* Parse the configuration stored at {@code location} and initialize.
*
* @param location the location to get properties from
*
* @return the new configuration
*/
public static JAXBConfigImpl parseAndInit(String location) {
JAXBConfigImpl config = parseConfig(location);
ConfigContext.init(config);
return config;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:RiceConfigUtils.java
注:本文中的org.kuali.rice.core.impl.config.property.JAXBConfigImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论