Skip to content

Commit

Permalink
improving readme
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianoalmeida7 committed Sep 20, 2011
1 parent cec2433 commit ae4a90e
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# VRaptor Neo4j Plugin

The VRaptor Neo4j plugin aims to bring to VRaptor smooth integration to Neo4j graph databases,
by providing out of the box transaction control, neo4j components dependency injection with other
components you might have and so on.
The VRaptor Neo4j plugin aims to bring to VRaptor smooth integration to Neo4j graph database,
by providing out of the box transaction control, Neo4j components dependency injection and easy
indexing framework access.

## How to use

You can enable the Neo4j VRaptor plugin by adding a context-param, that enables VRaptor to enable
the plugin. Just add to your web.xml file:
You can enable the Neo4j VRaptor plugin by adding a context-param to your web.xml file:

<context-param>
<param-name>br.com.caelum.vraptor.packages</param-name>
Expand All @@ -26,10 +25,9 @@ VRaptor will assume /tmp/database directory):

Now, VRaptor will enable 3 components:


### The Neo4jEmbeddedGraphDatabaseFactory

This ApplicationScoped component is responsible for the managing the EmbeddedGraphDatabase instance,
This ApplicationScoped component is responsible for manage and provide the EmbeddedGraphDatabase instance,
so you can receive it in your components by VRaptor's dependency injection, just like:

@Resource
Expand All @@ -47,13 +45,12 @@ so you can receive it in your components by VRaptor's dependency injection, just
}
}

Now, using the EmbeddedGraphDatabase instance is just as simple as declaring it in a component
constructor.
Now, using the EmbeddedGraphDatabase instance is just as simple as declaring it as a constructor argument.

### The Neo4jIndexManagerFactory

Similar to the EmbeddedGraphDatabaseFactory, the IndexManagerFactory makes possible to receive by
dependency injection the Neo4j index manager, with whom you can create new indexes, and search using
dependency injection the Neo4j Index Manager, with whom you can create new indexes, and search using
Neo4j Lucene's integration, for instance.

@Resource
Expand All @@ -76,8 +73,8 @@ Neo4j Lucene's integration, for instance.

### The Neo4jTransactionInterceptor

The TransactionInterceptor takes care of correctly beginning and committing or rolling back an
The TransactionInterceptor takes care of correctly beginning, committing and if necessary, rolling back a
Neo4j transaction. So, it is guaranteed that whenever you're creating a Node, the operation will
happen inside a transaction. The transaction opens on the beginning of each request and is committed
at the end of it. If a validation error or an exception occurs, the transaction is rolled back.
at the end of it. If a validation error or an exception occurs, the transaction is rolled back.

0 comments on commit ae4a90e

Please sign in to comment.