org.jipijapa.event.impl.internal.Notification类的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(66)

本文整理了Java中org.jipijapa.event.impl.internal.Notification类的一些代码示例,展示了Notification类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Notification类的具体详情如下:
包路径:org.jipijapa.event.impl.internal.Notification
类名称:Notification

Notification介绍

[英]Event Notification
[中]事件通知

代码示例

代码示例来源:origin: wildfly/wildfly

public static void addSecondLevelCacheDependencies(Properties mutableProperties, String scopedPersistenceUnitName) {
  if (mutableProperties.getProperty(AvailableSettings.CACHE_REGION_PREFIX) == null) {
    // cache entries for this PU will be identified by scoped pu name + Entity class name
    if (scopedPersistenceUnitName != null) {
      mutableProperties.setProperty(AvailableSettings.CACHE_REGION_PREFIX, scopedPersistenceUnitName);
    }
  }
  String regionFactory = mutableProperties.getProperty(AvailableSettings.CACHE_REGION_FACTORY);
  if (regionFactory == null) {
    regionFactory = DEFAULT_REGION_FACTORY;
    mutableProperties.setProperty(AvailableSettings.CACHE_REGION_FACTORY, regionFactory);
  }
  if (Boolean.parseBoolean(mutableProperties.getProperty(ManagedEmbeddedCacheManagerProvider.SHARED, ManagedEmbeddedCacheManagerProvider.DEFAULT_SHARED))) {
    // Set infinispan defaults
    String container = mutableProperties.getProperty(ManagedEmbeddedCacheManagerProvider.CACHE_CONTAINER);
    if (container == null) {
      container = ManagedEmbeddedCacheManagerProvider.DEFAULT_CACHE_CONTAINER;
      mutableProperties.setProperty(ManagedEmbeddedCacheManagerProvider.CACHE_CONTAINER, container);
    }
    /**
     * AS will need the ServiceBuilder<?> builder that used to be passed to PersistenceProviderAdaptor.addProviderDependencies
     */
    Properties cacheSettings = new Properties();
    cacheSettings.setProperty(CONTAINER, container);
    cacheSettings.setProperty(CACHES, String.join(" ", findCaches(mutableProperties)));
    Notification.addCacheDependencies(Classification.INFINISPAN, cacheSettings);
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public void afterCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu) {
  Notification.afterEntityManagerFactoryCreate( Classification.INFINISPAN, pu );
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public void beforeCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu) {
  Notification.beforeEntityManagerFactoryCreate( Classification.INFINISPAN, pu );
}

代码示例来源:origin: wildfly/wildfly

@Override
public void stop() {
  Notification.stopCache(Classification.INFINISPAN, this.wrapper);
}

代码示例来源:origin: wildfly/wildfly

@Override
public EmbeddedCacheManager getEmbeddedCacheManager(Properties properties) {
  Properties settings = new Properties();
  String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER);
  settings.setProperty(HibernateSecondLevelCache.CONTAINER, container);
  if (!Boolean.parseBoolean(properties.getProperty(SHARED, DEFAULT_SHARED))) {
    HibernateSecondLevelCache.addSecondLevelCacheDependencies(properties, null);
    settings.setProperty(HibernateSecondLevelCache.CACHE_TYPE, HibernateSecondLevelCache.CACHE_PRIVATE);
    // Find a suitable service name to represent this session factory instance
    String name = properties.getProperty(AvailableSettings.SESSION_FACTORY_NAME);
    if (name != null) {
      settings.setProperty(HibernateSecondLevelCache.NAME, name);
    }
    settings.setProperty(HibernateSecondLevelCache.CACHES, String.join(" ", HibernateSecondLevelCache.findCaches(properties)));
  }
  try {
    return new JipiJapaCacheManager(Notification.startCache(Classification.INFINISPAN, settings));
  } catch (CacheException e) {
    throw e;
  } catch (Exception e) {
    throw new CacheException(e);
  }
}

代码示例来源:origin: wildfly/wildfly

public static void remove(EventListener eventListener) {
  Notification.remove(eventListener);
}

代码示例来源:origin: wildfly/wildfly

public static void add(EventListener eventListener) {
  Notification.add(eventListener);
}

代码示例来源:origin: wildfly/wildfly

@Override
public void stop() {
  Notification.stopCache(Classification.INFINISPAN, this.wrapper);
}

代码示例来源:origin: wildfly/wildfly

@Override
public EmbeddedCacheManager getEmbeddedCacheManager(Properties properties) {
  Properties settings = new Properties();
  String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER);
  settings.setProperty(HibernateSecondLevelCache.CONTAINER, container);
  if (!Boolean.parseBoolean(properties.getProperty(SHARED, DEFAULT_SHARED))) {
    HibernateSecondLevelCache.addSecondLevelCacheDependencies(properties, null);
    settings.setProperty(HibernateSecondLevelCache.CACHE_TYPE, HibernateSecondLevelCache.CACHE_PRIVATE);
    // Find a suitable service name to represent this session factory instance
    String name = properties.getProperty(AvailableSettings.SESSION_FACTORY_NAME);
    if (name != null) {
      settings.setProperty(HibernateSecondLevelCache.NAME, name);
    }
    settings.setProperty(HibernateSecondLevelCache.CACHES, String.join(" ", HibernateSecondLevelCache.findCaches(properties)));
  }
  try {
    return new JipiJapaCacheManager(Notification.startCache(Classification.INFINISPAN, settings));
  } catch (CacheException e) {
    throw e;
  } catch (Exception e) {
    throw new CacheException(e);
  }
}

代码示例来源:origin: org.jipijapa/jipijapa-spi

public static void remove(EventListener eventListener) {
  Notification.remove(eventListener);
}

代码示例来源:origin: org.jipijapa/jipijapa-spi

public static void add(EventListener eventListener) {
  Notification.add(eventListener);
}

代码示例来源:origin: org.jipijapa/jipijapa-hibernate4-3

/**
 * Do not attempt to stop our cache manager because it wasn't created by this region factory.
 * Base class stop() will call the base stopCacheRegions()
 */
@Override
protected void stopCacheManager() {
  // notify that the cache is not used but skip the stop since its shared for all jpa applications.
  Notification.stopCache(Classification.INFINISPAN, wrapper, true);
}

代码示例来源:origin: org.jipijapa/jipijapa-hibernate4-1

@Override
protected EmbeddedCacheManager createCacheManager(Properties properties) {
  String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER);
  Properties cacheSettings = new Properties();
  cacheSettings.put(HibernateSecondLevelCache.CONTAINER, container);
  try {
    // Get the (shared) cache manager for JPA application use
    wrapper = Notification.startCache(Classification.INFINISPAN, cacheSettings);
    return (EmbeddedCacheManager)wrapper.getValue();
  } catch (Exception e) {
    throw new CacheException(e);
  }
}

代码示例来源:origin: wildfly/wildfly

@Override
public void beforeCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu) {
  Notification.beforeEntityManagerFactoryCreate(Classification.INFINISPAN, pu);
}

代码示例来源:origin: wildfly/wildfly

@Override
public void afterCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu) {
  Notification.afterEntityManagerFactoryCreate(Classification.INFINISPAN, pu);
}

代码示例来源:origin: wildfly/wildfly

public static void addSecondLevelCacheDependencies(Properties mutableProperties, String scopedPersistenceUnitName) {
  if (mutableProperties.getProperty(AvailableSettings.CACHE_REGION_PREFIX) == null) {
    // cache entries for this PU will be identified by scoped pu name + Entity class name
    if (scopedPersistenceUnitName != null) {
      mutableProperties.setProperty(AvailableSettings.CACHE_REGION_PREFIX, scopedPersistenceUnitName);
    }
  }
  String regionFactory = mutableProperties.getProperty(AvailableSettings.CACHE_REGION_FACTORY);
  if (regionFactory == null) {
    regionFactory = DEFAULT_REGION_FACTORY;
    mutableProperties.setProperty(AvailableSettings.CACHE_REGION_FACTORY, regionFactory);
  }
  if (Boolean.parseBoolean(mutableProperties.getProperty(ManagedEmbeddedCacheManagerProvider.SHARED, ManagedEmbeddedCacheManagerProvider.DEFAULT_SHARED))) {
    // Set infinispan defaults
    String container = mutableProperties.getProperty(ManagedEmbeddedCacheManagerProvider.CACHE_CONTAINER);
    if (container == null) {
      container = ManagedEmbeddedCacheManagerProvider.DEFAULT_CACHE_CONTAINER;
      mutableProperties.setProperty(ManagedEmbeddedCacheManagerProvider.CACHE_CONTAINER, container);
    }
    /**
     * AS will need the ServiceBuilder<?> builder that used to be passed to PersistenceProviderAdaptor.addProviderDependencies
     */
    Properties cacheSettings = new Properties();
    cacheSettings.setProperty(CONTAINER, container);
    cacheSettings.setProperty(CACHES, String.join(" ", findCaches(mutableProperties)));
    Notification.addCacheDependencies(Classification.INFINISPAN, cacheSettings);
  }
}

代码示例来源:origin: org.jboss.eap/jipijapa-spi

public static void remove(EventListener eventListener) {
  Notification.remove(eventListener);
}

代码示例来源:origin: org.jboss.eap/jipijapa-spi

public static void add(EventListener eventListener) {
  Notification.add(eventListener);
}

代码示例来源:origin: org.jipijapa/jipijapa-hibernate4-1

/**
 * Do not attempt to stop our cache manager because it wasn't created by this region factory.
 * Base class stop() will call the base stopCacheRegions()
 */
@Override
protected void stopCacheManager() {
  // notify that the cache is not used but skip the stop since its shared for all jpa applications.
  Notification.stopCache(Classification.INFINISPAN, wrapper, true);
}

代码示例来源:origin: org.jipijapa/jipijapa-hibernate4-3

@Override
protected EmbeddedCacheManager createCacheManager(Properties properties) {
  String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER);
  Properties cacheSettings = new Properties();
  cacheSettings.put(HibernateSecondLevelCache.CONTAINER, container);
  try {
    // Get the (shared) cache manager for JPA application use
    wrapper = Notification.startCache(Classification.INFINISPAN, cacheSettings);
    return (EmbeddedCacheManager)wrapper.getValue();
  } catch (Exception e) {
    throw new CacheException(e);
  }
}

相关文章