// 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.*;

                        value = items.toString();
                    }
                    result.put("value", value);
                }
					 else if (model.containsKey("attributes") && model.get("attributes") instanceof CompositeData)
					 {
						 CompositeData items = (CompositeData) model.get("attributes");
						 result.put("value", items.values());
					 }
            }

            // Hack because root must be a list for dojo tree...
            if ("servers".equals(getRequest().getOriginalRef().getLastSegment(true)))
            {
                representation = new StringRepresentation(JSONSerializer.toJSON(new Object[]{result})
                        .toString(), MediaType.APPLICATION_JSON, Language.ALL, CharacterSet.UTF_8);
            }
            else
            {
                representation = new StringRepresentation(JSONSerializer.toJSON(result).toString(), MediaType.APPLICATION_JSON, Language.ALL, CharacterSet.UTF_8 );
            }
        }
        else
        {
            return null;
        }
        representation.setExpirationDate(new Date(0l));
        return representation;
    }


// 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.*;

                        value = items.toString();
                    }
                    result.put("value", value);
                }
					 else if (model.containsKey("attributes") && model.get("attributes") instanceof CompositeData)
					 {
						 CompositeData items = (CompositeData) model.get("attributes");
						 result.put("value", items.values());
					 }
            }

            // Hack because root must be a list for dojo tree...
            if ("servers".equals(getRequest().getOriginalRef().getLastSegment(true)))
            {
                representation = new StringRepresentation(JSONSerializer.toJSON(new Object[]{result})
                        .toString(), MediaType.APPLICATION_JSON, Language.ALL, CharacterSet.UTF_8);
            }
            else
            {
                representation = new StringRepresentation(JSONSerializer.toJSON(result).toString(), MediaType.APPLICATION_JSON, Language.ALL, CharacterSet.UTF_8 );
            }
        }
        else
        {
            return null;
        }
        representation.setExpirationDate(new Date(0l));
        return representation;
    }


    protected ServerConnectionProvider getServerProvider()
