// Path: src/main/java/org/jminix/type/InputStreamContent.java
// public abstract class InputStreamContent extends InputStream {
// 
// }


import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.management.InstanceNotFoundException;
import javax.management.IntrospectionException;
import javax.management.MBeanException;
import javax.management.MBeanOperationInfo;
import javax.management.MBeanParameterInfo;
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.ReflectionException;
import net.sf.json.JSONSerializer;
import org.jminix.type.HtmlContent;
import org.jminix.type.InputStreamContent;
import org.restlet.data.CharacterSet;
import org.restlet.data.Form;
import org.restlet.data.Language;
import org.restlet.data.MediaType;
import org.restlet.representation.InputRepresentation;
import org.restlet.representation.Representation;
import org.restlet.representation.StringRepresentation;
import org.restlet.representation.Variant;
import org.restlet.resource.Post;
import org.restlet.resource.ResourceException;


        String declaration = getDecodedAttribute("operation");

        String operation = declaration.split("\\(")[0];

        String[] signature = declaration.split("\\(").length > 1 ? (
                               declaration.split("\\(")[1].split("\\)").length >0 ?
                                    declaration.split("\\(")[1].split("\\)")[0].split(",") :
                                        new String[]{} ) : new String[]{};

        MBeanServerConnection server = getServer();

        try
        {
            Object[] params=new Object[signature.length];

            ValueParser parser = new ValueParser();
            for(int i=0; i<stringParams.length; i++) {
                params[i] = parser.parse(stringParams[i], signature[i]);
            }

            Object result = server.invoke(new ObjectName(domain+":"+mbean), operation, params, signature);

            if(result != null) {
                Variant variant = getPreferredVariant(getVariants());
                if (MediaType.APPLICATION_JSON == variant.getMediaType()) {
                    return new StringRepresentation( JSONSerializer.toJSON(result).toString(),
                            MediaType.APPLICATION_JSON, Language.ALL, CharacterSet.UTF_8);
                } else {
                    if (result instanceof InputStreamContent) {

// Path: src/main/java/org/jminix/type/InputStreamContent.java
// public abstract class InputStreamContent extends InputStream {
// 
// }


// Path: src/main/java/org/jminix/console/resource/OperationResource.java
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.management.InstanceNotFoundException;
import javax.management.IntrospectionException;
import javax.management.MBeanException;
import javax.management.MBeanOperationInfo;
import javax.management.MBeanParameterInfo;
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.ReflectionException;
import net.sf.json.JSONSerializer;
import org.jminix.type.HtmlContent;
import org.jminix.type.InputStreamContent;
import org.restlet.data.CharacterSet;
import org.restlet.data.Form;
import org.restlet.data.Language;
import org.restlet.data.MediaType;
import org.restlet.representation.InputRepresentation;
import org.restlet.representation.Representation;
import org.restlet.representation.StringRepresentation;
import org.restlet.representation.Variant;
import org.restlet.resource.Post;
import org.restlet.resource.ResourceException;


        String declaration = getDecodedAttribute("operation");

        String operation = declaration.split("\\(")[0];

        String[] signature = declaration.split("\\(").length > 1 ? (
                               declaration.split("\\(")[1].split("\\)").length >0 ?
                                    declaration.split("\\(")[1].split("\\)")[0].split(",") :
                                        new String[]{} ) : new String[]{};

        MBeanServerConnection server = getServer();

        try
        {
            Object[] params=new Object[signature.length];

            ValueParser parser = new ValueParser();
            for(int i=0; i<stringParams.length; i++) {
                params[i] = parser.parse(stringParams[i], signature[i]);
            }

            Object result = server.invoke(new ObjectName(domain+":"+mbean), operation, params, signature);

            if(result != null) {
                Variant variant = getPreferredVariant(getVariants());
                if (MediaType.APPLICATION_JSON == variant.getMediaType()) {
                    return new StringRepresentation( JSONSerializer.toJSON(result).toString(),
                            MediaType.APPLICATION_JSON, Language.ALL, CharacterSet.UTF_8);
                } else {
                    if (result instanceof InputStreamContent) {

                        return new InputRepresentation((InputStreamContent) result, MediaType.APPLICATION_OCTET_STREAM);
