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

com.bixuebihui.jdbc.event.LogAfterChangeEventHandler Maven / Gradle / Ivy

Go to download

a fast small database connection pool and a active record flavor mini framework

There is a newer version: 1.15.8.3
Show newest version
package com.bixuebihui.jdbc.event;

import com.bixuebihui.jdbc.IPrimaryKeyedTable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.function.Consumer;

/**
 * @author xwx
 */
public class LogAfterChangeEventHandler extends BaseAfterChangeEventHandler {

    static  final Logger log = LoggerFactory.getLogger(LogAfterChangeEventHandler.class);
    ChangeEventConsumer handler = (ChangeEvent e) -> {
        log.info(String.valueOf(e));
    };

    public LogAfterChangeEventHandler(IPrimaryKeyedTable dbOperator) {
        super(dbOperator);
    }

    @Override
    public void sendEvent(ChangeEvent e) {
        handler.accept(e);
    }


    @Autowired(required = false)
    public void setHandler(ChangeEventConsumer handler) {
        this.handler = handler;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy