Created
May 6, 2013 18:22
-
-
Save tbatchelli/5527013 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
;; When using the XPCOM Bridge, we don't create a session with the | |
;; server, instead, we just instantiate a singleton of the VBM | |
(def ^VirtualBoxManager instance* (atom nil)) | |
(defn ^VirtualBoxManager instance | |
"If the loaded vbox library is xpcom, it will create an instance of | |
the xpcom service if it doesn't exist already" | |
[] | |
(when (xpcom?) | |
(if-let [the-instance @instance*] | |
the-instance | |
(swap! instance* (constantly (VirtualBoxManager/createInstance nil)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment