com.github.mekuanent.encryption.registry.HibernateSpringIntegratorRegistry Maven / Gradle / Ivy
package com.github.mekuanent.encryption.registry;
import com.github.mekuanent.encryption.listener.InsertEventListener;
import com.github.mekuanent.encryption.listener.LoadEventListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.List;
/**
* Binds EventListeners
*
* @author Mekuanent Kassaye
*/
@Component
public class HibernateSpringIntegratorRegistry {
@Autowired(required = false)
private List hibernateLoadEventListeners;
@Autowired(required = false)
private List hibernateInsertEventListeners;
/**
* fetches all {@link LoadEventListener LoadEventListeners}
* @return list of {@link LoadEventListener LoadEventListeners}
*/
public List getHibernateLoadEventListeners() {
if (hibernateLoadEventListeners == null) {
return Collections.emptyList();
}
return hibernateLoadEventListeners;
}
/**
* fetches all {@link InsertEventListener InsertEventListeners}
* @return list of {@link InsertEventListener InsertEventListeners}
*/
public List getHibernateInsertEventListeners() {
if (hibernateInsertEventListeners == null) {
return Collections.emptyList();
}
return hibernateInsertEventListeners;
}
}