Author: sannegrinovero
Date: 2008-11-25 12:56:50 -0500 (Tue, 25 Nov 2008)
New Revision: 15616
Modified:
search/trunk/src/java/org/hibernate/search/backend/BackendQueueProcessorFactory.java
search/trunk/src/java/org/hibernate/search/backend/impl/jms/JMSBackendQueueProcessorFactory.java
search/trunk/src/java/org/hibernate/search/backend/impl/lucene/LuceneBackendQueueProcessorFactory.java
Log:
HSEARCH-311 interface change in BackendQueueProcessorFactory: adding a close() method to
release resources.
Modified:
search/trunk/src/java/org/hibernate/search/backend/BackendQueueProcessorFactory.java
===================================================================
---
search/trunk/src/java/org/hibernate/search/backend/BackendQueueProcessorFactory.java 2008-11-25
15:25:46 UTC (rev 15615)
+++
search/trunk/src/java/org/hibernate/search/backend/BackendQueueProcessorFactory.java 2008-11-25
17:56:50 UTC (rev 15616)
@@ -13,6 +13,12 @@
* @author Emmanuel Bernard
*/
public interface BackendQueueProcessorFactory {
+
+ /**
+ * Used at startup, called once as first method.
+ * @param props all configuration properties
+ * @param searchFactory the client
+ */
void initialize(Properties props, SearchFactoryImplementor searchFactory);
/**
@@ -22,4 +28,11 @@
* @return <code>Runnable</code> which processes
<code>queue</code> when started.
*/
Runnable getProcessor(List<LuceneWork> queue);
+
+ /**
+ * Used to shutdown and eventually release resources.
+ * no other method should used after this one.
+ */
+ void close();
+
}
Modified:
search/trunk/src/java/org/hibernate/search/backend/impl/jms/JMSBackendQueueProcessorFactory.java
===================================================================
---
search/trunk/src/java/org/hibernate/search/backend/impl/jms/JMSBackendQueueProcessorFactory.java 2008-11-25
15:25:46 UTC (rev 15615)
+++
search/trunk/src/java/org/hibernate/search/backend/impl/jms/JMSBackendQueueProcessorFactory.java 2008-11-25
17:56:50 UTC (rev 15616)
@@ -116,4 +116,8 @@
return result;
}
+ public void close() {
+ // no need to release anything
+ }
+
}
Modified:
search/trunk/src/java/org/hibernate/search/backend/impl/lucene/LuceneBackendQueueProcessorFactory.java
===================================================================
---
search/trunk/src/java/org/hibernate/search/backend/impl/lucene/LuceneBackendQueueProcessorFactory.java 2008-11-25
15:25:46 UTC (rev 15615)
+++
search/trunk/src/java/org/hibernate/search/backend/impl/lucene/LuceneBackendQueueProcessorFactory.java 2008-11-25
17:56:50 UTC (rev 15616)
@@ -48,5 +48,9 @@
public Runnable getProcessor(List<LuceneWork> queue) {
return new LuceneBackendQueueProcessor( queue, searchFactoryImp, visitorsMap );
}
+
+ public void close() {
+ // no need to release anything
+ }
}
Show replies by date