Methods Summary |
---|
public void | addArg(Arg arg)
args.add(arg);
|
public java.util.List | getArgs()
return args;
|
public java.lang.String | getClassLoader()
return classLoader;
|
public java.lang.String | getClassName()
return className;
|
public java.lang.String | getInfo()Return descriptive information about this implementation and the
corresponding version number, in the format
<description>/<version> .
return (info);
|
protected java.lang.String | jmxCreate(javax.management.MBeanServerConnection jmxServerConnection, java.lang.String name)create new Mbean and when set from ClassLoader Objectname
String error = null;
Object argsA[] = null;
String sigA[] = null;
if (args != null) {
argsA = new Object[ args.size()];
sigA = new String[args.size()];
for( int i=0; i<args.size(); i++ ) {
Arg arg=(Arg)args.get(i);
if( arg.type==null) {
arg.type="java.lang.String";
sigA[i]=arg.getType();
argsA[i]=arg.getValue();
} else {
sigA[i]=arg.getType();
argsA[i]=convertStringToType(arg.getValue(),arg.getType());
}
}
}
if (classLoader != null && !"".equals(classLoader)) {
if (isEcho()) {
handleOutput("create MBean " + name + " from class "
+ className + " with classLoader " + classLoader);
}
if(args == null)
jmxServerConnection.createMBean(className, new ObjectName(name), new ObjectName(classLoader));
else
jmxServerConnection.createMBean(className, new ObjectName(name), new ObjectName(classLoader),argsA,sigA);
} else {
if (isEcho()) {
handleOutput("create MBean " + name + " from class "
+ className);
}
if(args == null)
jmxServerConnection.createMBean(className, new ObjectName(name));
else
jmxServerConnection.createMBean(className, new ObjectName(name),argsA,sigA);
}
return error;
|
public java.lang.String | jmxExecute(javax.management.MBeanServerConnection jmxServerConnection)Execute the specified command, based on the configured properties. The
input stream will be closed upon completion of this task, whether it was
executed successfully or not.
if (getName() == null) {
throw new BuildException("Must specify a 'name'");
}
if ((className == null)) {
throw new BuildException(
"Must specify a 'className' for get");
}
return jmxCreate(jmxServerConnection, getName());
|
public void | setArgs(java.util.List args)
this.args = args;
|
public void | setClassLoader(java.lang.String classLoaderName)
this.classLoader = classLoaderName;
|
public void | setClassName(java.lang.String className)
this.className = className;
|