Skip to content
Snippets Groups Projects
Commit a0b4d02a authored by Thomas Mortagne's avatar Thomas Mortagne
Browse files

[misc] Make sure to call listener which inject database mapping and other...

[misc] Make sure to call listener which inject database mapping and other ApplicationStartedEvent related tasks
parent eb08ffbf
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
import javax.inject.Singleton; import javax.inject.Singleton;
import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoExecutionException;
import org.hibernate.cfg.Environment;
import org.xwiki.component.annotation.Component; import org.xwiki.component.annotation.Component;
import org.xwiki.component.embed.EmbeddableComponentManager; import org.xwiki.component.embed.EmbeddableComponentManager;
import org.xwiki.component.manager.ComponentLookupException; import org.xwiki.component.manager.ComponentLookupException;
...@@ -38,6 +37,8 @@ ...@@ -38,6 +37,8 @@
import org.xwiki.context.ExecutionContextException; import org.xwiki.context.ExecutionContextException;
import org.xwiki.context.ExecutionContextManager; import org.xwiki.context.ExecutionContextManager;
import org.xwiki.model.reference.DocumentReference; import org.xwiki.model.reference.DocumentReference;
import org.xwiki.observation.ObservationManager;
import org.xwiki.observation.event.ApplicationStartedEvent;
import com.xpn.xwiki.XWiki; import com.xpn.xwiki.XWiki;
import com.xpn.xwiki.XWikiConfig; import com.xpn.xwiki.XWikiConfig;
...@@ -131,6 +132,15 @@ public static OldCoreHelper create(ComponentManager componentManager, String wik ...@@ -131,6 +132,15 @@ public static OldCoreHelper create(ComponentManager componentManager, String wik
throw new MojoExecutionException("Failed to get OldCoreHelper component", e); throw new MojoExecutionException("Failed to get OldCoreHelper component", e);
} }
// Give a chance to various listeners to register Hibernate mapping and other pre XWiki instance init actions
ObservationManager observation;
try {
observation = componentManager.getInstance(ObservationManager.class);
} catch (ComponentLookupException e) {
throw new MojoExecutionException("Failed to get lookup ObservationManager component", e);
}
observation.notify(new ApplicationStartedEvent(), null);
// Initialize OldCoreHelper // Initialize OldCoreHelper
try { try {
oldcoreHelper.initialize(wikiId, hibernateConfig); oldcoreHelper.initialize(wikiId, hibernateConfig);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment