Search in sources :

Example 1 with ReportMetric

use of org.gluu.service.metric.inject.ReportMetric in project oxTrust by GluuFederation.

the class AppInitializer method createMetricPersistenceEntryManager.

@Produces
@ApplicationScoped
@Named(ApplicationFactory.PERSISTENCE_METRIC_ENTRY_MANAGER_NAME)
@ReportMetric
public PersistenceEntryManager createMetricPersistenceEntryManager() {
    Properties connectionProperties = prepareCustomPersistanceProperties(ApplicationFactory.PERSISTENCE_METRIC_CONFIG_GROUP_NAME);
    PersistenceEntryManager persistenceEntryManager = applicationFactory.getPersistenceEntryManagerFactory().createEntryManager(connectionProperties);
    log.info("Created {}: {} with operation service: {}", new Object[] { ApplicationFactory.PERSISTENCE_METRIC_ENTRY_MANAGER_NAME, persistenceEntryManager, persistenceEntryManager.getOperationService() });
    externalPersistenceExtensionService.executePersistenceExtensionAfterCreate(connectionProperties, persistenceEntryManager);
    return persistenceEntryManager;
}
Also used : PersistenceEntryManager(org.gluu.persist.PersistenceEntryManager) Properties(java.util.Properties) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces) ReportMetric(org.gluu.service.metric.inject.ReportMetric) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Example 2 with ReportMetric

use of org.gluu.service.metric.inject.ReportMetric in project oxAuth by GluuFederation.

the class AppInitializer method createMetricPersistenceEntryManager.

@Produces
@ApplicationScoped
@Named(ApplicationFactory.PERSISTENCE_METRIC_ENTRY_MANAGER_NAME)
@ReportMetric
public PersistenceEntryManager createMetricPersistenceEntryManager() {
    Properties connectionProperties = prepareCustomPersistanceProperties(ApplicationFactory.PERSISTENCE_METRIC_CONFIG_GROUP_NAME);
    PersistenceEntryManager persistenceEntryManager = applicationFactory.getPersistenceEntryManagerFactory().createEntryManager(connectionProperties);
    log.info("Created {}: {} with operation service: {}", new Object[] { ApplicationFactory.PERSISTENCE_METRIC_ENTRY_MANAGER_NAME, persistenceEntryManager, persistenceEntryManager.getOperationService() });
    externalPersistenceExtensionService.executePersistenceExtensionAfterCreate(connectionProperties, persistenceEntryManager);
    return persistenceEntryManager;
}
Also used : PersistenceEntryManager(org.gluu.persist.PersistenceEntryManager) Properties(java.util.Properties) Named(javax.inject.Named) Produces(javax.enterprise.inject.Produces) ReportMetric(org.gluu.service.metric.inject.ReportMetric) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Aggregations

Properties (java.util.Properties)2 ApplicationScoped (javax.enterprise.context.ApplicationScoped)2 Produces (javax.enterprise.inject.Produces)2 Named (javax.inject.Named)2 PersistenceEntryManager (org.gluu.persist.PersistenceEntryManager)2 ReportMetric (org.gluu.service.metric.inject.ReportMetric)2