Java 类org.hibernate.envers.configuration.spi.AuditConfiguration 实例源码

项目:cibet    文件:CibetIntegrator.java   
@Override
public void integrate(Configuration configuration, SessionFactoryImplementor sessionFactory,
      SessionFactoryServiceRegistry serviceRegistry) {
   log.info("start CibetIntegrator");
   final boolean autoRegister = ConfigurationHelper.getBoolean(AUTO_REGISTER, configuration.getProperties(), true);
   if (autoRegister) {
      log.debug("Skipping Cibet Envers listener auto registration");
      return;
   }

   log.info("CibetIntegrator registers Cibet Envers listeners");

   EventListenerRegistry listenerRegistry = serviceRegistry.getService(EventListenerRegistry.class);
   listenerRegistry.addDuplicationStrategy(EnversListenerDuplicationStrategy.INSTANCE);

   enversConfiguration = AuditConfiguration.getFor(configuration,
         serviceRegistry.getService(ClassLoaderService.class));

   if (enversConfiguration.getEntCfg().hasAuditedEntities()) {
      listenerRegistry.appendListeners(EventType.POST_DELETE, new CibetPostDeleteEventListener(enversConfiguration));
      listenerRegistry.appendListeners(EventType.POST_INSERT, new CibetPostInsertEventListener(enversConfiguration));
      listenerRegistry.appendListeners(EventType.POST_UPDATE, new CibetPostUpdateEventListener(enversConfiguration));
      listenerRegistry.appendListeners(EventType.POST_COLLECTION_RECREATE,
            new CibetPostCollectionRecreateEventListener(enversConfiguration));
      listenerRegistry.appendListeners(EventType.PRE_COLLECTION_REMOVE,
            new CibetPreCollectionRemoveEventListener(enversConfiguration));
      listenerRegistry.appendListeners(EventType.PRE_COLLECTION_UPDATE,
            new CibetPreCollectionUpdateEventListener(enversConfiguration));
   }
}
项目:UMLS-Terminology-Server    文件:TermServerEnversIntegrator.java   
@Override
public void integrate(Configuration configuration,
  SessionFactoryImplementor sessionFactory,
  SessionFactoryServiceRegistry serviceRegistry) {

  // Avoid custom behavior is autoregister is true
  try {
    if (!"true".equals(ConfigUtility.getConfigProperties()
        .getProperty("hibernate.listeners.envers.autoRegister"))) {

      super.integrate(configuration, sessionFactory, serviceRegistry);

      final AuditConfiguration enversConfiguration =
          AuditConfiguration.getFor(configuration,
              serviceRegistry.getService(ClassLoaderService.class));
      EventListenerRegistry listenerRegistry =
          serviceRegistry.getService(EventListenerRegistry.class);

      listenerRegistry
          .addDuplicationStrategy(EnversListenerDuplicationStrategy.INSTANCE);

      if (enversConfiguration.getEntCfg().hasAuditedEntities()) {
        listenerRegistry.appendListeners(EventType.POST_INSERT,
            new EmptyEnversPostInsertEventListenerImpl(enversConfiguration));
        listenerRegistry.appendListeners(EventType.POST_DELETE,
            new CustomEnversPostDeleteEventListenerImpl(enversConfiguration));
      }
    }
  } catch (Exception e) {
    throw new RuntimeException(e);
  }

}
项目:cibet    文件:CibetPostDeleteEventListener.java   
protected CibetPostDeleteEventListener(AuditConfiguration enversConfiguration) {
   super(enversConfiguration);
}
项目:cibet    文件:CibetPostUpdateEventListener.java   
protected CibetPostUpdateEventListener(AuditConfiguration enversConfiguration) {
   super(enversConfiguration);
}
项目:cibet    文件:CibetPostInsertEventListener.java   
public CibetPostInsertEventListener(AuditConfiguration enversConfiguration) {
   super(enversConfiguration);
   log.info("register CibetPostInsertEventListener");
}
项目:cibet    文件:CibetPreCollectionUpdateEventListener.java   
protected CibetPreCollectionUpdateEventListener(AuditConfiguration enversConfiguration) {
   super(enversConfiguration);
}
项目:cibet    文件:CibetPreCollectionRemoveEventListener.java   
protected CibetPreCollectionRemoveEventListener(AuditConfiguration enversConfiguration) {
   super(enversConfiguration);
}
项目:cibet    文件:CibetPostCollectionRecreateEventListener.java   
protected CibetPostCollectionRecreateEventListener(AuditConfiguration enversConfiguration) {

      super(enversConfiguration);
   }
项目:UMLS-Terminology-Server    文件:CustomEnversPostDeleteEventListenerImpl.java   
/**
 * Instantiates a {@link CustomEnversPostDeleteEventListenerImpl} from the
 * specified parameters.
 *
 * @param enversConfiguration the envers configuration
 */
public CustomEnversPostDeleteEventListenerImpl(
    AuditConfiguration enversConfiguration) {
  super(enversConfiguration);
}
项目:UMLS-Terminology-Server    文件:EmptyEnversPostInsertEventListenerImpl.java   
/**
 * Instantiates a {@link EmptyEnversPostInsertEventListenerImpl} from the
 * specified parameters.
 *
 * @param enversConfiguration the envers configuration
 */
public EmptyEnversPostInsertEventListenerImpl(
    AuditConfiguration enversConfiguration) {
  super(enversConfiguration);
}