All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.netgrid.bauer.impl.impl.StreamConfigFromPropertiesProvider Maven / Gradle / Ivy

Go to download

A Bauer binder supporting POSIX STDIN as events inbound and STOUT as events outbound.

There is a newer version: 1.1.6
Show newest version
package it.netgrid.bauer.impl.impl;

import java.util.Properties;

import com.google.inject.Inject;

import it.netgrid.bauer.impl.StreamConfig;
import it.netgrid.bauer.impl.StreamConfigProvider;

public class StreamConfigFromPropertiesProvider implements StreamConfigProvider {

    private StreamConfig config;

    private final Properties p;

    @Inject
    public StreamConfigFromPropertiesProvider(Properties properties) {
        this.p = properties;
    }

    @Override
    public StreamConfig config() {
        if (config == null) {
            String topicAttribute = p.getProperty(StreamConfig.STREAM_TOPIC_ATTRIBUTE,
                    StreamConfig.STREAM_TOPIC_ATTRIBUTE_DEFAULT);
            String payloadAttribute = p.getProperty(StreamConfig.STREAM_PAYLOAD_ATTRIBUTE,
                    StreamConfig.STREAM_PAYLOAD_ATTRIBUTE_DEFAULT);
            String stopBubble = p.getProperty(StreamConfig.STREAM_MESSAGE_BUBBLING_ENABLED,
                    StreamConfig.STREAM_MESSAGE_BUBBLING_ENABLED_DEFAULT);

            this.config = new StreamConfigImpl(topicAttribute, payloadAttribute,
                    Boolean.parseBoolean(stopBubble));
        }

        return config;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy