Search in sources :

Example 1 with AlertDetails

use of org.apache.geode.management.internal.AlertDetails in project geode by apache.

the class AlertListenerMessage method process.

@Override
public void process(DistributionManager dm) {
    RemoteGfManagerAgent agent = dm.getAgent();
    if (agent != null) {
        RemoteGemFireVM mgr = agent.getMemberById(this.getSender());
        if (mgr == null)
            return;
        Alert alert = new RemoteAlert(mgr, msgLevel, msgDate, connectionName, threadName, tid, msg, exceptionText, getSender());
        agent.callAlertListener(alert);
    } else {
        /**
       * Its assumed that its a managing node and it has to emit any alerts emitted to it.
       */
        AlertDetails alertDetail = new AlertDetails(msgLevel, msgDate, connectionName, threadName, tid, msg, exceptionText, getSender());
        dm.getSystem().handleResourceEvent(ResourceEvent.SYSTEM_ALERT, alertDetail);
    }
}
Also used : AlertDetails(org.apache.geode.management.internal.AlertDetails)

Example 2 with AlertDetails

use of org.apache.geode.management.internal.AlertDetails in project geode by apache.

the class ManagementListener method handleEvent.

/**
   * Handles various GFE resource life-cycle methods vis-a-vis Management and Monitoring
   * 
   * It checks for race conditions cases by calling shouldProceed();
   *
   * @param event Management event for which invocation has happened
   * @param resource the GFE resource type
   */
public void handleEvent(ResourceEvent event, Object resource) {
    if (!shouldProceed(event)) {
        return;
    }
    switch(event) {
        case CACHE_CREATE:
            InternalCache createdCache = (InternalCache) resource;
            adapter.handleCacheCreation(createdCache);
            break;
        case CACHE_REMOVE:
            InternalCache removedCache = (InternalCache) resource;
            adapter.handleCacheRemoval(removedCache);
            break;
        case REGION_CREATE:
            Region createdRegion = (Region) resource;
            adapter.handleRegionCreation(createdRegion);
            break;
        case REGION_REMOVE:
            Region removedRegion = (Region) resource;
            adapter.handleRegionRemoval(removedRegion);
            break;
        case DISKSTORE_CREATE:
            DiskStore createdDisk = (DiskStore) resource;
            adapter.handleDiskCreation(createdDisk);
            break;
        case DISKSTORE_REMOVE:
            DiskStore removedDisk = (DiskStore) resource;
            adapter.handleDiskRemoval(removedDisk);
            break;
        case GATEWAYRECEIVER_CREATE:
            GatewayReceiver createdRecv = (GatewayReceiver) resource;
            adapter.handleGatewayReceiverCreate(createdRecv);
            break;
        case GATEWAYRECEIVER_START:
            GatewayReceiver startedRecv = (GatewayReceiver) resource;
            adapter.handleGatewayReceiverStart(startedRecv);
            break;
        case GATEWAYRECEIVER_STOP:
            GatewayReceiver stoppededRecv = (GatewayReceiver) resource;
            adapter.handleGatewayReceiverStop(stoppededRecv);
            break;
        case GATEWAYSENDER_CREATE:
            GatewaySender sender = (GatewaySender) resource;
            adapter.handleGatewaySenderCreation(sender);
            break;
        case GATEWAYSENDER_START:
            GatewaySender startedSender = (GatewaySender) resource;
            adapter.handleGatewaySenderStart(startedSender);
            break;
        case GATEWAYSENDER_STOP:
            GatewaySender stoppedSender = (GatewaySender) resource;
            adapter.handleGatewaySenderStop(stoppedSender);
            break;
        case GATEWAYSENDER_PAUSE:
            GatewaySender pausedSender = (GatewaySender) resource;
            adapter.handleGatewaySenderPaused(pausedSender);
            break;
        case GATEWAYSENDER_RESUME:
            GatewaySender resumedSender = (GatewaySender) resource;
            adapter.handleGatewaySenderResumed(resumedSender);
            break;
        case LOCKSERVICE_CREATE:
            DLockService createdLockService = (DLockService) resource;
            adapter.handleLockServiceCreation(createdLockService);
            break;
        case LOCKSERVICE_REMOVE:
            DLockService removedLockService = (DLockService) resource;
            adapter.handleLockServiceRemoval(removedLockService);
            break;
        case MANAGER_CREATE:
            adapter.handleManagerCreation();
            break;
        case MANAGER_START:
            adapter.handleManagerStart();
            break;
        case MANAGER_STOP:
            adapter.handleManagerStop();
            break;
        case ASYNCEVENTQUEUE_CREATE:
            AsyncEventQueue queue = (AsyncEventQueue) resource;
            adapter.handleAsyncEventQueueCreation(queue);
            break;
        case ASYNCEVENTQUEUE_REMOVE:
            AsyncEventQueue removedQueue = (AsyncEventQueue) resource;
            adapter.handleAsyncEventQueueRemoval(removedQueue);
            break;
        case SYSTEM_ALERT:
            AlertDetails details = (AlertDetails) resource;
            adapter.handleSystemNotification(details);
            break;
        case CACHE_SERVER_START:
            CacheServer startedServer = (CacheServer) resource;
            adapter.handleCacheServerStart(startedServer);
            break;
        case CACHE_SERVER_STOP:
            CacheServer stoppedServer = (CacheServer) resource;
            adapter.handleCacheServerStop(stoppedServer);
            break;
        case LOCATOR_START:
            Locator loc = (Locator) resource;
            adapter.handleLocatorStart(loc);
            break;
        case CACHE_SERVICE_CREATE:
            CacheService service = (CacheService) resource;
            adapter.handleCacheServiceCreation(service);
            break;
        default:
            break;
    }
}
Also used : DiskStore(org.apache.geode.cache.DiskStore) GatewaySender(org.apache.geode.cache.wan.GatewaySender) Locator(org.apache.geode.distributed.Locator) AlertDetails(org.apache.geode.management.internal.AlertDetails) AsyncEventQueue(org.apache.geode.cache.asyncqueue.AsyncEventQueue) DLockService(org.apache.geode.distributed.internal.locks.DLockService) InternalCache(org.apache.geode.internal.cache.InternalCache) Region(org.apache.geode.cache.Region) GatewayReceiver(org.apache.geode.cache.wan.GatewayReceiver) CacheServer(org.apache.geode.cache.server.CacheServer) CacheService(org.apache.geode.internal.cache.CacheService)

Aggregations

AlertDetails (org.apache.geode.management.internal.AlertDetails)2 DiskStore (org.apache.geode.cache.DiskStore)1 Region (org.apache.geode.cache.Region)1 AsyncEventQueue (org.apache.geode.cache.asyncqueue.AsyncEventQueue)1 CacheServer (org.apache.geode.cache.server.CacheServer)1 GatewayReceiver (org.apache.geode.cache.wan.GatewayReceiver)1 GatewaySender (org.apache.geode.cache.wan.GatewaySender)1 Locator (org.apache.geode.distributed.Locator)1 DLockService (org.apache.geode.distributed.internal.locks.DLockService)1 CacheService (org.apache.geode.internal.cache.CacheService)1 InternalCache (org.apache.geode.internal.cache.InternalCache)1