Search in sources :

Example 31 with PreDestroy

use of javax.annotation.PreDestroy in project netvirt by opendaylight.

the class ElanDiagStatusProvider method close.

@PreDestroy
public void close() {
    serviceDescriptor = new ServiceDescriptor(ElanConstants.ELAN_SERVICE_NAME, ServiceState.UNREGISTERED, "Service Closed");
    diagStatusService.report(serviceDescriptor);
}
Also used : ServiceDescriptor(org.opendaylight.infrautils.diagstatus.ServiceDescriptor) PreDestroy(javax.annotation.PreDestroy)

Example 32 with PreDestroy

use of javax.annotation.PreDestroy in project joynr by bmwcarit.

the class JoynrIntegrationBean method destroy.

@PreDestroy
public void destroy() {
    if (deregisterOnShutdown) {
        for (Object provider : registeredProviders) {
            try {
                joynrRuntime.unregisterProvider(joynrRuntimeFactory.getLocalDomain(), provider);
            } catch (Exception e) {
                LOG.error("Error unregistering provider", e);
            }
        }
    }
    ShutdownNotifier shutdownNotifier = getJoynrInjector().getInstance(ShutdownNotifier.class);
    shutdownNotifier.shutdown();
}
Also used : ShutdownNotifier(io.joynr.runtime.ShutdownNotifier) PreDestroy(javax.annotation.PreDestroy)

Example 33 with PreDestroy

use of javax.annotation.PreDestroy in project camunda-bpm-platform by camunda.

the class EjbBpmPlatformBootstrap method stop.

@PreDestroy
protected void stop() {
    final RuntimeContainerDelegateImpl containerDelegate = getContainerDelegate();
    containerDelegate.getServiceContainer().createUndeploymentOperation("undeploying camunda BPM platform").addStep(new StopProcessApplicationsStep()).addStep(new StopProcessEnginesStep()).addStep(new StopJobExecutorStep()).addStep(new StopJcaExecutorServiceStep()).addStep(new UnregisterBpmPlatformPluginsStep()).execute();
    LOGGER.log(Level.INFO, "camunda BPM platform stopped.");
}
Also used : StopJobExecutorStep(org.camunda.bpm.container.impl.deployment.jobexecutor.StopJobExecutorStep) StopJcaExecutorServiceStep(org.camunda.bpm.container.impl.ejb.deployment.StopJcaExecutorServiceStep) StopProcessEnginesStep(org.camunda.bpm.container.impl.deployment.StopProcessEnginesStep) RuntimeContainerDelegateImpl(org.camunda.bpm.container.impl.RuntimeContainerDelegateImpl) StopProcessApplicationsStep(org.camunda.bpm.container.impl.deployment.StopProcessApplicationsStep) UnregisterBpmPlatformPluginsStep(org.camunda.bpm.container.impl.deployment.UnregisterBpmPlatformPluginsStep) PreDestroy(javax.annotation.PreDestroy)

Example 34 with PreDestroy

use of javax.annotation.PreDestroy in project iobserve-analysis by research-iobserve.

the class DeploymentInterceptor method preDestroy.

/**
 * Trigger event before container is undeployed.
 *
 * @param context
 *            invocation context with the container
 * @return result of the filter chain
 * @throws Exception
 *             on any internal error
 */
@PreDestroy
public Object preDestroy(final InvocationContext context) throws Exception {
    final Object result = context.proceed();
    if (this.monitoringCtrl.isMonitoringEnabled()) {
        final String signature = context.getTarget().getClass().getCanonicalName();
        // if (this.monitoringCtrl.isProbeActivated(signature)) {
        this.monitoringCtrl.newMonitoringRecord(new EJBUndeployedEvent(this.timeSource.getTime(), this.hostname, signature, this.deploymentId));
    // }
    }
    return result;
}
Also used : EJBUndeployedEvent(org.iobserve.common.record.EJBUndeployedEvent) PreDestroy(javax.annotation.PreDestroy)

Example 35 with PreDestroy

use of javax.annotation.PreDestroy in project pinpoint by naver.

the class JMXCollectorManager method tearDown.

@PreDestroy
public void tearDown() {
    logger.info("PinpointCollectorManager finalization started.");
    for (CollectorManager collectorManager : jmxCollectorManagerList.getSupportList()) {
        try {
            pinpointMBeanServer.unregisterMBean(collectorManager);
        } catch (Exception e) {
            logger.warn("Failed to unregister {} MBean.", collectorManager, e);
        }
    }
    logger.info("PinpointCollectorManager finalization completed.");
}
Also used : CollectorManager(com.navercorp.pinpoint.collector.manage.CollectorManager) PreDestroy(javax.annotation.PreDestroy)

Aggregations

PreDestroy (javax.annotation.PreDestroy)45 ServiceDescriptor (org.opendaylight.infrautils.diagstatus.ServiceDescriptor)4 File (java.io.File)3 ObjectName (javax.management.ObjectName)3 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2 PrestoException (com.facebook.presto.spi.PrestoException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 Method (java.lang.reflect.Method)2 Principal (java.security.Principal)2 JMException (javax.management.JMException)2 MBeanServer (javax.management.MBeanServer)2 InitialContext (javax.naming.InitialContext)2 Terminated (akka.actor.Terminated)1 DruidDataSource (com.alibaba.druid.pool.DruidDataSource)1 SqlTask.createSqlTask (com.facebook.presto.execution.SqlTask.createSqlTask)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 IAtomicLong (com.hazelcast.cp.IAtomicLong)1 CollectorManager (com.navercorp.pinpoint.collector.manage.CollectorManager)1 CommonState (com.navercorp.pinpoint.common.server.cluster.zookeeper.util.CommonState)1 Cache (com.publiccms.common.api.Cache)1