23
23
*/
24
24
package org .hibernate .search .hcore .impl ;
25
25
26
- import org .jboss .logging .Logger ;
27
-
28
- import org .hibernate .AnnotationException ;
26
+ import org .hibernate .cfg .Configuration ;
29
27
import org .hibernate .engine .spi .SessionFactoryImplementor ;
28
+ import org .hibernate .event .service .spi .DuplicationStrategy ;
29
+ import org .hibernate .event .service .spi .EventListenerRegistry ;
30
30
import org .hibernate .event .spi .EventType ;
31
- import org .hibernate .event .spi .PostCollectionRemoveEventListener ;
32
- import org .hibernate .event .spi .PostCollectionUpdateEventListener ;
33
- import org .hibernate .event .spi .PostDeleteEventListener ;
34
- import org .hibernate .event .spi .PostInsertEventListener ;
35
- import org .hibernate .internal .CoreMessageLogger ;
36
- import org .hibernate .cfg .Configuration ;
37
- import org .hibernate .event .spi .PostCollectionRecreateEventListener ;
38
- import org .hibernate .event .spi .PostUpdateEventListener ;
39
31
import org .hibernate .integrator .spi .Integrator ;
40
32
import org .hibernate .internal .util .config .ConfigurationHelper ;
41
33
import org .hibernate .search .event .impl .FullTextIndexEventListener ;
42
34
import org .hibernate .search .util .logging .impl .Log ;
43
35
import org .hibernate .search .util .logging .impl .LoggerFactory ;
44
- import org .hibernate .service .classloading .spi .ClassLoaderService ;
45
- import org .hibernate .event .service .spi .DuplicationStrategy ;
46
- import org .hibernate .event .service .spi .EventListenerRegistry ;
47
36
import org .hibernate .service .spi .SessionFactoryServiceRegistry ;
48
37
49
38
/**
54
43
* @author Steve Ebersole
55
44
*/
56
45
public class HibernateSearchIntegrator implements Integrator {
57
- private static final Log log = LoggerFactory .make ();
58
- public static final String AUTO_REGISTER = "hibernate.search.autoregister_listeners" ;
59
46
60
- private FullTextIndexEventListener listener ;
47
+ private static final Log log = LoggerFactory .make ();
48
+ public static final String AUTO_REGISTER = "hibernate.search.autoregister_listeners" ;
49
+
50
+ private FullTextIndexEventListener listener ;
61
51
62
52
@ Override
63
53
public void integrate (
@@ -70,10 +60,10 @@ public void integrate(
70
60
return ;
71
61
}
72
62
73
- listener = new FullTextIndexEventListener (FullTextIndexEventListener .Installation .SINGLE_INSTANCE );
63
+ listener = new FullTextIndexEventListener (FullTextIndexEventListener .Installation .SINGLE_INSTANCE );
74
64
75
65
EventListenerRegistry listenerRegistry = serviceRegistry .getService ( EventListenerRegistry .class );
76
- //TODO if the event is duplicated, do not initialize the newly created listener
66
+ //TODO if the event is duplicated, do not initialize the newly created listener
77
67
listenerRegistry .addDuplicationStrategy ( new DuplicationStrategyImpl ( FullTextIndexEventListener .class ) );
78
68
79
69
listenerRegistry .getEventListenerGroup ( EventType .POST_INSERT ).appendListener ( listener );
@@ -82,9 +72,9 @@ public void integrate(
82
72
listenerRegistry .getEventListenerGroup ( EventType .POST_COLLECTION_RECREATE ).appendListener ( listener );
83
73
listenerRegistry .getEventListenerGroup ( EventType .POST_COLLECTION_REMOVE ).appendListener ( listener );
84
74
listenerRegistry .getEventListenerGroup ( EventType .POST_COLLECTION_UPDATE ).appendListener ( listener );
85
- listenerRegistry .getEventListenerGroup ( EventType .FLUSH ).appendListener ( listener );
75
+ listenerRegistry .getEventListenerGroup ( EventType .FLUSH ).appendListener ( listener );
86
76
87
- listener .initialize (configuration );
77
+ listener .initialize (configuration );
88
78
}
89
79
90
80
public static class DuplicationStrategyImpl implements DuplicationStrategy {
0 commit comments