public abstract class ServerPlugin extends Object
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:
GraphDatabaseService
- a general extension
method to the serverNode
- an extension method for a nodeRelationship
- an extension method for a
relationship@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:
Node
Relationship
URI
or URL
Integer
Long
Short
Byte
Character
Boolean
Double
Float
lists
, sets
or arrays of any
of the above types.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.ServiceLoader
Constructor and Description |
---|
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.
|
public ServerPlugin(String name)
name
- the name of this extension.public ServerPlugin()
ServerPlugin
as the name for the extension.Copyright © 2002–2014 The Neo4j Graph Database Project. All rights reserved.