Skip to content

Instantly share code, notes, and snippets.

Avatar

Lukas Krejci metlos

View GitHub Profile
View rhq-plugin.xml
Example:
<bundle-target>
<destination-base-dir name="Deploy Directory" description="The deployment directory for a standalone server">
<value-context>measurementTrait</value-context>
<value-name>deployDir</value-name>
</destination-base-dir>
<special-destination name="Patch Installer" description="Accepts JBoss AS patches and installs them to a standalone server" bundle-type="JBoss AS Patch Bundle">
<value-reference reference-name="host" context="pluginConfiguration" name="hostname"/>
<value-reference context="pluginConfiguration" name="port"/>
<value-reference context="pluginConfiguration" name="user"/>
@metlos
metlos / example.py
Created Jul 12, 2012
Importing script from RHQ server
View example.py
import sys
sys.path.append("__rhq__:rhq://repositories/my_repo/")
import my_script as foo
...
@metlos
metlos / PythonScriptEngineInitializer.java
Created Jul 12, 2012
PythonScriptEngineInitializer
View PythonScriptEngineInitializer.java
public class PythonScriptEngineInitializer implements ScriptEngineInitializer {
private static final Log LOG = LogFactory.getLog(PythonScriptEngineInitializer.class);
static {
Properties props = new Properties();
props.put("python.packages.paths", "java.class.path,sun.boot.class.path");
props.put("python.packages.directories", "java.ext.dirs");
props.put("python.cachedir.skip", false);
PythonInterpreter.initialize(System.getProperties(), props, null);
View scriptEngineProvider.java
public class PythonScriptEngineProvider implements ScriptEngineProvider {
@Override
public String getSupportedLanguage() {
return "python";
}
@Override
public ScriptEngineInitializer getInitializer() {
return new PythonScriptEngineInitializer();
You can’t perform that action at this time.