use of org.xwiki.component.phase.InitializationException in project xwiki-platform by xwiki.
the class AbstractSheetBinder method initialize.
@Override
public void initialize() throws InitializationException {
try {
String statement = "select doc.fullName, prop.value from XWikiDocument doc, BaseObject obj, StringProperty prop where " + "obj.className=:sheetBindingClass and obj.name=doc.fullName and obj.id=prop.id.id and " + "prop.id.name=:sheetProperty order by doc.fullName";
this.sheetBindingsQuery = this.queryManager.createQuery(statement, Query.HQL);
this.sheetBindingsQuery.bindValue("sheetBindingClass", getSheetBindingClass());
this.sheetBindingsQuery.bindValue("sheetProperty", SHEET_PROPERTY);
} catch (QueryException e) {
throw new InitializationException("Failed to create query for retrieving the list of sheet bindings.", e);
}
}
use of org.xwiki.component.phase.InitializationException in project xwiki-platform by xwiki.
the class CacheImageStorage method initialize.
@Override
public void initialize() throws InitializationException {
CacheConfiguration configuration = new CacheConfiguration();
configuration.setConfigurationId("xwiki.plugin.formula");
try {
this.cache = this.cacheManager.createNewCache(configuration);
} catch (CacheException e) {
throw new InitializationException("Failed to create cache", e);
}
}
use of org.xwiki.component.phase.InitializationException in project xwiki-platform by xwiki.
the class DefaultIconSetCache method initialize.
@Override
public void initialize() throws InitializationException {
try {
CacheConfiguration configuration = new CacheConfiguration(ICON_SET_CACHE_ID);
CacheFactory cacheFactory = cacheManager.getCacheFactory();
this.cache = cacheFactory.newCache(configuration);
} catch (ComponentLookupException | CacheException e) {
throw new InitializationException("Failed to initialize the IconSet Cache.", e);
}
}
use of org.xwiki.component.phase.InitializationException in project xwiki-platform by xwiki.
the class RepositoryManager method initialize.
@Override
public void initialize() throws InitializationException {
// Init cache
CacheConfiguration cacheConfiguration = new CacheConfiguration();
cacheConfiguration.setConfigurationId("repository.extensionid.documentreference");
LRUEvictionConfiguration lru = new LRUEvictionConfiguration();
lru.setMaxEntries(10000);
cacheConfiguration.put(LRUEvictionConfiguration.CONFIGURATIONID, lru);
try {
this.documentReferenceCache = this.cacheManager.createNewCache(cacheConfiguration);
} catch (CacheException e) {
throw new InitializationException("Failed to initialize cache", e);
}
// Listen to modifications
this.observation.addListener(listener);
}
use of org.xwiki.component.phase.InitializationException in project xwiki-platform by xwiki.
the class StubVelocityManager method initialize.
@Override
public void initialize() throws InitializationException {
try {
// Configure the Velocity Engine not to use the Resource Webapp Loader since we don't
// need it and we would need to setup the Container component's ApplicationContext
// otherwise.
Properties properties = new Properties();
properties.setProperty("resource.loader", "file");
this.velocityEngine.initialize(properties);
} catch (XWikiVelocityException e) {
throw new InitializationException("Failed to initialize Velocity Engine", e);
}
}
Aggregations