Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.neo4j.kernel
Class KernelExtension<S>

    java.lang.Object
      org.neo4j.helpers.Service
          org.neo4j.kernel.KernelExtension<S>

Type Parameters:
  `S` - the Extension state type

    public abstract class KernelExtension<S>

extends Service

Hook for providing extended functionality to the Neo4j Graph Database kernel. Implementations of `KernelExtension` must fulfill the following contract:

- Must have a public no-arg constructor.
- The same instance must be able to load with multiple GraphDatabase kernels.
- Different instances should be able to access the same state from the same kernel.
  To achieve this, different instances of the same class should have the same `hashCode()` and be `equals(Object)`. This is enforced by this base class by delegating `hashCode()` and `equals(Object)` to the same methods on the `class object`.

The simplest way to implement an `extension` that fulfills this contract is if the `extension` implementation is stateless, and all state is kept in the state object returned by `the load method`. Note that for an `extension` to be considered loaded by the kernel, `the load method` may not return `null`. `The unload method` will only be invoked if the kernel considers the `extension` loaded.

Author:
  Tobias Ivarsson

Nested Class Summary

Nested classes/interfaces inherited from class org.neo4j.helpers.Service
`Service.CaseInsensitiveService, Service.Implementation`

Constructor Summary
`KernelExtension(String key)`

Method Summary
`protected Object` | `agentArgument(String agentArg)`
`protected S` | `agentLoad(KernelData kernel, Object param)`
`protected void` | `agentVisit(KernelData kernel, S state, Object param)`
`boolean` | `equals(Object obj)`
`protected S` | `getState(KernelData kernel)`
`int` | `hashCode()`
`protected boolean` | `isLoaded(KernelData kernel)`
`protected abstract S` | `load(KernelData kernel)` Load this extension for a particular Neo4j Kernel.
`protected void` | `loadAgent(KernelData kernel, Object param)`
`void` | `loadAgent(String agentArgs)`
`protected void` | `loadConfiguration(KernelData kernel)` Takes place before any data sources has been registered and is there to let extensions affect the configuration of other things starting up.
`protected void` | `unload(S state)`

Methods inherited from class org.neo4j.helpers.Service
`load, load, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### KernelExtension

    public KernelExtension(String key)

Method Detail

### hashCode

    public final int hashCode()

  Overrides:
    `hashCode` in class `Object`

### equals

    public final boolean equals(Object obj)

  Overrides:
    `equals` in class `Object`

### loadAgent

    public final void loadAgent(String agentArgs)

### loadAgent

    protected final void loadAgent(KernelData kernel,
                                   Object param)

### agentArgument

    protected Object agentArgument(String agentArg)

### load

    protected abstract S load(KernelData kernel)

  Load this extension for a particular Neo4j Kernel.

### agentLoad

    protected S agentLoad(KernelData kernel,
                          Object param)

### agentVisit

    protected void agentVisit(KernelData kernel,
                              S state,
                              Object param)

### loadConfiguration

    protected void loadConfiguration(KernelData kernel)

  Takes place before any data sources has been registered and is there to let extensions affect the configuration of other things starting up.

### unload

    protected void unload(S state)

### getState

    protected final S getState(KernelData kernel)

### isLoaded

    protected boolean isLoaded(KernelData kernel)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2011 The Neo4j Graph Database Project. All Rights Reserved.