Created
November 18, 2010 14:35
-
-
Save jsanda/705047 to your computer and use it in GitHub Desktop.
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
(ns rhq.plugin | |
(:require [rhq.config :as config]) | |
(:import [org.rhq.core.pluginapi.inventory | |
ResourceDiscoveryComponent ResourceDiscoveryContext ClassLoaderFacet | |
DiscoveredResourceDetails ResourceComponent ResourceContext] | |
[org.rhq.core.domain.measurement AvailabilityType]) | |
(:gen-class | |
:name rhq.plugin.PluginComponent | |
:implements [org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent | |
org.rhq.core.pluginapi.inventory.ResourceComponent])) | |
(defn update-classpath [] | |
(add-classpath | |
(.toURL (java.io.File. (System/getProperty "clojure.src.dir"))))) | |
;(def get-plugin-ns [plugin-config] nil) | |
(defn load-plugin [] (require (symbol "rhq.clj.test" :reload-all))) | |
(defn ^java.util.Set -discoverResources [this ^ResourceDiscoveryContext context] | |
;(update-classpath) | |
(let [plugin (alias 'plugin (load-plugin))] | |
('plugin/discover) | |
(.println System/out "DISCOVER") | |
(set []))) | |
(defn ^AvailabilityType -getAvailability [this] nil) | |
(defn -start [this ^ResourceContext context] | |
(.println System/out "STARTING PLUGIN") | |
(print "STARTING PLUGIN")) | |
(defn -stop [this] nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment