// Path: camelwatch-api/src/main/java/org/camelwatch/api/CamelConnection.java
// public interface CamelConnection {
// 
// 	CamelBean getComponent(String componentName) throws Exception;
// 
// 	List<CamelBean> getComponents() throws Exception;
// 
// 	CamelBean getConsumer(String consumerId) throws Exception;
// 
// 	ConsumerOperations getConsumerOperations(String consumerId) throws Exception;
// 
// 	List<CamelBean> getConsumers() throws Exception;
// 
// 	CamelBean getContext(String camelId) throws Exception;
// 
// 	List<CamelBean> getContexts() throws Exception;
// 
// 	CamelBean getEndpoint(String endpointName) throws Exception;
// 
// 	EndpointOperations getEndpointOperations(String endpointName) throws Exception;
// 
// 	List<CamelBean> getEndpoints() throws Exception;
// 
// 	CamelBean getErrorHandler(String errorHandlerName) throws Exception;
// 
// 	List<CamelBean> getErrorHandlers() throws Exception;
// 
// 	CamelBean getProcessor(String processorId) throws Exception;
// 
// 	List<CamelBean> getProcessors() throws Exception;
// 
// 	Collection<CamelBean> getProcessors(String routeId) throws Exception;
// 
// 	CamelBean getRoute(String routeId) throws Exception;
// 
// 	RouteOperations getRouteOperations(String routeId) throws Exception;
// 
// 	List<CamelBean> getRoutes() throws Exception;
// 
// }
// 
// Path: camelwatch-api/src/main/java/org/camelwatch/api/CamelConnectionFactory.java
// @Service
// public class CamelConnectionFactory {
// 
//     @Value("${jmx.endpoint.url}")
//     private String url;
// 
//     @Value("${jmx.endpoint.username}")
//     private String username;
// 
//     @Value("${jmx.endpoint.password}")
//     private String password;
// 
//     private final Map<ObjectName, MBeanInfo> beanInfoCache = Maps.newHashMap();
// 
//     public CamelConnection getConnection() throws MalformedObjectNameException, NullPointerException, IOException {
//         return new CamelJmxConnection(url, username, password, beanInfoCache);
//     }
// 
//     public CamelConnection getConnection(String url, String username, String password) throws MalformedObjectNameException, NullPointerException, IOException {
//         Map<ObjectName, MBeanInfo> beanInfoCache = Maps.newHashMap() ;
//         return new CamelJmxConnection(url, username, password, beanInfoCache);
//     }
// }


import org.camelwatch.api.CamelConnection;
import org.camelwatch.api.CamelConnectionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

package camelwatch.web;



/**
 * @author Stephen K Samuel samspade79@gmail.com 29 Jun 2012 00:47:18
 */
@Controller
public class ManagerController {

    @Autowired
    private CamelConnectionFactory connectionFactory;

    @RequestMapping("/")
    public String listContexts(ModelMap map) throws Exception {


// Path: camelwatch-api/src/main/java/org/camelwatch/api/CamelConnection.java
// public interface CamelConnection {
// 
// 	CamelBean getComponent(String componentName) throws Exception;
// 
// 	List<CamelBean> getComponents() throws Exception;
// 
// 	CamelBean getConsumer(String consumerId) throws Exception;
// 
// 	ConsumerOperations getConsumerOperations(String consumerId) throws Exception;
// 
// 	List<CamelBean> getConsumers() throws Exception;
// 
// 	CamelBean getContext(String camelId) throws Exception;
// 
// 	List<CamelBean> getContexts() throws Exception;
// 
// 	CamelBean getEndpoint(String endpointName) throws Exception;
// 
// 	EndpointOperations getEndpointOperations(String endpointName) throws Exception;
// 
// 	List<CamelBean> getEndpoints() throws Exception;
// 
// 	CamelBean getErrorHandler(String errorHandlerName) throws Exception;
// 
// 	List<CamelBean> getErrorHandlers() throws Exception;
// 
// 	CamelBean getProcessor(String processorId) throws Exception;
// 
// 	List<CamelBean> getProcessors() throws Exception;
// 
// 	Collection<CamelBean> getProcessors(String routeId) throws Exception;
// 
// 	CamelBean getRoute(String routeId) throws Exception;
// 
// 	RouteOperations getRouteOperations(String routeId) throws Exception;
// 
// 	List<CamelBean> getRoutes() throws Exception;
// 
// }
// 
// Path: camelwatch-api/src/main/java/org/camelwatch/api/CamelConnectionFactory.java
// @Service
// public class CamelConnectionFactory {
// 
//     @Value("${jmx.endpoint.url}")
//     private String url;
// 
//     @Value("${jmx.endpoint.username}")
//     private String username;
// 
//     @Value("${jmx.endpoint.password}")
//     private String password;
// 
//     private final Map<ObjectName, MBeanInfo> beanInfoCache = Maps.newHashMap();
// 
//     public CamelConnection getConnection() throws MalformedObjectNameException, NullPointerException, IOException {
//         return new CamelJmxConnection(url, username, password, beanInfoCache);
//     }
// 
//     public CamelConnection getConnection(String url, String username, String password) throws MalformedObjectNameException, NullPointerException, IOException {
//         Map<ObjectName, MBeanInfo> beanInfoCache = Maps.newHashMap() ;
//         return new CamelJmxConnection(url, username, password, beanInfoCache);
//     }
// }


// Path: camelwatch-web/src/main/java/camelwatch/web/ManagerController.java
import org.camelwatch.api.CamelConnection;
import org.camelwatch.api.CamelConnectionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

package camelwatch.web;



/**
 * @author Stephen K Samuel samspade79@gmail.com 29 Jun 2012 00:47:18
 */
@Controller
public class ManagerController {

    @Autowired
    private CamelConnectionFactory connectionFactory;

    @RequestMapping("/")
    public String listContexts(ModelMap map) throws Exception {


        CamelConnection conn = connectionFactory.getConnection();
