|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.neo4j.server.plugins.ServerPlugin
public abstract class ServerPlugin
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 calledMETA-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:
NodeRelationshipURI or URLIntegerLongShortByteCharacterBooleanDoubleFloatlists, 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 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. |
|
| Method Summary | |
|---|---|
protected Collection<PluginPoint> |
getDefaultExtensionPoints(org.neo4j.server.plugins.PluginPointFactory pluginPointFactory)
Loads the extension points of this server extension. |
protected void |
loadServerExtender(ServerExtender extender)
Loads the extension points of this server extension. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ServerPlugin(String name)
name - the name of this extension.public ServerPlugin()
ServerPlugin as the name for the extension.
| Method Detail |
|---|
public String toString()
toString in class Objectprotected void loadServerExtender(ServerExtender extender)
PluginPoint based on methods with the
PluginTarget annotation.
extender - the collection of PluginPoints for this
ServerPlugin.protected Collection<PluginPoint> getDefaultExtensionPoints(org.neo4j.server.plugins.PluginPointFactory pluginPointFactory)
PluginPoint based on methods with the
PluginTarget annotation.
PluginPoints for this
ServerPlugin.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||