Overview | Package | Class | Use | Tree | Deprecated | Index | Help

Neo4j Community
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.neo4j.graphdb.event
Interface KernelEventHandler

    public interface KernelEventHandler

Event handler interface for Neo4j Kernel life cycle events.

Author:
  Tobias Ivarsson

Nested Class Summary
`static class` | `KernelEventHandler.ExecutionOrder` Represents the order of execution between two event handlers, if one handler should be executed `KernelEventHandler.ExecutionOrder.BEFORE`, `KernelEventHandler.ExecutionOrder.AFTER` another handler, or if it `KernelEventHandler.ExecutionOrder.DOESNT_MATTER`.

Method Summary
`void` | `beforeShutdown()` This method is invoked during the shutdown process of a Neo4j Graph Database.
`Object` | `getResource()` Returns the resource associated with this event handler, or `null` if no specific resource is associated with this handler or if it isn't desirable to expose it.
`void` | `kernelPanic(ErrorState error)` This is invoked when the Neo4j Graph Database enters a state from which it cannot continue.
`KernelEventHandler.ExecutionOrder` | `orderComparedTo(KernelEventHandler other)` Gives a hint about when to execute this event handler, compared to other handlers.

Method Detail

### beforeShutdown

    void beforeShutdown()

  This method is invoked during the shutdown process of a Neo4j Graph Database. It is invoked while the `GraphDatabaseService` is still in an operating state, after the processing of this event has terminated the Neo4j Graph Database will terminate. This event can be used to shut down other services that depend on the `GraphDatabaseService`.

### kernelPanic

    void kernelPanic(ErrorState error)

  This is invoked when the Neo4j Graph Database enters a state from which it cannot continue.

  Parameters:
    `error` - an object describing the state that the `GraphDatabaseService` failed to recover from.

### getResource

    Object getResource()

  Returns the resource associated with this event handler, or `null` if no specific resource is associated with this handler or if it isn't desirable to expose it. It can be used to aid in the decision process of in which order to execute the handlers, see `orderComparedTo(KernelEventHandler)`.

  Returns:
    the resource associated to this event handler, or `null`.

### orderComparedTo

    KernelEventHandler.ExecutionOrder orderComparedTo(KernelEventHandler other)

  Gives a hint about when to execute this event handler, compared to other handlers. If this handler must be executed before `other` then `KernelEventHandler.ExecutionOrder.BEFORE` should be returned. If this handler must be executed after `other` then `KernelEventHandler.ExecutionOrder.AFTER` should be returned. If it doesn't matter `KernelEventHandler.ExecutionOrder.DOESNT_MATTER` should be returned.

  Parameters:
    `other` - the other event handler to compare to.
  Returns:
    the execution order compared to `other`.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

Neo4j Community
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2013 The Neo4j Graph Database Project. All Rights Reserved.