Neo - Newton integration

From NeoWiki

Jump to: navigation, search

Contents

[edit] Goal

The goal of this integration is to expose Neo4j as a service in a Newton environment. There is now a first bundle that can be deplyed into Newton at https://svn.neo4j.org/laboratory/users/peter/neo4j-newton/, you need to deploy two Newton artifacts in order to get maven to build.

[edit] Building

[edit] Deploy the necessary Newton artifacts into your local maven repo

Download and unzip Newton (version 1.2.3) from here

export NEWTON_HOME=PATH_TO_NEWTON_INSTALLATION
cd $NEWTON_HOME

[edit] Deploy the cmd Newton bundle, the SDK cmd.jar, the Newton framework bundle and the SDK component-activator jar

mvn deploy:deploy-file -Durl=file:/Users/peter/.m2/repository/  -Dpackaging=jar -Dversion=1.2.3 -DgroupId=org.cauldron.newton  -DartifactId=cmd -Dfile=lib/core/bundles/org.cauldron.newton.cmd.jar

mvn deploy:deploy-file -Durl=file:/Users/peter/.m2/repository/  -Dpackaging=jar -Dversion=1.2.3 -DgroupId=org.cauldron.newton.sdk  -DartifactId=cmd -Dfile=sdk/lib/cmd.jar

mvn deploy:deploy-file -Durl=file:/Users/peter/.m2/repository/  -Dpackaging=jar -Dversion=1.2.3 -DgroupId=org.cauldron.newton  -DartifactId=framework -Dfile=lib/core/bundles/org.cauldron.newton.framework.jar 

mvn deploy:deploy-file -Durl=file:/Users/peter/.m2/repository/  -Dpackaging=jar -Dversion=1.2.3 -DgroupId=org.cauldron.newton  -DartifactId=component-activator -Dfile=sdk/lib/component-activator.jar 

[edit] Copy your neo service bundle to a convenient location for Newton to scan

cd $MY_CODE_LOCATION
svn co https://svn.neo4j.org/laboratory/users/peter/neo4j-newton/ neo4j-newton
cd neo4j-newton
mvn install
cp neo4j-newton-service/target/neo4j-newton-service-1.0.jar $NEWTON_HOME//demo/build/lib/
cp neo4j-newton-shellcommands/target/neo4j-newton-shellcommands-1.0-SNAPSHOT.jar $NEWTON_HOME//demo/build/lib/
</pre

===Start Newton ===
<pre>
cd $NEWTON_HOME
bin/container

[edit] Scan the bundles and install the neo4j-service bundle

> cds scan boot demo/build/lib

[edit] Deploy the bundles by pointing out the location of the composite XML files

> installer install file:/Users/peter/code/neo/laboratory/users/peter/neo4j-newton/neo4j-newton-service/neo4j-service.composite
> installer install file:/Users/peter/code/neo/laboratory/users/peter/neo4j-newton/neo4j-newton-shellcommands/neo4j-shellcommands.composite

You should be able to see the $NEWTON_HOME/target/neostore, created by the started Neo4j engine, and see the service registered with

>lsb -1
...

   87 --/resolved  org.cauldron.newton.presence.local.api
   88 --/resolved  org.cauldron.newton.presence.remote.api
   89 --/active    org.cauldron.newton.presence.service
   90 --/active    org.neo4j.newton.service
   91 --/active    org.neo4j.newton.shellcommands
> services 90
Bundle: org.neo4j.newton.service (#90)
  registered: NeoNewtonService
> services 91
Bundle: org.neo4j.newton.shellcommands (#91)
  registered: ConsoleCommandHandler

[edit] Use the "ls" command

> help
Available command groups (type 'enter' to enter a group):
system - commands for manipulating systems
storagecds - Commands for manipulating cds storage
sleep - sleeps for a configurable number of milliseconds
session - Session commands built into the console
provisioner - Commands for manipulating the provisioner
obr - OBR commands
ls - ls <node-id> lists the corresponding Neo4j node
logman - Commands for controlling logging within container
logconfig - Configuration commands for the log.
log - Log commands
installer - installs/uninstalls/tracks SCA components in this jvm
indexcds - Commands for manipulating the index service
framework - Framework commands
exec - executes a script from a file or url location
configuration - Configuration commands
cds - Commands for manipulating cds content
binder - Tools for introspecting the binding graph
> ls 0
got id: 0
[0:name=reference node,]
> 

Personal tools