Java 类javax.enterprise.inject.spi.BeforeShutdown 实例源码

项目:wildfly-microprofile-health    文件:CDIExtension.java   
/**
 * Called when the deployment is undeployed.
 *
 * Remove all the instances of {@link HealthCheck} from the {@link HealthMonitor}.
 * Handle manually their CDI destroy lifecycle.
 */
public void close(@Observes final BeforeShutdown bs) {
   healthChecks.forEach(healthCheck -> healthMonitor.removeHealthCheck(healthCheck));
   healthChecks.clear();
   healthCheckInstances.forEach(instance -> instance.preDestroy().dispose());
   healthCheckInstances.clear();
}
项目:weld-vertx    文件:RouteExtension.java   
void beforeShutdown(@Observes BeforeShutdown event) {
    for (HandlerInstance<?> handler : handlerInstances) {
        handler.dispose();
    }
    handlerInstances.clear();
    handlerTypes.clear();
    routeObservers.clear();
}
项目:opendata-common    文件:SchedulerExtension.java   
void stop( @Observes BeforeShutdown beforeShutdown )
{
    try {
        if( scheduler.isStarted() ) {
            scheduler.shutdown();
        }
    }
    catch( SchedulerException ex ) {
        LOG.log( Level.SEVERE, null, ex );
    }
}
项目:wildfly-swarm    文件:HealthExtension.java   
/**
 * Called when the deployment is undeployed.
 *
 * Remove all the instances of {@link HealthCheck} from the {@link Monitor}.
 * Handle manually their CDI destroy lifecycle.
 */
public void beforeShutdown(@Observes final BeforeShutdown bs) {
    healthChecks.forEach(healthCheck -> monitor.unregisterHealthBean(healthCheck));
    healthChecks.clear();
    healthCheckInstances.forEach(instance -> instance.preDestroy().dispose());
    healthCheckInstances.clear();
}
项目:flowable-engine    文件:FlowableExtension.java   
public void beforeShutdown(@Observes BeforeShutdown event) {
    if (processEngineLookup != null) {
        processEngineLookup.ungetProcessEngine();
        processEngineLookup = null;
    }
    LOGGER.info("Shutting down flowable-cdi");
}
项目:jcache-cdi    文件:ExtraJCacheExtension.java   
public void destroyIfCreated(final @Observes BeforeShutdown beforeShutdown)
{
    if (cacheManager != null)
    {
        cacheManager.close();
    }
    if (cachingProvider != null)
    {
        cachingProvider.close();
    }
}
项目:switchyard    文件:SwitchYardCDIDeployer.java   
/**
 * {@link BeforeShutdown} CDI event observer.
 *
 * @param event       CDI Event instance.
 */
public void beforeShutdown(@Observes BeforeShutdown event) {
    if (_deployment != null) {
        _deployment.stop();
        _deployment.destroy();
    }
}
项目:osgi.ee    文件:ServiceExtension.java   
/**
 * Destroy this extension. Removes all services.
 *
 * @param shut The before shutdown event
 */
public void destroy(@Observes BeforeShutdown shut) {
    exportedBeans.values().stream().
        forEach((s) ->  {
            try {
                s.unregister();
            } catch (Exception exc) {}
        });
    trackers.values().forEach((t) -> t.destroy());
}
项目:osgi.ee    文件:ScopeExtension.java   
/**
 * Destroy this extension. Removes the scope services.
 * 
 * @param shut The shutdown event
 */
public void destroy(@Observes BeforeShutdown shut) {
    this.contexts.forEach((c) -> c.destroy());
    this.registrations.stream().
        forEach((s) ->  {
            try {
                s.unregister();
            } catch (Exception exc) {}
        });
}
项目:FiWare-Template-Handler    文件:ActivitiExtension.java   
public void beforeShutdown(@Observes BeforeShutdown event) {
  if(processEngineLookup != null) {
    processEngineLookup.ungetProcessEngine();
    processEngineLookup = null;
  }
  logger.info("Shutting down activiti-cdi");    
}
项目:tomee    文件:HessianExtension.java   
protected void shutdown(final @Observes BeforeShutdown unused) {
    final HessianService service = SystemInstance.get().getComponent(HessianService.class);
    if (service == null) {
        return;
    }

    final HessianRegistry registry = service.getRegistry();
    for (final DeployedEndpoint pair : deployed) {
        registry.undeploy(service.getVirtualHost(), pair.app, pair.name);
        LOGGER.info("Undeployed CDI hessian service " + pair.name);
    }
    deployed.clear();
}
项目:incubator-batchee    文件:BatchCDIInjectionExtension.java   
public void cleanupStoredBeanManagerOnShutdown(final @Observes BeforeShutdown beforeShutdown) {
    if (CDI_1_1_AVAILABLE || bmpSingleton == null) {
        return;
    }

    bmpSingleton.bmInfos.remove(loader());
}
项目:deltaspike    文件:SchedulerExtension.java   
public <X> void stopScheduler(@Observes BeforeShutdown beforeShutdown)
{
    if (!this.isActivated)
    {
        return;
    }

    if (this.scheduler != null)
    {
        this.scheduler.stop();
        this.scheduler = null;
    }
}
项目:deltaspike    文件:BeanManagerProvider.java   
/**
 * Cleanup on container shutdown.
 *
 * @param beforeShutdown CDI shutdown event
 */
public void cleanupStoredBeanManagerOnShutdown(@Observes BeforeShutdown beforeShutdown)
{
    if (bmpSingleton == null)
    {
        // this happens if there has been a failure at startup
        return;
    }

    bmpSingleton.bmInfos.remove(ClassUtils.getClassLoader(null));
}
项目:deltaspike    文件:ConfigurationExtension.java   
/**
 * This method triggers freeing of the ConfigSources.
 */
@SuppressWarnings("UnusedDeclaration")
public void freeConfigSources(@Observes BeforeShutdown bs)
{
    String appName = ConfigResolver.getPropertyValue(ConfigResolver.DELTASPIKE_APP_NAME_CONFIG);
    unRegisterConfigMBean(appName);

    ConfigResolver.freeConfigSources();
    detectedParentPropertyFileConfigs.remove(ClassUtils.getClassLoader(null));
}
项目:opendata-common    文件:HazelcastExtension.java   
public void beforeShutdown( @Observes BeforeShutdown type )
{
    if( provider != null ) {
        provider.close();
    }
}
项目:javaConfig    文件:ConfigExtension.java   
public void shutdown(@Observes BeforeShutdown bsd) {
    DefaultConfigProvider.instance().releaseConfig(config);
}
项目:johnzon    文件:JohnzonCdiExtension.java   
void cleanUp(@Observes final BeforeShutdown beforeShutdown) {
    canWrite = false;
    new ArrayList<>(jsonbs).forEach(this::untrack);
    jsonbs.clear();
}
项目:Java-EE    文件:LifeCycleLogger.java   
void logLifecycleEvent(@Observes BeforeShutdown event) {
    LOGGER.info("BeforeShutdown");
}
项目:deltaspike    文件:RepositoryExtension.java   
protected void cleanup(@Observes BeforeShutdown beforeShutdown)
{
    //we can reset it in any case,
    //because every application produced a copy as application-scoped bean (see RepositoryComponentsFactory)
    REPOSITORY_CLASSES.clear();
}
项目:deltaspike    文件:ViewConfigExtension.java   
public void freeViewConfigCache(@Observes BeforeShutdown bs)
{
    this.viewConfigResolver = null;
    this.transformed = false;
}