Examples of SourceConfiguration


Examples of org.apache.flume.conf.source.SourceConfiguration

        Set<String> sources = agentConf.getSourceSet();
        Map<String, ComponentConfiguration> compMap = agentConf.getSourceConfigMap();
        for (String sourceName : sources) {
            ComponentConfiguration comp = compMap.get(sourceName);
            if (comp != null) {
                SourceConfiguration config = (SourceConfiguration) comp;

                Source source = sourceFactory.create(comp.getComponentName(), comp.getType());

                Configurables.configure(source, config);
                Set<String> channelNames = config.getChannels();
                List<Channel> channels = new ArrayList<Channel>();
                for (String chName : channelNames) {
                    channels.add(conf.getChannels().get(chName));
                }

                ChannelSelectorConfiguration selectorConfig = config.getSelectorConfiguration();

                ChannelSelector selector = ChannelSelectorFactory.create(channels, selectorConfig);

                ChannelProcessor channelProcessor = new ChannelProcessor(selector);
                Configurables.configure(channelProcessor, config);
View Full Code Here

Examples of org.apache.flume.conf.source.SourceConfiguration

        final Set<String> sources = agentConf.getSourceSet();
        final Map<String, ComponentConfiguration> compMap = agentConf.getSourceConfigMap();
        for (final String sourceName : sources) {
            final ComponentConfiguration comp = compMap.get(sourceName);
            if (comp != null) {
                final SourceConfiguration config = (SourceConfiguration) comp;

                final Source source = sourceFactory.create(comp.getComponentName(), comp.getType());

                Configurables.configure(source, config);
                final Set<String> channelNames = config.getChannels();
                final List<Channel> channels = new ArrayList<Channel>();
                for (final String chName : channelNames) {
                    channels.add(conf.getChannels().get(chName));
                }

                final ChannelSelectorConfiguration selectorConfig = config.getSelectorConfiguration();

                final ChannelSelector selector = ChannelSelectorFactory.create(channels, selectorConfig);

                final ChannelProcessor channelProcessor = new ChannelProcessor(selector);
                Configurables.configure(channelProcessor, config);
View Full Code Here

Examples of org.apache.flume.conf.source.SourceConfiguration

        final Set<String> sources = agentConf.getSourceSet();
        final Map<String, ComponentConfiguration> compMap = agentConf.getSourceConfigMap();
        for (final String sourceName : sources) {
            final ComponentConfiguration comp = compMap.get(sourceName);
            if (comp != null) {
                final SourceConfiguration config = (SourceConfiguration) comp;

                final Source source = sourceFactory.create(comp.getComponentName(), comp.getType());

                Configurables.configure(source, config);
                final Set<String> channelNames = config.getChannels();
                final List<Channel> channels = new ArrayList<Channel>();
                for (final String chName : channelNames) {
                    channels.add(conf.getChannels().get(chName));
                }

                final ChannelSelectorConfiguration selectorConfig = config.getSelectorConfiguration();

                final ChannelSelector selector = ChannelSelectorFactory.create(channels, selectorConfig);

                final ChannelProcessor channelProcessor = new ChannelProcessor(selector);
                Configurables.configure(channelProcessor, config);
View Full Code Here

Examples of org.wso2.carbon.transport.relay.config.SourceConfiguration

        // is this a SSL listener?
        sslContext = getSSLContext(transportInDescription);
        sslIOSessionHandler = getSSLIOSessionHandler(transportInDescription);

        sourceConfiguration = new SourceConfiguration(configurationContext,
                transportInDescription, workerPool);
        sourceConfiguration.build();

        // register to receive updates on services for lifetime management
        configurationContext.getAxisConfiguration().addObservers(axisObserver);
View Full Code Here

Examples of org.wso2.carbon.transport.relay.config.SourceConfiguration

        return null;
    }

    public void submitResponse(MessageContext msgContext)
            throws IOException, HttpException {
        SourceConfiguration sourceConfiguration = (SourceConfiguration) msgContext.getProperty(
                        RelayConstants.RELAY_SOURCE_CONFIGURATION);

        NHttpServerConnection conn = (NHttpServerConnection) msgContext.getProperty(
                RelayConstants.RELAY_SOURCE_CONNECTION);

        SourceRequest sourceRequest = SourceContext.getRequest(conn);

        SourceResponse sourceResponse = SourceResponseFactory.create(msgContext,
                sourceRequest, sourceConfiguration);

        SourceContext.setResponse(conn, sourceResponse);

        Boolean noEntityBody = (Boolean) msgContext.getProperty(RelayConstants.NO_ENTITY_BODY);
        Pipe pipe = (Pipe) msgContext.getProperty(RelayConstants.RELAY_PIPE);
        if ((noEntityBody == null || !noEntityBody) || pipe != null) {
            if (pipe != null) {
                pipe.attachConsumer(conn);
                sourceResponse.connect(pipe);
            }
        }

        Integer errorCode = (Integer) msgContext.getProperty(RelayConstants.ERROR_CODE);
        if (errorCode != null) {
            sourceResponse.setStatus(HttpStatus.SC_BAD_GATEWAY);
            SourceContext.get(conn).setShutDown(true);
        }

        ProtocolState state = SourceContext.getState(conn);
        if (state != null && state.compareTo(ProtocolState.REQUEST_DONE) <= 0) {
            // start sending the response if we
            conn.requestOutput();
        } else {
            // nothing much to do as we have started the response already
            if (errorCode != null) {
                if (log.isDebugEnabled()) {
                    log.warn("A Source connection is closed because of an " +
                            "error in target: " + conn);
                }
            } else {
                log.debug("A Source Connection is closed, because source handler " +
                        "is already in the process of writing a response while " +
                        "another response is submitted: " + conn);
            }

            SourceContext.updateState(conn, ProtocolState.CLOSED);
            sourceConfiguration.getSourceConnections().shutDownConnection(conn);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.