use of javax.annotation.PostConstruct in project sakuli by ConSol.
the class ScreenBasedSettings method setDefaults.
@PostConstruct
public void setDefaults() {
setMinSimilarity(currentSimilarity);
WaitScanRate = 10f;
ObserveScanRate = 10f;
ClickDelay = props.getClickDelay();
RobotDesktop.stdAutoDelay = props.getTypeDelayMs();
//if stdAutoDelay is set TypeDelay is no longer needed!
TypeDelay = 0;
OcrDataPath = sakuliProps.getTessDataLibFolder().toAbsolutePath().toString();
OcrTextSearch = true;
OcrTextRead = true;
Highlight = props.isAutoHighlightEnabled();
if (props.getDefaultHighlightSeconds() < 1) {
/**
* because of the mehtode {@link org.sikuli.script.ScreenHighlighter#closeAfter(float)}
* */
throw new InvalidParameterException("the property '" + ActionProperties.DEFAULT_HIGHLIGHT_SEC + "' has to be greater as 1, but was " + props.getDefaultHighlightSeconds());
}
DefaultHighlightTime = props.getDefaultHighlightSeconds();
WaitAfterHighlight = 0.1f;
/***
* Logging for sikuliX => {@link SysOutOverSLF4J} will send the logs to SLF4J
*/
Logger sikuliLogger = LoggerFactory.getLogger(Debug.class);
if (sikuliLogger.isInfoEnabled()) {
LOGGER.debug("sikuli log level INFO enabled");
ActionLogs = true;
InfoLogs = true;
ProfileLogs = true;
}
if (sikuliLogger.isDebugEnabled()) {
LOGGER.debug("sikuli log level DEBUG enabled");
DebugLogs = true;
}
}
use of javax.annotation.PostConstruct in project indy by Commonjava.
the class TestProvider method setup.
// private Http http;
//
// private IndyLocationExpander locationExpander;
//
// private IndyLocationResolver locationResolver;
@PostConstruct
public void setup() {
storeDataManager = new MemoryStoreDataManager(true);
nfc = new MemoryNotFoundCache();
objectMapper = new IndyObjectMapper(false);
fileEventManager = new NoOpFileEventManager();
transferDecorator = new NoOpTransferDecorator();
transportManagerConfig = new TransportManagerConfig();
temp = new TemporaryFolder();
try {
temp.create();
cacheProvider = new FileCacheProvider(temp.newFolder("storage"), indyPathGenerator, fileEventManager, transferDecorator);
} catch (IOException e) {
fail("Cannot initialize temporary directory structure");
temp.delete();
}
}
use of javax.annotation.PostConstruct in project midpoint by Evolveum.
the class ConnectorFactoryConnIdImpl method initialize.
/**
* Initialize the ICF implementation. Look for all connector bundles, get
* basic information about them and keep that in memory.
*/
@PostConstruct
public void initialize() {
// OLD
// bundleURLs = listBundleJars();
bundleURLs = new HashSet<URL>();
Configuration config = midpointConfiguration.getConfiguration("midpoint.icf");
// Is classpath scan enabled
if (config.getBoolean("scanClasspath")) {
// Scan class path
bundleURLs.addAll(scanClassPathForBundles());
}
// Scan all provided directories
@SuppressWarnings("unchecked") List<String> dirs = config.getList("scanDirectory");
for (String dir : dirs) {
bundleURLs.addAll(scanDirectory(dir));
}
for (URL u : bundleURLs) {
LOGGER.debug("ICF bundle URL : {}", u);
}
connectorInfoManagerFactory = ConnectorInfoManagerFactory.getInstance();
}
use of javax.annotation.PostConstruct in project dhis2-core by dhis2.
the class DefaultFieldFilterService method init.
@PostConstruct
public void init() {
ImmutableMap.Builder<String, Preset> presetBuilder = ImmutableMap.builder();
for (Preset preset : Preset.values()) {
presetBuilder.put(preset.getName(), preset);
}
presets = presetBuilder.build();
ImmutableMap.Builder<String, NodeTransformer> transformerBuilder = ImmutableMap.builder();
for (NodeTransformer transformer : nodeTransformers) {
transformerBuilder.put(transformer.name(), transformer);
}
transformers = transformerBuilder.build();
}
use of javax.annotation.PostConstruct in project dhis2-core by dhis2.
the class JCloudsFileResourceContentStore method init.
// -------------------------------------------------------------------------
// Life cycle management
// -------------------------------------------------------------------------
@PostConstruct
public void init() {
// ---------------------------------------------------------------------
// Bootstrap config
// ---------------------------------------------------------------------
config = new BlobStoreProperties(configurationProvider.getProperty(ConfigurationKey.FILESTORE_PROVIDER), configurationProvider.getProperty(ConfigurationKey.FILESTORE_LOCATION), configurationProvider.getProperty(ConfigurationKey.FILESTORE_CONTAINER));
Pair<Credentials, Properties> providerConfig = configureForProvider(config.provider, configurationProvider.getProperty(ConfigurationKey.FILESTORE_IDENTITY), configurationProvider.getProperty(ConfigurationKey.FILESTORE_SECRET));
// ---------------------------------------------------------------------
// Set up JClouds context
// ---------------------------------------------------------------------
blobStoreContext = ContextBuilder.newBuilder(config.provider).credentials(providerConfig.getLeft().identity, providerConfig.getLeft().credential).overrides(providerConfig.getRight()).build(BlobStoreContext.class);
blobStore = blobStoreContext.getBlobStore();
Location provider = new LocationBuilder().scope(LocationScope.PROVIDER).id(config.provider).description(config.provider).build();
try {
blobStore.createContainerInLocation(createRegionLocation(config, provider), config.container);
log.info(String.format("File store configured with provider: '%s', container: '%s' and location: '%s'.", config.provider, config.container, config.location));
} catch (HttpResponseException ex) {
log.error(String.format("Could not configure file store with provider '%s' and container '%s'.\n" + "File storage will not be available.", config.provider, config.container), ex);
} catch (AuthorizationException ex) {
log.error(String.format("Could not authenticate with file store provider '%s' and container '%s'. " + "File storage will not be available.", config.provider, config.location), ex);
}
}
Aggregations