Search in sources :

Example 6 with PreDestroy

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

the class ItmDiagStatusProvider method close.

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

Example 7 with PreDestroy

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

the class IfmDiagStatusProvider method close.

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

Example 8 with PreDestroy

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

the class DatastoreServiceStatusProvider method close.

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

Example 9 with PreDestroy

use of javax.annotation.PreDestroy in project eclipse.platform.runtime by eclipse.

the class EventObjectSupplier method dispose.

@SuppressWarnings("rawtypes")
@PreDestroy
public void dispose() {
    ServiceRegistration[] array;
    synchronized (registrations) {
        Collection<ServiceRegistration<EventHandler>> values = registrations.values();
        array = values.toArray(new ServiceRegistration[values.size()]);
        registrations.clear();
    }
    for (ServiceRegistration element : array) {
        element.unregister();
    }
}
Also used : ServiceRegistration(org.osgi.framework.ServiceRegistration) PreDestroy(javax.annotation.PreDestroy)

Example 10 with PreDestroy

use of javax.annotation.PreDestroy in project dataverse by IQSS.

the class ThemeWidgetFragment method cleanupTempDirectory.

@PreDestroy
public /**
 *  Cleanup by deleting temp directory and uploaded files
 */
void cleanupTempDirectory() {
    try {
        if (tempDir != null) {
            for (File f : tempDir.listFiles()) {
                Files.deleteIfExists(f.toPath());
            }
            Files.deleteIfExists(tempDir.toPath());
        }
    } catch (IOException e) {
        // improve error handling
        throw new RuntimeException("Error deleting temp directory", e);
    }
    uploadedFile = null;
    tempDir = null;
}
Also used : IOException(java.io.IOException) UploadedFile(org.primefaces.model.UploadedFile) File(java.io.File) 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