Skip to content

Instantly share code, notes, and snippets.

@tbatchelli
Created May 6, 2013 18:22
Show Gist options
  • Save tbatchelli/5527013 to your computer and use it in GitHub Desktop.
Save tbatchelli/5527013 to your computer and use it in GitHub Desktop.
;; 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