org.neo4j.server.plugins
Class ServerPlugin
java.lang.Object
org.neo4j.server.plugins.ServerPlugin
public abstract class ServerPlugin
- extends Object
API for creating extensions for the Neo4j server.
Extensions are created by creating a subclass of this class. The subclass
should have a public no-argument constructor. Then place this class in a
jar-file that contains a file called
META-INF/services/org.neo4j.server.plugins.ServerPlugin
.
This file should contain the fully qualified name of the class that extends
ServerPlugin
, e.g. com.example.MyNeo4jServerExtension
on a single line. If the jar contains multiple extensions to the Neo4j
server, this file should contain the fully qualified class names of all
extension classes, each class name on its own line in the file. When the jar
file is placed on the class path of the server, it will be loaded
automatically when the server starts.
The easiest way to implement Neo4j server extensions is by defining public
methods on the extension class annotated with
@PluginTarget
. The parameter for the
PluginTarget
annotation should be the class representing the
entity that the method extends. The entities that can be extended are
currently:
You can then use the @Source
annotation on one parameter of the method to get
the instance that was extended. Additional parameters needs to be of a
supported type, and annotated with the @Parameter
annotation specifying the name by which the
parameter is passed from the client. The supported parameter types are:
All exceptions thrown by an PluginTarget
method are treated as
server errors, unless the method has declared the ability to throw such an
exception, in that case the exception is treated as a bad request and
propagated to the invoking client.
- Author:
- Tobias Ivarsson
- See Also:
ServiceLoader
Constructor Summary |
ServerPlugin()
Create a server extension using the simple name of the concrete class
that extends ServerPlugin as the name for the extension. |
ServerPlugin(String name)
Create a server extension with the specified name. |
ServerPlugin
public ServerPlugin(String name)
- Create a server extension with the specified name.
- Parameters:
name
- the name of this extension.
ServerPlugin
public ServerPlugin()
- Create a server extension using the simple name of the concrete class
that extends
ServerPlugin
as the name for the extension.
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2002-2014 The Neo4j Graph Database Project. All Rights Reserved.