Hi,
take a look at org.hibernate.search.store.RAMDirectoryProvider
and org.hibernate.search.store.FSDirectoryProvider
they are quite simple.
Code:
void initialize(String directoryProviderName, Properties properties, SearchFactoryImplementor searchFactoryImplementor);
you don't
need to do anything special here, but it makes sense to use the parameters to configure you implementation. the properties is containing the hibernate search configuration value-pairs so you can add some keywords in your persistence.xml
The name is useful for logging messages or recognize the instance during debug, I usually just save it in a field.
searchFactoryImplementor is usually not needed, but you could need it to access some more information.
Code:
void start()
this is a good place to put any heavy weight initialization, like starting background threads. Again you may just leave the method empty if you don't need to do anything. You could do it all in initialize, but usually you should just configure yourself there.
Code:
void stop()
If you have to cleanup something or stop helper threads, do it here..
(again you're not required to do anything at all)
Code:
TDirectory getDirectory();
Just return the directory you built; this is the factory method.