I think it is no big deal to make the resources thread safe. It would be an advantage to initialize some classes only once.
These classes are thread safe:
KeywordBasedFragmentAnnotator
new
SentenceAsFragmentAnnotator
They only have one final variable and that one is thread safe
more information here http://www.javamex.com/tutorials/synchronization_final.shtml
These classes are also thread safe but could be implemented in a better way:
TokenAsFragmentAnnotator
DependencyAsFragmentAnnotator
tokenPOSFilter, dependencyTypeFilter, governorPOSFilter, dependentPOSFilter - These variables could be final because the access is only a read. These methods are used by the maps "contain" and "isEmpty".
These classes have to be modified:
CachedLAPAccess
This class is not thread safe. Main modification should be done by converting the Hashmap into an ConcurrentHashMap. There are some other variables that maybe has to be discussed if they have to be uniq for each call. Are the stored information unique for a fragment graph? Is it good to have a global CachedLAPAccess or should we have global Lap implementations and use CachedLAPAccess only in local context?
I think it is no big deal to make the resources thread safe. It would be an advantage to initialize some classes only once.
These classes are thread safe:
KeywordBasedFragmentAnnotator new
SentenceAsFragmentAnnotator
They only have one final variable and that one is thread safe
more information here http://www.javamex.com/tutorials/synchronization_final.shtml
These classes are also thread safe but could be implemented in a better way:
TokenAsFragmentAnnotator
DependencyAsFragmentAnnotator
tokenPOSFilter, dependencyTypeFilter, governorPOSFilter, dependentPOSFilter - These variables could be final because the access is only a read. These methods are used by the maps "contain" and "isEmpty".
These classes have to be modified:
CachedLAPAccess
This class is not thread safe. Main modification should be done by converting the Hashmap into an ConcurrentHashMap. There are some other variables that maybe has to be discussed if they have to be uniq for each call. Are the stored information unique for a fragment graph? Is it good to have a global CachedLAPAccess or should we have global Lap implementations and use CachedLAPAccess only in local context?