Search in sources :

Example 6 with DeploymentEvent

use of org.apache.ignite.events.DeploymentEvent in project ignite by apache.

the class GridDeploymentLocalStore method recordUndeploy.

/**
     * Records undeploy event.
     *
     * @param dep Undeployed class loader.
     */
private void recordUndeploy(GridDeployment dep) {
    assert dep.undeployed();
    if (ctx.event().isRecordable(EVT_TASK_UNDEPLOYED) || ctx.event().isRecordable(EVT_CLASS_UNDEPLOYED)) {
        for (Class<?> cls : dep.deployedClasses()) {
            boolean isTask = isTask(cls);
            String msg = isTask ? "Task locally undeployed: " + cls : "Class locally undeployed: " + cls;
            if (ctx.event().isRecordable(isTask ? EVT_TASK_UNDEPLOYED : EVT_CLASS_UNDEPLOYED)) {
                DeploymentEvent evt = new DeploymentEvent();
                evt.message(msg);
                evt.node(ctx.discovery().localNode());
                evt.type(isTask ? EVT_TASK_UNDEPLOYED : EVT_CLASS_UNDEPLOYED);
                evt.alias(getAlias(dep, cls));
                ctx.event().record(evt);
            }
            if (log.isInfoEnabled())
                log.info(msg);
        }
    }
}
Also used : DeploymentEvent(org.apache.ignite.events.DeploymentEvent)

Aggregations

DeploymentEvent (org.apache.ignite.events.DeploymentEvent)6 URL (java.net.URL)3 CountDownLatch (java.util.concurrent.CountDownLatch)3 Ignite (org.apache.ignite.Ignite)3 Event (org.apache.ignite.events.Event)3 GridTestExternalClassLoader (org.apache.ignite.testframework.GridTestExternalClassLoader)3 ComputeTask (org.apache.ignite.compute.ComputeTask)1