public static void killRepository( JcrRepository repository ) { if (repository == null || repository.getState() != State.RUNNING) return; try { // Rollback any open transactions ... killTransaction(repository.runningState().txnManager()); // First shut down the repository ... repository.doShutdown(false); } catch (Throwable t) { log.error(t, JcrI18n.errorKillingRepository, repository.getName(), t.getMessage()); } }
this.documentStore = other.documentStore; this.txMgrLookup = other.txMgrLookup; this.txnMgr = other.txnManager(); this.transactions = other.transactions;
this.documentStore = other.documentStore; this.txMgrLookup = other.txMgrLookup; this.txnMgr = other.txnManager(); this.transactions = other.transactions;
protected void initializeConnector( Connector connector, NamespaceRegistry registry, org.modeshape.jcr.api.nodetype.NodeTypeManager nodeTypeManager ) throws IOException, RepositoryException { // Set the execution context instance ... Reflection.setValue(connector, "context", repository.context()); // Set the execution context instance ... Reflection.setValue(connector, "translator", getDocumentTranslator()); // Set the MIME type detector ... Reflection.setValue(connector, "mimeTypeDetector", repository.mimeTypeDetector()); // Set the transaction manager Reflection.setValue(connector, "transactionManager", repository.txnManager()); // Set the ConnectorChangedSet factory Reflection.setValue(connector, "connectorChangedSetFactory", createConnectorChangedSetFactory(connector)); // Set the Environment Reflection.setValue(connector, "environment", repository.environment()); // Set the ExtraPropertiesStore instance, which is unique to this connector ... LocalDocumentStore store = repository.documentStore().localStore(); String name = connector.getSourceName(); String sourceKey = NodeKey.keyForSourceName(name); DocumentTranslator translator = getDocumentTranslator(); ExtraPropertiesStore defaultExtraPropertiesStore = new LocalDocumentStoreExtraProperties(store, sourceKey, translator); Reflection.setValue(connector, "extraPropertiesStore", defaultExtraPropertiesStore); connector.initialize(registry, nodeTypeManager); // If successful, call the 'postInitialize' method reflectively (due to inability to call directly) ... Method postInitialize = Reflection.findMethod(Connector.class, "postInitialize"); Reflection.invokeAccessibly(connector, postInitialize, new Object[] {}); }
protected void initializeConnector( Connector connector, NamespaceRegistry registry, org.modeshape.jcr.api.nodetype.NodeTypeManager nodeTypeManager ) throws IOException, RepositoryException { // Set the execution context instance ... Reflection.setValue(connector, "context", repository.context()); // Set the execution context instance ... Reflection.setValue(connector, "translator", getDocumentTranslator()); // Set the MIME type detector ... Reflection.setValue(connector, "mimeTypeDetector", repository.mimeTypeDetector()); // Set the transaction manager Reflection.setValue(connector, "transactionManager", repository.txnManager()); // Set the ConnectorChangedSet factory Reflection.setValue(connector, "connectorChangedSetFactory", createConnectorChangedSetFactory(connector)); // Set the Environment Reflection.setValue(connector, "environment", repository.environment()); // Set the ExtraPropertiesStore instance, which is unique to this connector ... LocalDocumentStore store = repository.documentStore().localStore(); String name = connector.getSourceName(); String sourceKey = NodeKey.keyForSourceName(name); DocumentTranslator translator = getDocumentTranslator(); ExtraPropertiesStore defaultExtraPropertiesStore = new LocalDocumentStoreExtraProperties(store, sourceKey, translator); Reflection.setValue(connector, "extraPropertiesStore", defaultExtraPropertiesStore); connector.initialize(registry, nodeTypeManager); // If successful, call the 'postInitialize' method reflectively (due to inability to call directly) ... Method postInitialize = Reflection.findMethod(Connector.class, "postInitialize"); Reflection.invokeAccessibly(connector, postInitialize, new Object[] {}); }
protected final TransactionManager transactionManager() { return runningState().txnManager(); }
protected final TransactionManager transactionManager() { return runningState().txnManager(); }
@Override @Before public void beforeEach() throws Exception { startRepositoryWithConfigurationFrom("config/repo-config-concurrent-tests.json"); tools = new JcrTools(); // Set the transaction timeout so that we can debug code called within the transaction ... repository.runningState().txnManager().setTransactionTimeout(500); }