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

com.espertech.esperio.kafka.EsperIOKafkaInputAdapterPlugin Maven / Gradle / Ivy

There is a newer version: 9.0.0
Show newest version
/*
 ***************************************************************************************
 *  Copyright (C) 2006 EsperTech, Inc. All rights reserved.                            *
 *  http://www.espertech.com/esper                                                     *
 *  http://www.espertech.com                                                           *
 *  ---------------------------------------------------------------------------------- *
 *  The software in this package is published under the terms of the GPL license       *
 *  a copy of which has been included with this distribution in the license.txt file.  *
 ***************************************************************************************
 */
package com.espertech.esperio.kafka;

import com.espertech.esper.runtime.client.plugin.PluginLoader;
import com.espertech.esper.runtime.client.plugin.PluginLoaderInitContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class EsperIOKafkaInputAdapterPlugin implements PluginLoader {
    private final static Logger log = LoggerFactory.getLogger(EsperIOKafkaInputAdapterPlugin.class);

    private EsperIOKafkaInputAdapter kafkaInputAdapter;
    private PluginLoaderInitContext context;

    public void init(PluginLoaderInitContext context) {
        this.context = context;
    }

    public void postInitialize() {
        log.info("Starting Kafka Input Adapter");
        kafkaInputAdapter = new EsperIOKafkaInputAdapter(context.getProperties(), context.getRuntime().getURI());
        kafkaInputAdapter.start();
    }

    public void destroy() {
        if (kafkaInputAdapter != null) {
            kafkaInputAdapter.destroy();
        }
        kafkaInputAdapter = null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy