Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 9 files changed
  • 0 commit comments
  • 2 contributors
Commits on Feb 22, 2012
@tinwelint tinwelint * Restructuring to use DI, configuration interfaces, less setters/get…
…ters, removed unecessary lifecycle classes,

  added proper life cycle support for services and lots and lots of other cleanups.
* Main driver: Rickard Öberg
1268cb8
Commits on Mar 01, 2012
@dmontag Merge branch 'master' of github.com:neo4j/advanced into xamanager-mbean 2f228fb
@dmontag Updated test to work with recent refactoring. 7067565
View
2  management/src/main/java/org/neo4j/management/impl/CacheBean.java
@@ -43,7 +43,7 @@ public CacheBean()
protected Iterable<? extends Neo4jMBean> createMBeans( ManagementData management )
throws NotCompliantMBeanException
{
- NodeManager nm = management.getKernelData().getConfig().getGraphDbModule().getNodeManager();
+ NodeManager nm = management.getKernelData().graphDatabase().getNodeManager();
Collection<CacheManager> cacheBeans = new LinkedList<CacheBean.CacheManager>();
for ( Cache<?, ?> cache : nm.caches() )
{
View
4 management/src/main/java/org/neo4j/management/impl/DiagnosticsBean.java
@@ -55,8 +55,8 @@ protected Neo4jMBean createMBean( ManagementData management ) throws NotComplian
DiagnosticsImpl( ManagementData management ) throws NotCompliantMBeanException
{
super( management );
- this.diagnostics = management.getKernelData().getConfig().getDiagnosticsManager();
- this.log = (StringLogger) management.getKernelData().getConfig().getParams().get( StringLogger.class );
+ this.diagnostics = management.getKernelData().graphDatabase().getDiagnosticsManager();
+ this.log = management.getKernelData().graphDatabase().getMessageLog();
}
@Override
View
4 management/src/main/java/org/neo4j/management/impl/LockManagerBean.java
@@ -57,13 +57,13 @@ protected Neo4jMBean createMXBean( ManagementData management ) throws NotComplia
LockManagerImpl( ManagementData management ) throws NotCompliantMBeanException
{
super( management );
- this.lockManager = management.getKernelData().getConfig().getLockManager();
+ this.lockManager = management.getKernelData().graphDatabase().getLockManager();
}
LockManagerImpl( ManagementData management, boolean mxBean )
{
super( management, mxBean );
- this.lockManager = management.getKernelData().getConfig().getLockManager();
+ this.lockManager = management.getKernelData().graphDatabase().getLockManager();
}
public long getNumberOfAdvertedDeadlocks()
View
21 management/src/main/java/org/neo4j/management/impl/TransactionManagerBean.java
@@ -25,10 +25,8 @@
import org.neo4j.jmx.impl.ManagementBeanProvider;
import org.neo4j.jmx.impl.ManagementData;
import org.neo4j.jmx.impl.Neo4jMBean;
-import org.neo4j.kernel.Config;
import org.neo4j.kernel.impl.nioneo.store.NeoStore;
-import org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource;
-import org.neo4j.kernel.impl.transaction.TxModule;
+import org.neo4j.kernel.impl.transaction.TxManager;
import org.neo4j.management.TransactionManager;
@Service.Implementation( ManagementBeanProvider.class )
@@ -47,40 +45,39 @@ protected Neo4jMBean createMBean( ManagementData management ) throws NotComplian
private static class TransactionManagerImpl extends Neo4jMBean implements TransactionManager
{
- private final TxModule txModule;
+ private final TxManager txManager;
private final NeoStore neoStore;
TransactionManagerImpl( ManagementData management ) throws NotCompliantMBeanException
{
super( management );
- this.txModule = management.getKernelData().getConfig().getTxModule();
- this.neoStore = ( (NeoStoreXaDataSource) txModule.getXaDataSourceManager().getXaDataSource(
- Config.DEFAULT_DATA_SOURCE_NAME ) ).getNeoStore();
+ this.txManager = (TxManager) management.getKernelData().graphDatabase().getTxManager();
+ this.neoStore = management.getKernelData().graphDatabase().getXaDataSourceManager().getNeoStoreDataSource().getNeoStore();
}
public int getNumberOfOpenTransactions()
{
- return txModule.getActiveTxCount();
+ return txManager.getActiveTxCount();
}
public int getPeakNumberOfConcurrentTransactions()
{
- return txModule.getPeakConcurrentTxCount();
+ return txManager.getPeakConcurrentTxCount();
}
public int getNumberOfOpenedTransactions()
{
- return txModule.getStartedTxCount();
+ return txManager.getStartedTxCount();
}
public long getNumberOfCommittedTransactions()
{
- return txModule.getCommittedTxCount();
+ return txManager.getCommittedTxCount();
}
public long getNumberOfRolledBackTransactions()
{
- return txModule.getRolledbackTxCount();
+ return txManager.getRolledbackTxCount();
}
public long getLastCommittedTxId()
View
4 management/src/main/java/org/neo4j/management/impl/XaManagerBean.java
@@ -59,13 +59,13 @@ protected Neo4jMBean createMXBean( ManagementData management ) throws NotComplia
XaManagerImpl( ManagementData management ) throws NotCompliantMBeanException
{
super( management );
- this.datasourceMananger = management.getKernelData().getConfig().getTxModule().getXaDataSourceManager();
+ this.datasourceMananger = management.getKernelData().graphDatabase().getXaDataSourceManager();
}
XaManagerImpl( ManagementData management, boolean isMxBean )
{
super( management, isMxBean );
- this.datasourceMananger = management.getKernelData().getConfig().getTxModule().getXaDataSourceManager();
+ this.datasourceMananger = management.getKernelData().graphDatabase().getXaDataSourceManager();
}
public XaResourceInfo[] getXaResources()
View
8 management/src/test/java/org/neo4j/management/TestLockManagerBean.java
@@ -19,6 +19,10 @@
*/
package org.neo4j.management;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
import java.io.File;
import java.lang.Thread.State;
import java.util.Collection;
@@ -39,10 +43,6 @@
import org.neo4j.kernel.info.ResourceType;
import org.neo4j.kernel.info.WaitingThread;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
public class TestLockManagerBean
{
private LockManager lockManager;
View
9 management/src/test/java/org/neo4j/management/TestXaManagerBeans.java
@@ -26,8 +26,7 @@
import org.neo4j.kernel.EmbeddedGraphDatabase;
import org.neo4j.kernel.impl.transaction.xaframework.XaDataSource;
import org.neo4j.management.impl.XaManagerBean;
-
-import java.io.File;
+import org.neo4j.test.TargetDirectory;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -38,12 +37,12 @@
{
private AbstractGraphDatabase graphDb;
private XaManager xaManager;
+ private TargetDirectory dir = TargetDirectory.forTest( getClass() );
@Before
public synchronized void startGraphDb()
{
- graphDb = new EmbeddedGraphDatabase( "target" + File.separator + "var" + File.separator
- + ManagementBeansTest.class.getSimpleName() );
+ graphDb = new EmbeddedGraphDatabase( dir.directory( "test" ).getAbsolutePath() );
xaManager = graphDb.getSingleManagementBean( XaManager.class );
}
@@ -64,7 +63,7 @@ public void canAccessXaManagerBean() throws Exception
@Test
public void hasAllXaManagerBeans()
{
- for ( XaDataSource xaDataSource : graphDb.getConfig().getTxModule().getXaDataSourceManager().getAllRegisteredDataSources() )
+ for ( XaDataSource xaDataSource : graphDb.getXaDataSourceManager().getAllRegisteredDataSources() )
{
XaResourceInfo info = getByName( xaDataSource.getName() );
assertEquals( "wrong branchid for XA data source " + xaDataSource.getName(),
View
1  server-advanced/src/main/java/org/neo4j/server/advanced/AdvancedNeoServerBootstrapper.java
@@ -25,7 +25,6 @@
import javax.management.MBeanServer;
import javax.management.ObjectName;
-
import org.neo4j.server.NeoServerBootstrapper;
import org.neo4j.server.advanced.jmx.ServerManagement;
View
5 server-advanced/src/test/java/org/neo4j/server/advanced/BootstrapperTest.java
@@ -43,7 +43,6 @@
import java.io.File;
-
import org.junit.Test;
import org.neo4j.server.Bootstrapper;
import org.neo4j.server.advanced.jmx.ServerManagement;
@@ -60,14 +59,14 @@ public void shouldBeAbleToRestartServer() throws Exception
.createPropertiesFiles().getAbsolutePath() );
bs.start( null );
assertNotNull( bs.getServer().getDatabase().graph );
- assertEquals( dbDir1, bs.getServer().getDatabase().graph.getConfig().getParams().get( "store_dir" ) );
+ assertEquals( dbDir1, bs.getServer().getDatabase().graph.getStoreDir() );
String dbDir2 = new File("target/db2").getAbsolutePath();
System.setProperty( "org.neo4j.server.properties", ServerBuilder.server().usingDatabaseDir( dbDir2 )
.createPropertiesFiles().getAbsolutePath() );
ServerManagement bean = new ServerManagement( bs );
bean.restartServer();
- assertEquals( dbDir2, bs.getServer().getDatabase().graph.getConfig().getParams().get( "store_dir" ) );
+ assertEquals( dbDir2, bs.getServer().getDatabase().graph.getStoreDir() );
}
}

No commit comments for this range

Something went wrong with that request. Please try again.