-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scan classpath for EDD subclasses/dataset types
This change uses reflection, specifically the ClassGraph classpath scanner, to discover concrete EDD subclasses with appropriate fromXml methods at runtime. The scan is performed once and stored in a static map for use in EDD's fromXml method. In addition to elminiating the need to registry various EDD implementations in the ERDDAP codebase in EDD.fromXml, this change also allows loading of third party EDD implementations at runtime. In local testing classpath scanning took about 1 second. This scan occurs only once at startup. Scanning is confined to EDD's package (gov.noaa.pfel.erddap.dataset) for performance reasons; scanning all packages took around 12 seconds. For this reason, all EDD implementations need to belong to the gov.noaa.pfel.erddap.dataset package to be detected.
- Loading branch information
1 parent
5a0d0c8
commit b170d3f
Showing
2 changed files
with
115 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters