// Path: src/main/java/org/jminix/server/ServerConnectionProvider.java
// public interface ServerConnectionProvider
// {
//     /**
//      * List of connections. The clients are not intended to cache them, but query them before each use.
//      * The ordering is guaranteed to be unchanged over time (e.g. after reboot).
//      * 
//      * @return the list of connections. 
//      */
//     public List<MBeanServerConnection> getConnections();
// 
// 	/**
// 	 * @return the names of connections. They can be simple numeric identifiers. They are guarantee not to change over
// 	 *         time (e.g. after reboot), though.
// 	 */
//     public List<String> getConnectionKeys();
//     
//     /**
//      * Return a connection by name.
//      * 
//      * @param name key as returned by {@link #getConnectionKeys()}.
//      * @return the connection or null if not found.
//      */
//     public MBeanServerConnection getConnection(String name);
// }
// 
// Path: src/main/java/org/jminix/type/InputStreamContent.java
// public abstract class InputStreamContent extends InputStream {
// 
// }


import net.sf.json.JSONSerializer;
import org.apache.velocity.Template;
import org.apache.velocity.app.VelocityEngine;
import org.jminix.server.ServerConnectionProvider;
import org.jminix.type.HtmlContent;
import org.jminix.type.InputStreamContent;
import org.restlet.data.CacheDirective;
import org.restlet.data.CharacterSet;
import org.restlet.data.Language;
import org.restlet.data.MediaType;
import org.restlet.ext.velocity.TemplateRepresentation;
import org.restlet.representation.*;
import org.restlet.resource.Get;
import org.restlet.resource.ResourceException;
import org.restlet.resource.ServerResource;
import javax.management.MBeanAttributeInfo;
import javax.management.MBeanServerConnection;
import javax.management.openmbean.CompositeData;
import java.util.*;

    }

    protected abstract String getTemplateName();

    @Get("html|txt|json")
    public abstract Map<String, Object> getModel();

    @Override
    public Representation toRepresentation(Object source, Variant variant)
    {
        if (source instanceof Representation) {
            return (Representation) source;
        }
        if (source == null) {
            return new EmptyRepresentation();
        }
        Map<String, Object> model = (Map<String, Object>) source;

        getResponseCacheDirectives().add(CacheDirective.noCache());
        getResponseCacheDirectives().add(CacheDirective.mustRevalidate());
        getResponseCacheDirectives().add(CacheDirective.noStore());
        Representation representation;

        if (MediaType.TEXT_HTML.equals(variant.getMediaType()))
        {
            Map<String, Object> enrichedModel = new HashMap<String, Object>(model);

            String templateName = getTemplateName();
            Object resultObject = enrichedModel.get("value");
            

// Path: src/main/java/org/jminix/server/ServerConnectionProvider.java
// public interface ServerConnectionProvider
// {
//     /**
//      * List of connections. The clients are not intended to cache them, but query them before each use.
//      * The ordering is guaranteed to be unchanged over time (e.g. after reboot).
//      * 
//      * @return the list of connections. 
//      */
//     public List<MBeanServerConnection> getConnections();
// 
// 	/**
// 	 * @return the names of connections. They can be simple numeric identifiers. They are guarantee not to change over
// 	 *         time (e.g. after reboot), though.
// 	 */
//     public List<String> getConnectionKeys();
//     
//     /**
//      * Return a connection by name.
//      * 
//      * @param name key as returned by {@link #getConnectionKeys()}.
//      * @return the connection or null if not found.
//      */
//     public MBeanServerConnection getConnection(String name);
// }
// 
// Path: src/main/java/org/jminix/type/InputStreamContent.java
// public abstract class InputStreamContent extends InputStream {
// 
// }


// Path: src/main/java/org/jminix/console/resource/AbstractTemplateResource.java
import net.sf.json.JSONSerializer;
import org.apache.velocity.Template;
import org.apache.velocity.app.VelocityEngine;
import org.jminix.server.ServerConnectionProvider;
import org.jminix.type.HtmlContent;
import org.jminix.type.InputStreamContent;
import org.restlet.data.CacheDirective;
import org.restlet.data.CharacterSet;
import org.restlet.data.Language;
import org.restlet.data.MediaType;
import org.restlet.ext.velocity.TemplateRepresentation;
import org.restlet.representation.*;
import org.restlet.resource.Get;
import org.restlet.resource.ResourceException;
import org.restlet.resource.ServerResource;
import javax.management.MBeanAttributeInfo;
import javax.management.MBeanServerConnection;
import javax.management.openmbean.CompositeData;
import java.util.*;

    }

    protected abstract String getTemplateName();

    @Get("html|txt|json")
    public abstract Map<String, Object> getModel();

    @Override
    public Representation toRepresentation(Object source, Variant variant)
    {
        if (source instanceof Representation) {
            return (Representation) source;
        }
        if (source == null) {
            return new EmptyRepresentation();
        }
        Map<String, Object> model = (Map<String, Object>) source;

        getResponseCacheDirectives().add(CacheDirective.noCache());
        getResponseCacheDirectives().add(CacheDirective.mustRevalidate());
        getResponseCacheDirectives().add(CacheDirective.noStore());
        Representation representation;

        if (MediaType.TEXT_HTML.equals(variant.getMediaType()))
        {
            Map<String, Object> enrichedModel = new HashMap<String, Object>(model);

            String templateName = getTemplateName();
            Object resultObject = enrichedModel.get("value");
            

            if (resultObject instanceof InputStreamContent) {
