use of javax.annotation.PreDestroy in project muikku by otavanopisto.
the class SearchPluginDescriptor method deinit.
@PreDestroy
public void deinit() {
Iterator<SearchProvider> searchProviderIterator = searchProviders.iterator();
while (searchProviderIterator.hasNext()) {
SearchProvider provider = searchProviderIterator.next();
logger.info("Deinitializing search provider: " + provider.getName());
provider.deinit();
}
Iterator<SearchIndexUpdater> updaterProviderIterator = searchIndexUpdaters.iterator();
while (updaterProviderIterator.hasNext()) {
SearchIndexUpdater updater = updaterProviderIterator.next();
logger.info("Deinitializing search index updater: " + updater.getName());
updater.deinit();
}
}
use of javax.annotation.PreDestroy in project sakuli by ConSol.
the class SakuliPropertyPlaceholderConfigurer method restoreProperties.
@PreDestroy
public void restoreProperties() {
try {
for (Map.Entry<String, Map<String, Object>> entry : modifiedSahiConfigProps.entrySet()) {
String propFile = entry.getKey();
logger.debug("restore properties file '{}' with properties '{}'", propFile, entry.getValue());
PropertiesConfiguration propConfig = new PropertiesConfiguration(propFile);
propConfig.setAutoSave(true);
for (Map.Entry<String, Object> propEntry : entry.getValue().entrySet()) {
String propKey = propEntry.getKey();
if (propConfig.containsKey(propKey)) {
propConfig.clearProperty(propKey);
}
propConfig.addProperty(propKey, propEntry.getValue());
}
}
} catch (ConfigurationException e) {
logger.error("Error in restore sahi config properties", e);
}
}
use of javax.annotation.PreDestroy in project wildfly by wildfly.
the class SFSBLifecycleCallback method tearDown.
@PreDestroy
public void tearDown() throws Exception {
// on Stateful bean is permitted to call getCallerPrincipal on @PreDestroy
ITestResultsSingleton results = this.getSingleton();
Principal princ = sessContext.getCallerPrincipal();
results.setSfsb("predestroy", princ.getName() + "stop");
log.trace(SFSBLifecycleCallback.class.getSimpleName() + " @PreDestroy called");
}
use of javax.annotation.PreDestroy in project wildfly by wildfly.
the class SLSBLifecycleCallback method tearDown.
@PreDestroy
public void tearDown() throws Exception {
// on Stateless bean is not permitted to call getCallerPrincipal on @PreDestroy
ITestResultsSingleton results = getSingleton();
log.trace(SLSBLifecycleCallback.class.getSimpleName() + " @PreDestroy called");
Principal princ = null;
try {
princ = sessContext.getCallerPrincipal();
} catch (IllegalStateException e) {
results.setSlsb("predestroy", "OKstop");
return;
}
results.setSlsb("predestroy", "Method getCallerPrincipal was called from @PreDestroy with result: " + princ);
}
use of javax.annotation.PreDestroy in project wildfly by wildfly.
the class BeanTwo method preDestroy.
@PreDestroy
public void preDestroy() {
try {
new InitialContext().lookup(TestResults.SHARED_BINDING_NAME_ONE);
new InitialContext().lookup(TestResults.SHARED_BINDING_NAME_TWO);
testResults.setPreDestroyTwo(true);
} catch (Throwable e) {
e.printStackTrace();
testResults.setPreDestroyTwo(false);
}
}
Aggregations