11-02-2016 04:40 PM
I'm working on installing Solr on an Alfresco 4.1.5 instance that was previously exclusively using Lucene.
As part of our existing customizations, we have a number of beans that extend Alfresco's DictionaryListener and execute Lucene queries onDictionaryInit. However, now with Solr, the beans are not bootstrapping properly because Solr does not allow for queries to be executed until the repository is fully initialized.
Is there any sort of analogous class to DictionaryListener, such as RepositoryListener, that would tell me when it is safe to execute queries? Alternatively, is there any sort of known paradigm to delay the initialization of these beans? I've played around with some wait() and sleep() functionality in a bean that my beans "depends-on" in my context, but the solution seems hacky and isn't working any way.
I also know that queries against the database can be executed during repository bootstrap- but those are only available starting in 4.2. Upgrading is an stretch option, but having to upgrade the repository and then modify a bunch of SearchService code isn't really practical for what is right now a simple proof-of-concept.
11-02-2016 09:28 PM
You can have several options to implement it
Option 1,check if there is a bean named “repositoryEndBootstrapBean” defined in alfresco\bootstrap-context.xml,if yes , You can try to set your bean depends-on "repositoryEndBootstrapBean".
Option 2 ,I think you can try to write a timer in your bean and execute your task once after a period that is long enough for alfresco to start.
11-02-2016 09:28 PM
You can have several options to implement it
Option 1,check if there is a bean named “repositoryEndBootstrapBean” defined in alfresco\bootstrap-context.xml,if yes , You can try to set your bean depends-on "repositoryEndBootstrapBean".
Option 2 ,I think you can try to write a timer in your bean and execute your task once after a period that is long enough for alfresco to start.
11-03-2016 10:02 AM
Thanks, that was exactly what I was looking for! It did exist on my 4.1.5 instance, but I don't see it on a 5.1.1 instance. Any idea why this might have been deprecated?
11-03-2016 10:07 AM
You mean bean repositoryEndBootstrapBean? it still exists in alfresco 5
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.