Neo4j Community

org.neo4j.kernel
Class AbstractGraphDatabase

java.lang.Object
  extended by org.neo4j.kernel.AbstractGraphDatabase
All Implemented Interfaces:
GraphDatabaseService, GraphDatabaseAPI
Direct Known Subclasses:
EmbeddedGraphDatabase, EmbeddedReadOnlyGraphDatabase

public abstract class AbstractGraphDatabase
extends Object
implements GraphDatabaseService, GraphDatabaseAPI

Exposes the methods getManagementBeans(Class)() a.s.o.


Nested Class Summary
static class AbstractGraphDatabase.Configuration
           
protected  class AbstractGraphDatabase.DefaultKernelData
           
 
Field Summary
protected  org.neo4j.kernel.impl.core.Caches caches
           
protected  Config config
           
protected  DiagnosticsManager diagnosticsManager
           
protected  KernelData extensions
           
protected  org.neo4j.kernel.impl.nioneo.store.FileSystemAbstraction fileSystem
           
protected  Guard guard
           
protected  IdGeneratorFactory idGeneratorFactory
           
protected  org.neo4j.kernel.IndexManagerImpl indexManager
           
protected  Iterable<IndexProvider> indexProviders
           
protected  org.neo4j.kernel.impl.index.IndexStore indexStore
           
protected  KernelEventHandlers kernelEventHandlers
           
protected  org.neo4j.kernel.impl.core.KernelPanicEventGenerator kernelPanicEventGenerator
           
protected  org.neo4j.kernel.impl.core.LastCommittedTxIdSetter lastCommittedTxIdSetter
           
protected  LifeSupport life
           
protected  org.neo4j.kernel.impl.transaction.LockManager lockManager
           
protected  org.neo4j.kernel.impl.core.LockReleaser lockReleaser
           
protected  org.neo4j.kernel.impl.transaction.xaframework.LogBufferFactory logBufferFactory
           
protected  Logging logging
           
protected  org.neo4j.kernel.impl.cache.MeasureDoNothing monitorGc
           
protected  org.neo4j.kernel.impl.util.StringLogger msgLog
           
protected  org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource neoDataSource
           
protected  org.neo4j.kernel.NodeAutoIndexerImpl nodeAutoIndexer
           
protected  org.neo4j.kernel.impl.core.NodeManager nodeManager
           
protected  Map<String,String> params
           
protected  org.neo4j.kernel.impl.persistence.PersistenceManager persistenceManager
           
protected  org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource persistenceSource
           
protected  org.neo4j.kernel.impl.core.PropertyIndexManager propertyIndexManager
           
protected  org.neo4j.kernel.impl.transaction.RagManager ragManager
           
protected  org.neo4j.kernel.impl.transaction.xaframework.RecoveryVerifier recoveryVerifier
           
protected  org.neo4j.kernel.impl.core.RelationshipTypeCreator relationshipTypeCreator
           
protected  org.neo4j.kernel.impl.core.RelationshipTypeHolder relationshipTypeHolder
           
protected  org.neo4j.kernel.RelationshipAutoIndexerImpl relAutoIndexer
           
protected  String storeDir
           
protected  org.neo4j.kernel.impl.nioneo.store.StoreFactory storeFactory
           
protected  org.neo4j.kernel.impl.nioneo.store.StoreId storeId
           
protected  org.neo4j.kernel.impl.core.TxEventSyncHookFactory syncHook
           
protected  TransactionEventHandlers transactionEventHandlers
           
protected  org.neo4j.kernel.impl.transaction.TxHook txHook
           
protected  org.neo4j.kernel.impl.transaction.xaframework.TxIdGenerator txIdGenerator
           
protected  org.neo4j.kernel.impl.transaction.AbstractTransactionManager txManager
           
protected  org.neo4j.kernel.impl.transaction.XaDataSourceManager xaDataSourceManager
           
protected  org.neo4j.kernel.impl.transaction.xaframework.XaFactory xaFactory
           
 
Constructor Summary
protected AbstractGraphDatabase(String storeDir, Map<String,String> params, Iterable<IndexProvider> indexProviders, Iterable<KernelExtension> kernelExtensions, Iterable<org.neo4j.kernel.impl.cache.CacheProvider> cacheProviders)
           
 
Method Summary
 Transaction beginTx()
          Starts a new transaction and associates it with the current thread.
protected  org.neo4j.kernel.impl.core.Caches createCaches()
           
protected  org.neo4j.kernel.impl.nioneo.store.FileSystemAbstraction createFileSystemAbstraction()
           
protected  IdGeneratorFactory createIdGeneratorFactory()
           
protected  KernelData createKernelData()
           
protected  org.neo4j.kernel.impl.core.LastCommittedTxIdSetter createLastCommittedTxIdSetter()
           
protected  org.neo4j.kernel.impl.transaction.LockManager createLockManager()
           
 Node createNode()
          Creates a new node.
protected  org.neo4j.kernel.impl.core.NodeProxy.NodeLookup createNodeLookup()
           
protected  org.neo4j.kernel.impl.transaction.xaframework.RecoveryVerifier createRecoveryVerifier()
           
protected  org.neo4j.kernel.impl.core.RelationshipProxy.RelationshipLookups createRelationshipLookups()
           
protected  org.neo4j.kernel.impl.core.RelationshipTypeCreator createRelationshipTypeCreator()
           
protected  org.neo4j.kernel.impl.nioneo.store.StoreFactory createStoreFactory()
           
protected  Logging createStringLogger()
           
protected  org.neo4j.kernel.impl.transaction.TxHook createTxHook()
           
protected  org.neo4j.kernel.impl.transaction.xaframework.TxIdGenerator createTxIdGenerator()
           
 boolean equals(Object o)
           
 Iterable<Node> getAllNodes()
          Returns all nodes in the graph.
 Config getConfig()
           
 DiagnosticsManager getDiagnosticsManager()
           
 Guard getGuard()
           
 IdGeneratorFactory getIdGeneratorFactory()
           
 KernelData getKernelData()
           
 org.neo4j.kernel.impl.core.KernelPanicEventGenerator getKernelPanicGenerator()
           
 org.neo4j.kernel.impl.transaction.LockManager getLockManager()
           
 org.neo4j.kernel.impl.core.LockReleaser getLockReleaser()
           
<T> T
getManagementBean(Class<T> type)
          Deprecated. since Neo4j may now have multiple beans implementing the same bean interface, this method has been deprecated in favor of getSingleManagementBean(Class) and getManagementBeans(Class) . Version 1.5 of Neo4j will be the last version to contain this method.
<T> Collection<T>
getManagementBeans(Class<T> beanClass)
           
 org.neo4j.kernel.impl.util.StringLogger getMessageLog()
           
 Node getNodeById(long id)
          Looks up a node by id.
 org.neo4j.kernel.impl.core.NodeManager getNodeManager()
           
 org.neo4j.kernel.impl.persistence.PersistenceSource getPersistenceSource()
           
 Node getReferenceNode()
          Returns the reference node, which is a "starting point" in the node space.
 Relationship getRelationshipById(long id)
          Looks up a relationship by id.
 org.neo4j.kernel.impl.core.RelationshipTypeHolder getRelationshipTypeHolder()
           
 Iterable<RelationshipType> getRelationshipTypes()
          Returns all relationship types currently in the underlying store.
<T> T
getSingleManagementBean(Class<T> type)
           
 String getStoreDir()
           
 org.neo4j.kernel.impl.nioneo.store.StoreId getStoreId()
           
 TransactionManager getTxManager()
           
 org.neo4j.kernel.impl.transaction.XaDataSourceManager getXaDataSourceManager()
           
 int hashCode()
           
 IndexManager index()
          Returns the IndexManager paired with this graph database service and is the entry point for managing indexes coupled with this database.
protected  boolean isEphemeral()
           
 KernelEventHandler registerKernelEventHandler(KernelEventHandler handler)
          Registers handler as a handler for kernel events which are generated from different places in the lifecycle of the kernel.
<T> TransactionEventHandler<T>
registerTransactionEventHandler(TransactionEventHandler<T> handler)
          Registers handler as a handler for transaction events which are generated from different places in the lifecycle of each transaction.
protected  void run()
           
 void shutdown()
          Shuts down Neo4j.
 String toString()
           
 boolean transactionRunning()
           
 TransactionBuilder tx()
           
 KernelEventHandler unregisterKernelEventHandler(KernelEventHandler handler)
          Unregisters handler from the list of kernel event handlers.
<T> TransactionEventHandler<T>
unregisterTransactionEventHandler(TransactionEventHandler<T> handler)
          Unregisters handler from the list of transaction event handlers.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

storeDir

protected String storeDir

params

protected Map<String,String> params

storeId

protected org.neo4j.kernel.impl.nioneo.store.StoreId storeId

logging

protected Logging logging

msgLog

protected org.neo4j.kernel.impl.util.StringLogger msgLog

kernelEventHandlers

protected KernelEventHandlers kernelEventHandlers

transactionEventHandlers

protected TransactionEventHandlers transactionEventHandlers

relationshipTypeHolder

protected org.neo4j.kernel.impl.core.RelationshipTypeHolder relationshipTypeHolder

nodeManager

protected org.neo4j.kernel.impl.core.NodeManager nodeManager

indexProviders

protected Iterable<IndexProvider> indexProviders

indexManager

protected org.neo4j.kernel.IndexManagerImpl indexManager

config

protected Config config

kernelPanicEventGenerator

protected org.neo4j.kernel.impl.core.KernelPanicEventGenerator kernelPanicEventGenerator

txHook

protected org.neo4j.kernel.impl.transaction.TxHook txHook

fileSystem

protected org.neo4j.kernel.impl.nioneo.store.FileSystemAbstraction fileSystem

xaDataSourceManager

protected org.neo4j.kernel.impl.transaction.XaDataSourceManager xaDataSourceManager

ragManager

protected org.neo4j.kernel.impl.transaction.RagManager ragManager

lockManager

protected org.neo4j.kernel.impl.transaction.LockManager lockManager

idGeneratorFactory

protected IdGeneratorFactory idGeneratorFactory

relationshipTypeCreator

protected org.neo4j.kernel.impl.core.RelationshipTypeCreator relationshipTypeCreator

lastCommittedTxIdSetter

protected org.neo4j.kernel.impl.core.LastCommittedTxIdSetter lastCommittedTxIdSetter

persistenceSource

protected org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource persistenceSource

syncHook

protected org.neo4j.kernel.impl.core.TxEventSyncHookFactory syncHook

persistenceManager

protected org.neo4j.kernel.impl.persistence.PersistenceManager persistenceManager

propertyIndexManager

protected org.neo4j.kernel.impl.core.PropertyIndexManager propertyIndexManager

lockReleaser

protected org.neo4j.kernel.impl.core.LockReleaser lockReleaser

indexStore

protected org.neo4j.kernel.impl.index.IndexStore indexStore

logBufferFactory

protected org.neo4j.kernel.impl.transaction.xaframework.LogBufferFactory logBufferFactory

txManager

protected org.neo4j.kernel.impl.transaction.AbstractTransactionManager txManager

txIdGenerator

protected org.neo4j.kernel.impl.transaction.xaframework.TxIdGenerator txIdGenerator

storeFactory

protected org.neo4j.kernel.impl.nioneo.store.StoreFactory storeFactory

xaFactory

protected org.neo4j.kernel.impl.transaction.xaframework.XaFactory xaFactory

diagnosticsManager

protected DiagnosticsManager diagnosticsManager

neoDataSource

protected org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource neoDataSource

recoveryVerifier

protected org.neo4j.kernel.impl.transaction.xaframework.RecoveryVerifier recoveryVerifier

guard

protected Guard guard

monitorGc

protected org.neo4j.kernel.impl.cache.MeasureDoNothing monitorGc

nodeAutoIndexer

protected org.neo4j.kernel.NodeAutoIndexerImpl nodeAutoIndexer

relAutoIndexer

protected org.neo4j.kernel.RelationshipAutoIndexerImpl relAutoIndexer

extensions

protected KernelData extensions

caches

protected org.neo4j.kernel.impl.core.Caches caches

life

protected final LifeSupport life
Constructor Detail

AbstractGraphDatabase

protected AbstractGraphDatabase(String storeDir,
                                Map<String,String> params,
                                Iterable<IndexProvider> indexProviders,
                                Iterable<KernelExtension> kernelExtensions,
                                Iterable<org.neo4j.kernel.impl.cache.CacheProvider> cacheProviders)
Method Detail

run

protected void run()

createRelationshipTypeCreator

protected org.neo4j.kernel.impl.core.RelationshipTypeCreator createRelationshipTypeCreator()

shutdown

public void shutdown()
Description copied from interface: GraphDatabaseService
Shuts down Neo4j. After this method has been invoked, it's invalid to invoke any methods in the Neo4j API and all references to this instance of GraphDatabaseService should be discarded.

Specified by:
shutdown in interface GraphDatabaseService

createStoreFactory

protected org.neo4j.kernel.impl.nioneo.store.StoreFactory createStoreFactory()

createRecoveryVerifier

protected org.neo4j.kernel.impl.transaction.xaframework.RecoveryVerifier createRecoveryVerifier()

createKernelData

protected KernelData createKernelData()

createLastCommittedTxIdSetter

protected org.neo4j.kernel.impl.core.LastCommittedTxIdSetter createLastCommittedTxIdSetter()

createTxIdGenerator

protected org.neo4j.kernel.impl.transaction.xaframework.TxIdGenerator createTxIdGenerator()

createCaches

protected org.neo4j.kernel.impl.core.Caches createCaches()

createRelationshipLookups

protected org.neo4j.kernel.impl.core.RelationshipProxy.RelationshipLookups createRelationshipLookups()

createNodeLookup

protected org.neo4j.kernel.impl.core.NodeProxy.NodeLookup createNodeLookup()

createTxHook

protected org.neo4j.kernel.impl.transaction.TxHook createTxHook()

createFileSystemAbstraction

protected org.neo4j.kernel.impl.nioneo.store.FileSystemAbstraction createFileSystemAbstraction()

createIdGeneratorFactory

protected IdGeneratorFactory createIdGeneratorFactory()

createLockManager

protected org.neo4j.kernel.impl.transaction.LockManager createLockManager()

createStringLogger

protected Logging createStringLogger()

getStoreDir

public final String getStoreDir()
Specified by:
getStoreDir in interface GraphDatabaseAPI

getStoreId

public org.neo4j.kernel.impl.nioneo.store.StoreId getStoreId()

beginTx

public Transaction beginTx()
Description copied from interface: GraphDatabaseService
Starts a new transaction and associates it with the current thread.

Specified by:
beginTx in interface GraphDatabaseService
Returns:
a new transaction instance

transactionRunning

public boolean transactionRunning()

getManagementBean

@Deprecated
public final <T> T getManagementBean(Class<T> type)
Deprecated. since Neo4j may now have multiple beans implementing the same bean interface, this method has been deprecated in favor of getSingleManagementBean(Class) and getManagementBeans(Class) . Version 1.5 of Neo4j will be the last version to contain this method.

Get a single management bean. Delegates to getSingleManagementBean(Class).


getSingleManagementBean

public final <T> T getSingleManagementBean(Class<T> type)
Specified by:
getSingleManagementBean in interface GraphDatabaseAPI

isEphemeral

protected boolean isEphemeral()

toString

public String toString()
Overrides:
toString in class Object

getAllNodes

public Iterable<Node> getAllNodes()
Description copied from interface: GraphDatabaseService
Returns all nodes in the graph.

Specified by:
getAllNodes in interface GraphDatabaseService
Returns:
all nodes in the graph.

getRelationshipTypes

public Iterable<RelationshipType> getRelationshipTypes()
Description copied from interface: GraphDatabaseService
Returns all relationship types currently in the underlying store. Relationship types are added to the underlying store the first time they are used in a successfully commited node.createRelationshipTo(...). Note that this method is guaranteed to return all known relationship types, but it does not guarantee that it won't return more than that (e.g. it can return "historic" relationship types that no longer have any relationships in the node space).

Specified by:
getRelationshipTypes in interface GraphDatabaseService
Returns:
all relationship types in the underlying store

registerKernelEventHandler

public KernelEventHandler registerKernelEventHandler(KernelEventHandler handler)
Description copied from interface: GraphDatabaseService
Registers handler as a handler for kernel events which are generated from different places in the lifecycle of the kernel. To guarantee proper behaviour the handler should be registered right after the graph database has been started. If the specified handler instance has already been registered this method will do nothing.

Specified by:
registerKernelEventHandler in interface GraphDatabaseService
Parameters:
handler - the handler to receive events about different states in the kernel lifecycle.
Returns:
the handler passed in as the argument.

registerTransactionEventHandler

public <T> TransactionEventHandler<T> registerTransactionEventHandler(TransactionEventHandler<T> handler)
Description copied from interface: GraphDatabaseService
Registers handler as a handler for transaction events which are generated from different places in the lifecycle of each transaction. To guarantee that the handler gets all events properly it shouldn't be registered when the application is running (i.e. in the middle of one or more transactions). If the specified handler instance has already been registered this method will do nothing.

Specified by:
registerTransactionEventHandler in interface GraphDatabaseService
Type Parameters:
T - the type of state object used in the handler, see more documentation about it at TransactionEventHandler.
Parameters:
handler - the handler to receive events about different states in transaction lifecycles.
Returns:
the handler passed in as the argument.

unregisterKernelEventHandler

public KernelEventHandler unregisterKernelEventHandler(KernelEventHandler handler)
Description copied from interface: GraphDatabaseService
Unregisters handler from the list of kernel event handlers. If handler hasn't been registered with GraphDatabaseService.registerKernelEventHandler(KernelEventHandler) prior to calling this method an IllegalStateException will be thrown. After a successful call to this method the handler will no longer receive any kernel events.

Specified by:
unregisterKernelEventHandler in interface GraphDatabaseService
Parameters:
handler - the handler to receive events about different states in the kernel lifecycle.
Returns:
the handler passed in as the argument.

unregisterTransactionEventHandler

public <T> TransactionEventHandler<T> unregisterTransactionEventHandler(TransactionEventHandler<T> handler)
Description copied from interface: GraphDatabaseService
Unregisters handler from the list of transaction event handlers. If handler hasn't been registered with GraphDatabaseService.registerTransactionEventHandler(TransactionEventHandler) prior to calling this method an IllegalStateException will be thrown. After a successful call to this method the handler will no longer receive any transaction events.

Specified by:
unregisterTransactionEventHandler in interface GraphDatabaseService
Type Parameters:
T - the type of state object used in the handler, see more documentation about it at TransactionEventHandler.
Parameters:
handler - the handler to receive events about different states in transaction lifecycles.
Returns:
the handler passed in as the argument.

createNode

public Node createNode()
Description copied from interface: GraphDatabaseService
Creates a new node.

Specified by:
createNode in interface GraphDatabaseService
Returns:
the created node.

getNodeById

public Node getNodeById(long id)
Description copied from interface: GraphDatabaseService
Looks up a node by id.

Specified by:
getNodeById in interface GraphDatabaseService
Parameters:
id - the id of the node
Returns:
the node with id id if found

getRelationshipById

public Relationship getRelationshipById(long id)
Description copied from interface: GraphDatabaseService
Looks up a relationship by id.

Specified by:
getRelationshipById in interface GraphDatabaseService
Parameters:
id - the id of the relationship
Returns:
the relationship with id id if found

getReferenceNode

public Node getReferenceNode()
Description copied from interface: GraphDatabaseService
Returns the reference node, which is a "starting point" in the node space. Usually, a client attaches relationships to this node that leads into various parts of the node space. For more information about common node space organizational patterns, see the design guide at wiki.neo4j.org/content/Design_Guide.

Specified by:
getReferenceNode in interface GraphDatabaseService
Returns:
the reference node

tx

public TransactionBuilder tx()
Specified by:
tx in interface GraphDatabaseAPI

getGuard

public Guard getGuard()
Specified by:
getGuard in interface GraphDatabaseAPI

getManagementBeans

public <T> Collection<T> getManagementBeans(Class<T> beanClass)
Specified by:
getManagementBeans in interface GraphDatabaseAPI

getKernelData

public KernelData getKernelData()
Specified by:
getKernelData in interface GraphDatabaseAPI

index

public IndexManager index()
Description copied from interface: GraphDatabaseService
Returns the IndexManager paired with this graph database service and is the entry point for managing indexes coupled with this database.

Specified by:
index in interface GraphDatabaseService
Returns:
the IndexManager for this database.

getConfig

public Config getConfig()

getNodeManager

public org.neo4j.kernel.impl.core.NodeManager getNodeManager()
Specified by:
getNodeManager in interface GraphDatabaseAPI

getLockReleaser

public org.neo4j.kernel.impl.core.LockReleaser getLockReleaser()
Specified by:
getLockReleaser in interface GraphDatabaseAPI

getLockManager

public org.neo4j.kernel.impl.transaction.LockManager getLockManager()
Specified by:
getLockManager in interface GraphDatabaseAPI

getXaDataSourceManager

public org.neo4j.kernel.impl.transaction.XaDataSourceManager getXaDataSourceManager()
Specified by:
getXaDataSourceManager in interface GraphDatabaseAPI

getTxManager

public TransactionManager getTxManager()
Specified by:
getTxManager in interface GraphDatabaseAPI

getRelationshipTypeHolder

public org.neo4j.kernel.impl.core.RelationshipTypeHolder getRelationshipTypeHolder()
Specified by:
getRelationshipTypeHolder in interface GraphDatabaseAPI

getIdGeneratorFactory

public IdGeneratorFactory getIdGeneratorFactory()
Specified by:
getIdGeneratorFactory in interface GraphDatabaseAPI

getDiagnosticsManager

public DiagnosticsManager getDiagnosticsManager()
Specified by:
getDiagnosticsManager in interface GraphDatabaseAPI

getPersistenceSource

public org.neo4j.kernel.impl.persistence.PersistenceSource getPersistenceSource()
Specified by:
getPersistenceSource in interface GraphDatabaseAPI

getMessageLog

public final org.neo4j.kernel.impl.util.StringLogger getMessageLog()
Specified by:
getMessageLog in interface GraphDatabaseAPI

getKernelPanicGenerator

public org.neo4j.kernel.impl.core.KernelPanicEventGenerator getKernelPanicGenerator()
Specified by:
getKernelPanicGenerator in interface GraphDatabaseAPI

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

Neo4j Community

Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.