You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ag...@apache.org on 2009/02/05 08:22:18 UTC

svn commit: r741032 - in /qpid/trunk/qpid/java/management/client: ./ src/example/org/apache/qpid/management/example/ src/main/java/org/apache/qpid/management/ src/main/java/org/apache/qpid/management/configuration/ src/main/java/org/apache/qpid/managem...

Author: agazzarini
Date: Thu Feb  5 07:22:17 2009
New Revision: 741032

URL: http://svn.apache.org/viewvc?rev=741032&view=rev
Log:
QPID-1581 : Source modification for QMan Admin Console

Added:
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/BrokerModel.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/BrokersManagementAction.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ConsoleAction.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ConsoleModel.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/JmxPerspectiveAction.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/LoggingConfigurationAction.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ResourcesManagementAction.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmOperationsPerspectiveAction.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmPropertiesPerspectiveAction.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmRmdPerspectiveAction.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmWsdlPerspectiveAction.java
Modified:
    qpid/trunk/qpid/java/management/client/build.xml
    qpid/trunk/qpid/java/management/client/src/example/org/apache/qpid/management/example/GetResourcePropertyDocumentExample.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/Messages.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionData.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/ManagementClient.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/QMan.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/capabilities/QManAdapterCapability.java
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/common/ObjectNameIdFactory.java
    qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.wsdl

Modified: qpid/trunk/qpid/java/management/client/build.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/build.xml?rev=741032&r1=741031&r2=741032&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/build.xml (original)
+++ qpid/trunk/qpid/java/management/client/build.xml Thu Feb  5 07:22:17 2009
@@ -101,6 +101,11 @@
                 <exclude name="qpid-management-client-tests*.jar"/>           
             </fileset>
         </copy>
+        <copy todir="${web.module}">
+        	<fileset dir="${module.src}${file.separator}..${file.separator}..${file.separator}..${file.separator}console">            	
+				<include name="*/**"/>
+			</fileset>          	
+        </copy>	
     </target> 
 	<target name="jar.manifest" depends="compile" if="module.manifest">
 		<jar destfile="${module.jar}" manifest="${module.manifest}">

Modified: qpid/trunk/qpid/java/management/client/src/example/org/apache/qpid/management/example/GetResourcePropertyDocumentExample.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/example/org/apache/qpid/management/example/GetResourcePropertyDocumentExample.java?rev=741032&r1=741031&r2=741032&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/example/org/apache/qpid/management/example/GetResourcePropertyDocumentExample.java (original)
+++ qpid/trunk/qpid/java/management/client/src/example/org/apache/qpid/management/example/GetResourcePropertyDocumentExample.java Thu Feb  5 07:22:17 2009
@@ -80,7 +80,6 @@
 		
 		@SuppressWarnings("unused")
 		Element resourcePropertyDocument = wsResourceClient.getResourcePropertyDocument();
-
 	}
 	/**
 	 * Prints out a description of this example.

Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/Messages.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/Messages.java?rev=741032&r1=741031&r2=741032&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/Messages.java (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/Messages.java Thu Feb  5 07:22:17 2009
@@ -117,6 +117,9 @@
     String QMAN_300003_BROKER_ALREADY_CONNECTED = "<QMAN-300003> : Unable to enlist given broker connection data : QMan is already connected with broker %s";
     String QMAN_300004_INVALID_CONFIGURATION_FILE = "<QMAN-300004> : The given configuration file (%s) is not valid (it doesn't exist or cannot be read)";
     String QMAN_300005_QEMU_INITIALIZATION_FAILURE = "<QMAN-300005> : Unable to initialize QEmu module and therefore emulation won't be enabled...";
+    
+    String QMAN_300006_OS_MBEAN_FAILURE = "<QMAN-300006> : Unable to retrieve Operating System properties. No values will be displayed for underlying Operation System.";
+    String QMAN_300007_RUNTIME_MBEAN_FAILURE = "<QMAN-300007> : Unable to retrieve Runtime Environment properties. No values will be displayed.";
 	
 	// ERROR
 	String QMAN_100001_BAD_MAGIC_NUMBER_FAILURE = "<QMAN-100001> : Message processing failure : incoming message contains a bad magic number (%s) and therefore will be discaded.";

Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionData.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionData.java?rev=741032&r1=741031&r2=741032&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionData.java (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionData.java Thu Feb  5 07:22:17 2009
@@ -44,7 +44,7 @@
 	 * @param username the username for connecting with the broker.
 	 * @param password the password for connecting with the broker.
 	 * @param virtualHost the virtual host.
-	 * @param initialPoolCapacity the number of the connection that must  be immediately opened.
+	 * @param initialPoolCapacity the number of connections that must  be immediately opened.
 	 * @param maxPoolCapacity the maximum number of opened connection.
 	 * @param maxWaitTimeout the maximum amount of time that a client will wait for obtaining a connection.
      */

Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/ManagementClient.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/ManagementClient.java?rev=741032&r1=741031&r2=741032&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/ManagementClient.java (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/ManagementClient.java Thu Feb  5 07:22:17 2009
@@ -37,7 +37,7 @@
  *
  * @author Andrea Gazzarini
  */
-final class ManagementClient
+public final class ManagementClient
 {      
     private final static Logger LOGGER = Logger.get(ManagementClient.class);
     
@@ -46,6 +46,8 @@
     
     private DomainModel _domainModel;
     private QpidService _service;
+   
+    private final BrokerConnectionData _connectionData;
     
     /**
      * Builds a new <code>ManagementClient</code> with the given identifier and connection data.
@@ -55,12 +57,29 @@
      */
     ManagementClient(UUID brokerId,BrokerConnectionData connectionData)
     {
+    	_connectionData = connectionData;
         _service = new QpidService(brokerId);
         _domainModel = new DomainModel(brokerId);
         _managementQueueName = Configuration.getInstance().getManagementQueueName();
         _methodReplyQueueName = Configuration.getInstance().getMethodReplyQueueName();
     }
 
+    @Override
+    public String toString()
+    {
+    	return _connectionData.toString();
+    }
+    
+    /**
+     * Returns the connection data associated with this management client.
+     * 
+     * @return the connection data associated with this management client.
+     */
+    public BrokerConnectionData getBrokerConnectionData()
+    {
+    	return _connectionData;
+    }
+    
     /**
      * Establishing initial communication Between Client and Broker.
      * According to specification :

Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/QMan.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/QMan.java?rev=741032&r1=741031&r2=741032&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/QMan.java (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/QMan.java Thu Feb  5 07:22:17 2009
@@ -371,4 +371,14 @@
             LOGGER.error(exception, Messages.QMAN_100017_UNABLE_TO_CONNECT,brokerId,data);
         }
     }    
+    
+    /**
+     * Returns the list of management clients currently handled by QMan.
+     * 
+     * @return the list of management clients currently handled by QMan.
+     */
+    public List<ManagementClient> getManagementClients()
+    {
+    	return managementClients;
+    }
 }

Added: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/BrokerModel.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/BrokerModel.java?rev=741032&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/BrokerModel.java (added)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/BrokerModel.java Thu Feb  5 07:22:17 2009
@@ -0,0 +1,80 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.management.web.action;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.apache.qpid.management.Names;
+
+public class BrokerModel
+{
+	private Map<String, List<ObjectName>> objectsByType = new HashMap<String, List<ObjectName>>();
+	
+	private String id;
+	
+	void addObject(ObjectName name)
+	{
+		String packageName = name.getKeyProperty(Names.PACKAGE);
+		String className = name.getKeyProperty(Names.CLASS);
+		if (className != null)
+		{
+			String fqn = packageName+"."+className;
+			
+			List<ObjectName> objects = objectsByType.get(fqn);
+			if (objects == null)
+			{
+				objects = new ArrayList<ObjectName>();
+				objectsByType.put(fqn,objects);
+			}
+			objects.add(name);		
+		}
+	}
+
+	public String getId()
+	{
+		return id;
+	}
+
+	public void setId(String id)
+	{
+		this.id = id;
+	}
+	
+	public Set<String> getCategoryNames(){
+		return objectsByType.keySet();
+	}
+	
+	public List<ObjectName> getCategory(String name) 
+	{
+		return objectsByType.get(name);
+	}
+	
+	public int getCategoryCount()
+	{
+		return objectsByType.keySet().size();
+	}
+}
\ No newline at end of file

Added: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/BrokersManagementAction.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/BrokersManagementAction.java?rev=741032&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/BrokersManagementAction.java (added)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/BrokersManagementAction.java Thu Feb  5 07:22:17 2009
@@ -0,0 +1,188 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.management.web.action;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.qpid.management.Names;
+import org.apache.qpid.management.configuration.BrokerAlreadyConnectedException;
+import org.apache.qpid.management.configuration.BrokerConnectionData;
+import org.apache.qpid.management.configuration.BrokerConnectionException;
+import org.apache.qpid.management.domain.services.ManagementClient;
+import org.apache.qpid.management.domain.services.QMan;
+
+/**
+ * This controller is responsible to :
+ * 
+ * <ul>
+ * <li> prepare data for the page that is showing all connected brokers.</li>.
+ * </li> connect QMan with a broker on demand.
+ * </ul>
+ * @author Andrea Gazzarini
+ */
+public class BrokersManagementAction extends HttpServlet
+{
+	private static final long serialVersionUID = -2411413147821629363L;
+	 
+	/**
+	 * Retrieves all connected brokers (their connection data) and prepare the model that
+	 * is then forwarded to the appropriate view page.
+	 */
+	@SuppressWarnings("unchecked")
+	@Override
+	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+	{
+		try 
+		{	
+			QMan qman = (QMan)getServletContext().getAttribute(Names.APPLICATION_NAME);
+			List<ManagementClient> managementClients = qman.getManagementClients();
+			
+			List<BrokerConnectionData> brokers = new ArrayList<BrokerConnectionData>(managementClients.size());
+			
+			if (!managementClients.isEmpty())
+			{
+				for (ManagementClient managementClient : managementClients)
+				{
+					brokers.add(managementClient.getBrokerConnectionData());
+				}
+				request.setAttribute("model", brokers);		
+			}
+			
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/brokers_management.jsp");
+			dispatcher.forward(request,response);
+		} catch(Exception exception)
+		{
+			request.setAttribute("errorMessage","Unable to detect the exact cause Please look at the reported stack trace below.");
+			request.setAttribute("exception",exception);
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/error_page.jsp");
+			dispatcher.forward(request,response);			
+		}
+	}
+	
+	/**
+	 * Connects QMan with a new broker.
+	 */
+	@SuppressWarnings("unchecked")
+	@Override
+	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+	{
+		try 
+		{	
+			QMan qman = (QMan)getServletContext().getAttribute(Names.APPLICATION_NAME);
+			
+			String host = request.getParameter("host");
+			String portString = request.getParameter("port");
+			String virtualHost = request.getParameter("virtualHost");
+			String username = request.getParameter("username");
+			String password = request.getParameter("password");
+			
+			String initialCapacityString = request.getParameter("initialCapacity");
+			String maxCapacityString = request.getParameter("maxCapacity");
+			String maxWaitTimeoutString = request.getParameter("maxWaitTimeout");
+			
+			List<String> errors = new LinkedList<String>();
+			int port = 0;
+			int initialPoolCapacity = 0;
+			int maxPoolCapacity = 0;
+			long maxWaitTimeout = 0;
+			
+			if(host== null || host.trim().length()==0)
+			{
+				errors.add("Invalid value for \"host\" attribute. Must be not null.");				
+			}
+
+			if(virtualHost == null || virtualHost.trim().length()==0)
+			{
+				errors.add("Invalid value for \"virtualHost\" attribute. Must be not null.");				
+			}
+			
+			try{
+				port = Integer.parseInt(portString);
+			} catch(Exception exception) 
+			{
+				errors.add("Invalid value for \"port\" attribute. Must be not null and must be a number.");
+			}
+			
+			try{
+				initialPoolCapacity = Integer.parseInt(initialCapacityString);
+			} catch(Exception exception) 
+			{
+				errors.add("Invalid value for \"Initial Pool Capacity\" attribute. Must be not null and must be a number.");
+			}
+			
+			try{
+				maxPoolCapacity = Integer.parseInt(maxCapacityString);
+			} catch(Exception exception) 
+			{
+				errors.add("Invalid value for \"Max Pool Capacity\" attribute. Must be not null and must be a number.");
+			}
+
+			try{
+				maxWaitTimeout = Long.parseLong(maxWaitTimeoutString);
+			} catch(Exception exception) 
+			{
+				errors.add("Invalid value for \"Max Wait Timeout\" attribute. Must be not null and must be a number.");
+			}
+			
+			request.setAttribute("errors", errors);
+			
+			if (errors.isEmpty()) 
+			{
+				qman.addBroker(
+						host, 
+						port, 
+						username, 
+						password, 
+						virtualHost, 
+						initialPoolCapacity, 
+						maxPoolCapacity, 
+						maxWaitTimeout);
+			}
+			doGet(request, response);
+		}catch(BrokerAlreadyConnectedException exception)
+		{
+			request.setAttribute("errorMessage","Supplied data refers to an already connected broker...");
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/brokers_management.jsp");
+			dispatcher.forward(request,response);			
+		}
+		catch(BrokerConnectionException exception)
+		{
+			request.setAttribute("errorMessage","Unable to connect with the requested broker...");
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/brokers_management.jsp");
+			dispatcher.forward(request,response);			
+		} catch(Exception exception)
+		{
+			request.setAttribute("errorMessage","Unable to detect the exact cause Please look at the reported stack trace below.");
+			request.setAttribute("exception",exception);
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/error_page.jsp");
+			dispatcher.forward(request,response);			
+		}
+	}	
+}
\ No newline at end of file

Added: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ConsoleAction.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ConsoleAction.java?rev=741032&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ConsoleAction.java (added)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ConsoleAction.java Thu Feb  5 07:22:17 2009
@@ -0,0 +1,117 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.management.web.action;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.lang.management.OperatingSystemMXBean;
+import java.lang.management.RuntimeMXBean;
+import java.util.Date;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.qpid.management.Messages;
+import org.apache.qpid.management.Names;
+import org.apache.qpid.transport.util.Logger;
+
+/**
+ * This action is the controller responsible to prepare data for the home 
+ * page (System Overview) of QMan admin console.
+ * 
+ * @author Andrea Gazzarini
+ */
+public class ConsoleAction extends HttpServlet
+{
+	private static final long serialVersionUID = -2411413147821629363L;
+	
+	private static final Logger LOGGER = Logger.get(ConsoleAction.class);
+	
+	private Date _startDate;
+	
+	/**
+	 * Initializes this controller.
+	 * Simply it computes the start date of the application.
+	 */
+	@Override
+	public void init()
+	{
+		_startDate = new Date();
+	}
+	 
+	/**
+	 *  Prepares data for System Overview admin console page and forward that data to that page.
+	 *  
+	 * @throws ServletException when this controller is not able to forward to the appropriate view page.
+	 * @throws IOException when this controller is not able to forward to the appropriate view page.
+	 */
+	@Override
+	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+	{
+		ConsoleModel model = new ConsoleModel();
+		model.setVersion("1.0");
+		model.setVersionName("Sofia");
+		model.setStartDate(_startDate);
+		model.setHost(System.getProperty(Names.ADAPTER_HOST_PROPERTY_NAME, "localhost"));
+		model.setPort(Integer.parseInt(System.getProperty(Names.ADAPTER_PORT_PROPERTY_NAME, "8080")));
+
+		try 
+		{
+			OperatingSystemMXBean operatingSystem = ManagementFactory.getOperatingSystemMXBean();
+			model.setOsName(operatingSystem.getName());
+			model.setProcessors(operatingSystem.getAvailableProcessors());
+			model.setOsVersion(operatingSystem.getVersion());
+			model.setArchName(operatingSystem.getArch());
+		} catch(Exception exception)
+		{
+			LOGGER.warn(exception,Messages.QMAN_300006_OS_MBEAN_FAILURE);
+			model.setOsName("N.A.");
+			model.setProcessors(null);
+			model.setOsVersion("N.A.");
+			model.setArchName("N.A.");			
+		}
+		
+		try 
+		{
+			RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
+			
+			String bootClasspath = runtime.getBootClassPath();
+			model.setBootClasspath(bootClasspath.split(File.pathSeparator));
+			
+			String classpath = runtime.getClassPath();
+			model.setClasspath(classpath.split(File.pathSeparator));
+			
+			model.setInputArguments(runtime.getInputArguments().toArray(new String[]{}));
+		} catch(Exception exception)
+		{
+			LOGGER.warn(exception,Messages.QMAN_300007_RUNTIME_MBEAN_FAILURE);
+		}
+		
+		request.setAttribute("model", model);
+		
+		RequestDispatcher dispatcher = request.getRequestDispatcher("/console.jsp");
+		dispatcher.forward(request,response);
+	}
+}

Added: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ConsoleModel.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ConsoleModel.java?rev=741032&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ConsoleModel.java (added)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ConsoleModel.java Thu Feb  5 07:22:17 2009
@@ -0,0 +1,158 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.management.web.action;
+
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Console Model.
+ * It is a simple Data Transfer Object encapsulating all information about QMan 
+ * console (System Overview)
+ * 
+ * @author Andrea Gazzarini
+ */
+public class ConsoleModel implements Serializable
+{
+	private static final long serialVersionUID = -7676132151242738376L;
+	private String _version;
+	private String _versionName;
+	private Date _startDate;
+	private String _host;
+	private int _port;
+	
+	private String _osName;
+	private String _osVersion;
+	private String _archName;
+	private Integer _processors;
+
+	private String [] _bootClasspath;
+	private String [] _classpath;
+	private String [] _inputArguments;
+	private String [] _systemProperties;
+	
+	public String getVersion()
+	{
+		return _version;
+	}
+	public void setVersion(String version)
+	{
+		this._version = version;
+	}
+	public String getVersionName()
+	{
+		return _versionName;
+	}
+	public void setVersionName(String versionName)
+	{
+		this._versionName = versionName;
+	}
+	public Date getStartDate()
+	{
+		return _startDate;
+	}
+	public void setStartDate(Date startDate)
+	{
+		this._startDate = startDate;
+	}
+	public String getHost()
+	{
+		return _host;
+	}
+	public void setHost(String host)
+	{
+		this._host = host;
+	}
+	public int getPort()
+	{
+		return _port;
+	}
+	public void setPort(int  port)
+	{
+		this._port = port;
+	}
+	public String getOsName()
+	{
+		return _osName;
+	}
+	public void setOsName(String osName)
+	{
+		this._osName = osName;
+	}
+	public String getOsVersion()
+	{
+		return _osVersion;
+	}
+	public void setOsVersion(String osVersion)
+	{
+		this._osVersion = osVersion;
+	}
+	public String getArchName()
+	{
+		return _archName;
+	}
+	public void setArchName(String archName)
+	{
+		this._archName = archName;
+	}
+	public Integer getProcessors()
+	{
+		return _processors;
+	}
+	public void setProcessors(Integer processors)
+	{
+		this._processors = processors;
+	}
+	public List<String> getBootClasspath()
+	{	
+		return Arrays.asList(_bootClasspath);
+	}
+	public void setBootClasspath(String [] bootClasspath)
+	{
+		this._bootClasspath = bootClasspath;
+	}
+	public String [] getClasspath()
+	{
+		return _classpath;
+	}
+	public void setClasspath(String [] classpath)
+	{
+		this._classpath = classpath;
+	}
+	public String [] getInputArguments()
+	{
+		return _inputArguments;
+	}
+	public void setInputArguments(String [] inputArguments)
+	{
+		this._inputArguments = inputArguments;
+	}
+	public String [] getSystemProperties()
+	{
+		return _systemProperties;
+	}
+	public void setSystemProperties(String [] systemProperties)
+	{
+		this._systemProperties = systemProperties;
+	}
+}
\ No newline at end of file

Added: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/JmxPerspectiveAction.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/JmxPerspectiveAction.java?rev=741032&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/JmxPerspectiveAction.java (added)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/JmxPerspectiveAction.java Thu Feb  5 07:22:17 2009
@@ -0,0 +1,189 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.management.web.action;
+
+import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Map.Entry;
+
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanInfo;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * This controller is responsible to provide a jmx perspective of a specific resource.
+ * That means that this controller is querying the Platform MBean server in order to 
+ * get metadata for the requested mbean.
+ * 
+ * After that metadata will be forwarded to the appropriate view page and therefore 
+ * will be shown on the Admin console.
+ * 
+ * @author Andrea Gazzarini
+ */
+public class JmxPerspectiveAction extends HttpServlet
+{
+	private static final long serialVersionUID = -2411413147821629363L;
+
+	/**
+	 * Adapter interface for converting objects on html strings.
+	 * 
+	 * @author Andrea Gazzarini.
+	 */
+	interface JavaToHtmlAdapter 
+	{
+		/**
+		 * Returns an HTML string representation of the given object.
+		 * 
+		 * @param javaObject the object that needs to be converted.
+		 * @return an html string containing value of the given object.
+		 */
+		String toHtml(Object javaObject);
+	}
+	
+	/**
+	 * Adapter implementation for Map (and subclasses).
+	 */
+	private JavaToHtmlAdapter mapAdapter = new JavaToHtmlAdapter()
+	{
+		@SuppressWarnings("unchecked")
+		public String toHtml(Object javaObject)
+		{
+			Map<String,Object> value = (Map<String, Object>) javaObject;
+
+			// Sanity check : if the map is empty or null there's no need to 
+			// do any convertion
+			if (value == null || value.isEmpty())
+			{
+				return "(empty)";
+			}
+
+			StringBuilder builder = new StringBuilder("<ul>");
+			for (Entry<String, Object> entry : value.entrySet())
+			{
+				builder
+					.append("<li>")
+					.append(entry.getKey())
+					.append(" = ")
+					.append(entry.getValue());
+			}
+			builder.append("</ul>");
+			return builder.toString();
+		}
+	};
+
+	private Map<String, JavaToHtmlAdapter> _adapters = new HashMap<String, JavaToHtmlAdapter>();
+	
+	@Override
+	public void init() throws ServletException
+	{
+		_adapters.put(Map.class.getName(), mapAdapter);
+		_adapters.put(HashMap.class.getName(),mapAdapter);
+		_adapters.put(Properties.class.getName(),mapAdapter);
+		_adapters.put(Hashtable.class.getName(),mapAdapter);
+	}
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+	{
+		String resourceId = null;
+		try 
+		{
+			resourceId = request.getParameter("resourceId");
+			
+			ObjectName objectName = new ObjectName(resourceId);
+			String [] keyProperties = objectName.getKeyPropertyListString().split(",");
+			
+			MBeanServer server = ManagementFactory.getPlatformMBeanServer();
+			
+			MBeanInfo metadata = server.getMBeanInfo(objectName);
+			
+			Map<String, String> attributes = getAttributes(server, objectName,metadata.getAttributes());
+			
+			request.setAttribute("resourceId", objectName);
+			request.setAttribute("metadata",metadata);
+			request.setAttribute("nameAttributes",keyProperties);
+			request.setAttribute("attributes",attributes);
+			
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/jmx_perspective.jsp");
+			dispatcher.forward(request,response);
+		} catch(MalformedObjectNameException exception)
+		{
+			request.setAttribute("errorMessage","Malformed Resource ID : supplied value is "+resourceId);
+			request.setAttribute("exception",exception);
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/error_page.jsp");
+			dispatcher.forward(request,response);			
+			
+		}
+		catch(Exception exception)
+		{
+			request.setAttribute("errorMessage","Unable to detect the exact cause Please look at the reported stack trace below.");
+			request.setAttribute("exception",exception);
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/error_page.jsp");
+			dispatcher.forward(request,response);			
+		}
+	}
+
+	/**
+	 * Starting from an mbean metadata, this method retrieves all the attributes 
+	 * from the corresponding MBean Server.
+	 * 
+	 * @param server the mbean server where the target mbean is registered.
+	 * @param name the name of the target mbean.
+	 * @param metadata the metadata of mbean.
+	 * @return a map containing all attributes of the given mbean.
+	 * @throws Exception when it's not possible to retrieve attributes.
+	 */
+	private Map<String, String> getAttributes(MBeanServer server, ObjectName name, MBeanAttributeInfo [] metadata) throws Exception
+	{
+		Map<String,String> result = new HashMap<String, String>(metadata.length);
+		for (MBeanAttributeInfo attribute : metadata)
+		{
+			Object value = server.getAttribute(name, attribute.getName());
+			result.put(attribute.getName(),getAdaptedValue(attribute.getType(), value));
+		}
+		return result;
+	}
+	
+	/**
+	 * Converts the given attribute value in a html string format.
+	 *  
+	 * @param type the java type of the given attribute value.
+	 * @param value the attribute value.
+	 * @return a html string format of the given value.
+	 */
+	private String getAdaptedValue(String type, Object value) 
+	{
+		JavaToHtmlAdapter adapter = _adapters.get(type);
+		return (adapter != null) ? adapter.toHtml(value) : String.valueOf(value);
+	}
+}
\ No newline at end of file

Added: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/LoggingConfigurationAction.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/LoggingConfigurationAction.java?rev=741032&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/LoggingConfigurationAction.java (added)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/LoggingConfigurationAction.java Thu Feb  5 07:22:17 2009
@@ -0,0 +1,114 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.management.web.action;
+
+import java.io.IOException;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.qpid.qman.debug.WsdlDebugger;
+import org.apache.qpid.qman.debug.XmlDebugger;
+
+/**
+ * Logging configuration controller.
+ * Accepts input parameters from admin console and configure the underlying
+ * logging subsystem at runtime.
+ * 
+ * @author Andrea Gazzarini
+ */
+public class LoggingConfigurationAction extends HttpServlet
+{
+	private static final long serialVersionUID = 633352305870632824L;
+
+	private final static String WSDL_DEBUG_ENABLED_PARAM = "wsdlDebugEnabled";
+	private final static String SOAP_DEBUG_ENABLED_PARAM = "soapDebugEnabled";
+	private final static String WEB_SERVER_LOG_LEVEL_PARAM = "webServerLogLevel";
+	private final static String QMAN_LOG_LEVEL_PARAM = "qmanLogLevel";
+	
+	private final static String WEB_SERVER_PACKAGE = "org.mortbay";
+	private final static String QMAN_PACKAGE = "org.qpid.apache.management";
+	
+	/**
+	 * Retrieves current logging configuration and forward those data to the logging configuration view page.
+	 * In this way that page will be able to display the current logging settings.
+	 * 
+	 * @param request the http request.
+	 * @param response the http response.
+	 * @throws ServletException when this controller is not able to forward to the appropriate view page.
+	 * @throws IOException when this controller is not able to forward to the appropriate view page.
+	 */
+	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+	{
+		Level messageDebuggerLogLevel = Logger.getLogger(XmlDebugger.class).getEffectiveLevel();
+		Level wsdlDebuggerLogLevel = Logger.getLogger(WsdlDebugger.class).getEffectiveLevel();		
+		Level webServerLogLevel = Logger.getLogger(WEB_SERVER_PACKAGE).getEffectiveLevel();		
+		Level qmanLogLevel = Logger.getLogger(QMAN_PACKAGE).getEffectiveLevel();		
+		
+		request.setAttribute(WSDL_DEBUG_ENABLED_PARAM,wsdlDebuggerLogLevel.equals(Level.DEBUG));
+		request.setAttribute(SOAP_DEBUG_ENABLED_PARAM,messageDebuggerLogLevel.equals(Level.DEBUG));
+		request.setAttribute(WEB_SERVER_LOG_LEVEL_PARAM,webServerLogLevel);
+		request.setAttribute(QMAN_LOG_LEVEL_PARAM,qmanLogLevel);		
+		
+		RequestDispatcher dispatcher = request.getRequestDispatcher("/logging_configuration.jsp");
+		dispatcher.forward(request, response);
+	}
+	
+	/**
+	 * Accepts user data coming from admin console and use it for configure the underlying logging 
+	 * subsystem.
+	 * 
+	 * @param request the http request.
+	 * @param response the http response.
+	 * @throws ServletException when this controller is not able to forward to the appropriate view page.
+	 * @throws IOException when this controller is not able to forward to the appropriate view page.
+	 */
+	@Override
+	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+	{
+		String wsdlDebugEnabled = request.getParameter(WSDL_DEBUG_ENABLED_PARAM);
+		String soapDebugEnabled = request.getParameter(SOAP_DEBUG_ENABLED_PARAM);
+		
+		String qmanLevel = request.getParameter(QMAN_LOG_LEVEL_PARAM);
+		String serverLevel = request.getParameter(WEB_SERVER_LOG_LEVEL_PARAM);
+		
+		Logger.getLogger(WEB_SERVER_PACKAGE).setLevel(Level.toLevel(serverLevel));
+		Logger.getLogger(QMAN_PACKAGE).setLevel(Level.toLevel(qmanLevel));
+		
+		Logger.getLogger(WsdlDebugger.class).setLevel(
+				"on".equals(wsdlDebugEnabled)
+					? Level.DEBUG
+					: Level.INFO);
+
+		Logger.getLogger(XmlDebugger.class).setLevel(
+				"on".equals(soapDebugEnabled)
+					? Level.DEBUG
+					: Level.INFO);
+		
+		doGet(request, response);
+	}
+}
+	
\ No newline at end of file

Added: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ResourcesManagementAction.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ResourcesManagementAction.java?rev=741032&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ResourcesManagementAction.java (added)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/ResourcesManagementAction.java Thu Feb  5 07:22:17 2009
@@ -0,0 +1,91 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.management.web.action;
+
+import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.util.List;
+import java.util.Set;
+
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.qpid.management.Names;
+import org.apache.qpid.management.domain.services.ManagementClient;
+import org.apache.qpid.management.domain.services.QMan;
+
+/**
+ * This controller retrieves from QMan all the registered resources and organize
+ * that data in a model that is then forwarded to the appropriate view page.
+ * 
+ * TODO : In the corresponding view page only one broker is displayed.
+ * A query should be made on QMan mbean in order to retrieve all connected broker and therefore
+ * a model for each of them should be created. 
+ * In the corresponding weg page there should be a "tab" for each broker. Each tab should show only
+ * the objects belonging to that broker.
+ * 
+ * @author Andrea Gazzarini
+ */
+public class ResourcesManagementAction extends HttpServlet
+{
+	private static final long serialVersionUID = -2411413147821629363L;
+	 
+	@SuppressWarnings("unchecked")
+	@Override
+	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+	{
+		try 
+		{	
+			QMan qman = (QMan)getServletContext().getAttribute(Names.APPLICATION_NAME);
+			List<ManagementClient> managementClient = qman.getManagementClients();
+			
+			if (!managementClient.isEmpty())
+			{
+				BrokerModel model = new BrokerModel();
+				model.setId(managementClient.toString());
+				
+				MBeanServer mxServer = ManagementFactory.getPlatformMBeanServer();
+				Set<ObjectName> objectNames = mxServer.queryNames(new ObjectName("Q-MAN:*"), null);
+				for (ObjectName objectName : objectNames)
+				{
+					model.addObject(objectName);
+				}
+	
+				request.setAttribute("model", model);		
+			}
+			
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/resources_management.jsp");
+			dispatcher.forward(request,response);
+		} catch(MalformedObjectNameException exception)
+		{
+			request.setAttribute("errorMessage","Unable to detect the exact cause Please look at the reported stack trace below.");
+			request.setAttribute("exception",exception);
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/error_page.jsp");
+			dispatcher.forward(request,response);			
+		}
+	}
+}

Added: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmOperationsPerspectiveAction.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmOperationsPerspectiveAction.java?rev=741032&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmOperationsPerspectiveAction.java (added)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmOperationsPerspectiveAction.java Thu Feb  5 07:22:17 2009
@@ -0,0 +1,191 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.management.web.action;
+
+import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Map.Entry;
+
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanInfo;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.namespace.QName;
+
+import org.apache.muse.core.proxy.ProxyHandler;
+import org.apache.muse.core.proxy.ReflectionProxyHandler;
+import org.apache.muse.ws.addressing.EndpointReference;
+import org.apache.qpid.management.Names;
+import org.w3c.dom.Element;
+
+/**
+ * This controller is responsible to retirve operations metadata from a WS-Resource.
+ * That metadat will be forwarded and used by the corresponding view page. 
+ * 
+ * TODO : This is not really showing WS metadata. Insted JMX metadata is used here.
+ * 
+ * @author Andrea Gazzarini
+ *
+ */
+public class WsdmOperationsPerspectiveAction extends HttpServlet
+{
+	private static final long serialVersionUID = -2411413147821629363L;
+	
+	private ProxyHandler proxyHandler;
+	
+	interface JavaToHtmlAdapter 
+	{
+		String toHtml(Object javaObject);
+	}
+	
+	private URI resourceUri;
+	
+	private JavaToHtmlAdapter mapAdapter = new JavaToHtmlAdapter()
+	{
+		@SuppressWarnings("unchecked")
+		public String toHtml(Object javaObject)
+		{
+			Map<String,Object> value = (Map<String, Object>) javaObject;
+
+			if (value == null || value.isEmpty())
+			{
+				return "(empty)";
+			}
+			
+			StringBuilder builder = new StringBuilder();
+			builder.append("<ul>");
+			for (Entry<String, Object> entry : value.entrySet())
+			{
+				builder
+					.append("<li>")
+					.append(entry.getKey())
+					.append(" = ")
+					.append(entry.getValue());
+			}
+			builder.append("</ul>");
+			return builder.toString();
+		}
+	};
+	
+	private Map<String, JavaToHtmlAdapter> adapters = new HashMap<String, JavaToHtmlAdapter>();
+	
+	@Override
+	public void init() throws ServletException
+	{
+		adapters.put(Map.class.getName(), mapAdapter);
+		adapters.put(HashMap.class.getName(),mapAdapter);
+		adapters.put(Properties.class.getName(),mapAdapter);
+		adapters.put(Hashtable.class.getName(),mapAdapter);
+		
+		proxyHandler  = new ReflectionProxyHandler();
+		proxyHandler.setAction("http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata");
+		proxyHandler.setRequestName(new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "GetMetadata", Names.PREFIX));
+		proxyHandler.setRequestParameterNames(new QName[]{new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "Dialect", Names.PREFIX)});
+		proxyHandler.setResponseName(new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "Metadata", Names.PREFIX));
+		proxyHandler.setReturnType(Element[].class);
+	}
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+	{
+		try 
+		{
+			String resourceId = request.getParameter("resourceId");
+			ObjectName objectName = new ObjectName(resourceId);
+			String wsdmResourceId = objectName.getKeyProperty(Names.OBJECT_ID);
+			
+			EndpointReference resourceEndpointReference = new EndpointReference(getURI(request));
+			resourceEndpointReference.addParameter(
+					Names.RESOURCE_ID_QNAME, 
+					wsdmResourceId);
+			
+//			WsResourceClient resourceClient = new WsResourceClient(resourceEndpointReference);
+//			Element wsdl = ((Element[])resourceClient.invoke(proxyHandler,WSDL_DIALECT))[0];
+//			Element rmd = ((Element[])resourceClient.invoke(proxyHandler,RMD_DIALECT))[0];
+						
+			String [] keyProperties = objectName.getKeyPropertyListString().split(",");
+			MBeanServer server = ManagementFactory.getPlatformMBeanServer();
+			
+			MBeanInfo metadata = server.getMBeanInfo(objectName);
+			
+			Map<String, String> attributes = getAttributes(server, objectName,metadata.getAttributes());
+			
+			request.setAttribute("resourceId", resourceId);
+			request.setAttribute("metadata",metadata);
+			request.setAttribute("nameAttributes",keyProperties);
+			request.setAttribute("attributes",attributes);
+			
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/wsdm_operations_perspective.jsp");
+			dispatcher.forward(request,response);
+		} catch(Exception exception)
+		{
+			request.setAttribute("errorMessage","Unable to detect the exact cause Please look at the reported stack trace below.");
+			request.setAttribute("exception",exception);
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/error_page.jsp");
+			dispatcher.forward(request,response);			
+		}
+	}
+
+	private URI getURI(HttpServletRequest request)
+	{
+		if (resourceUri == null)
+		{
+			StringBuilder builder = new StringBuilder();
+			builder
+				.append(request.getProtocol())
+				.append("//")
+				.append(request.getServerName())
+				.append(":")
+				.append(request.getServerPort())
+				.append("/qman/services/QManWsResource");
+			resourceUri = URI.create(builder.toString());
+		}
+		return resourceUri;
+	}
+
+	private Map<String, String> getAttributes(MBeanServer server, ObjectName name, MBeanAttributeInfo [] metadata) throws Exception
+	{
+		Map<String,String> result = new HashMap<String, String>(metadata.length);
+		for (MBeanAttributeInfo attribute : metadata)
+		{
+			Object value = server.getAttribute(name, attribute.getName());
+			result.put(attribute.getName(),getAdaptedValue(attribute.getType(), value));
+		}
+		return result;
+	}
+	
+	private String getAdaptedValue(String type, Object value) 
+	{
+		JavaToHtmlAdapter adapter = adapters.get(type);
+		return (adapter != null) ? adapter.toHtml(value) : String.valueOf(value);
+	}
+}
\ No newline at end of file

Added: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmPropertiesPerspectiveAction.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmPropertiesPerspectiveAction.java?rev=741032&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmPropertiesPerspectiveAction.java (added)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmPropertiesPerspectiveAction.java Thu Feb  5 07:22:17 2009
@@ -0,0 +1,188 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.management.web.action;
+
+import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Map.Entry;
+
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanInfo;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.namespace.QName;
+
+import org.apache.muse.core.proxy.ProxyHandler;
+import org.apache.muse.core.proxy.ReflectionProxyHandler;
+import org.apache.muse.ws.addressing.EndpointReference;
+import org.apache.muse.ws.resource.remote.WsResourceClient;
+import org.apache.qpid.management.Names;
+import org.w3c.dom.Element;
+
+public class WsdmPropertiesPerspectiveAction extends HttpServlet
+{
+	private static final long serialVersionUID = -2411413147821629363L;
+	private static final Object [] WSDL_DIALECT = new Object[]{"http://schemas.xmlsoap.org/wsdl/"};
+	private static final Object [] RMD_DIALECT = new Object[]{"http://docs.oasis-open.org/wsrf/rmd-1"};
+	
+	private ProxyHandler proxyHandler;
+	
+	interface JavaToHtmlAdapter 
+	{
+		String toHtml(Object javaObject);
+	}
+	
+	private URI resourceUri;
+	
+	private JavaToHtmlAdapter mapAdapter = new JavaToHtmlAdapter()
+	{
+		@SuppressWarnings("unchecked")
+		public String toHtml(Object javaObject)
+		{
+			Map<String,Object> value = (Map<String, Object>) javaObject;
+
+			if (value == null || value.isEmpty())
+			{
+				return "(empty)";
+			}
+			
+			StringBuilder builder = new StringBuilder();
+			builder.append("<ul>");
+			for (Entry<String, Object> entry : value.entrySet())
+			{
+				builder
+					.append("<li>")
+					.append(entry.getKey())
+					.append(" = ")
+					.append(entry.getValue());
+			}
+			builder.append("</ul>");
+			return builder.toString();
+		}
+	};
+	
+	private Map<String, JavaToHtmlAdapter> adapters = new HashMap<String, JavaToHtmlAdapter>();
+	
+	@Override
+	public void init() throws ServletException
+	{
+		adapters.put(Map.class.getName(), mapAdapter);
+		adapters.put(HashMap.class.getName(),mapAdapter);
+		adapters.put(Properties.class.getName(),mapAdapter);
+		adapters.put(Hashtable.class.getName(),mapAdapter);
+		
+		proxyHandler  = new ReflectionProxyHandler();
+		proxyHandler.setAction("http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata");
+		proxyHandler.setRequestName(new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "GetMetadata", Names.PREFIX));
+		proxyHandler.setRequestParameterNames(new QName[]{new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "Dialect", Names.PREFIX)});
+		proxyHandler.setResponseName(new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "Metadata", Names.PREFIX));
+		proxyHandler.setReturnType(Element[].class);
+	}
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+	{
+		try 
+		{
+			String resourceId = request.getParameter("resourceId");
+			ObjectName objectName = new ObjectName(resourceId);
+			
+			String wsresourceid = objectName.getKeyProperty(Names.OBJECT_ID);
+			
+			EndpointReference resourceEndpointReference = new EndpointReference(getURI(request));
+			resourceEndpointReference.addParameter(
+					Names.RESOURCE_ID_QNAME, 
+					wsresourceid);
+			
+//			WsResourceClient resourceClient = new WsResourceClient(resourceEndpointReference);
+//			Element wsdl = ((Element[])resourceClient.invoke(proxyHandler,WSDL_DIALECT))[0];
+//			Element rmd = ((Element[])resourceClient.invoke(proxyHandler,RMD_DIALECT))[0];
+						
+			String [] keyProperties = objectName.getKeyPropertyListString().split(",");
+			
+			
+			MBeanServer server = ManagementFactory.getPlatformMBeanServer();
+			
+			MBeanInfo metadata = server.getMBeanInfo(objectName);
+			
+			Map<String, String> attributes = getAttributes(server, objectName,metadata.getAttributes());
+			
+			request.setAttribute("resourceId", resourceId);
+			request.setAttribute("metadata",metadata);
+			request.setAttribute("nameAttributes",keyProperties);
+			request.setAttribute("attributes",attributes);
+			
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/wsdm_properties_perspective.jsp");
+			dispatcher.forward(request,response);
+		} catch(Exception exception)
+		{
+			request.setAttribute("errorMessage","Unable to detect the exact cause Please look at the reported stack trace below.");
+			request.setAttribute("exception",exception);
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/error_page.jsp");
+			dispatcher.forward(request,response);			
+		}
+	}
+
+	private URI getURI(HttpServletRequest request)
+	{
+		if (resourceUri == null)
+		{
+			StringBuilder builder = new StringBuilder();
+			builder
+				.append(request.getProtocol())
+				.append("//")
+				.append(request.getServerName())
+				.append(":")
+				.append(request.getServerPort())
+				.append("/qman/services/QManWsResource");
+			resourceUri = URI.create(builder.toString());
+		}
+		return resourceUri;
+	}
+
+	private Map<String, String> getAttributes(MBeanServer server, ObjectName name, MBeanAttributeInfo [] metadata) throws Exception
+	{
+		Map<String,String> result = new HashMap<String, String>(metadata.length);
+		for (MBeanAttributeInfo attribute : metadata)
+		{
+			Object value = server.getAttribute(name, attribute.getName());
+			result.put(attribute.getName(),getAdaptedValue(attribute.getType(), value));
+		}
+		return result;
+	}
+	
+	private String getAdaptedValue(String type, Object value) 
+	{
+		JavaToHtmlAdapter adapter = adapters.get(type);
+		return (adapter != null) ? adapter.toHtml(value) : String.valueOf(value);
+	}
+}
\ No newline at end of file

Added: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmRmdPerspectiveAction.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmRmdPerspectiveAction.java?rev=741032&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmRmdPerspectiveAction.java (added)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmRmdPerspectiveAction.java Thu Feb  5 07:22:17 2009
@@ -0,0 +1,113 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.management.web.action;
+
+import java.io.IOException;
+import java.net.URI;
+
+import javax.management.ObjectName;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.namespace.QName;
+
+import org.apache.muse.core.proxy.ProxyHandler;
+import org.apache.muse.core.proxy.ReflectionProxyHandler;
+import org.apache.muse.util.xml.XmlUtils;
+import org.apache.muse.ws.addressing.EndpointReference;
+import org.apache.muse.ws.resource.remote.WsResourceClient;
+import org.apache.qpid.management.Names;
+import org.w3c.dom.Element;
+
+public class WsdmRmdPerspectiveAction extends HttpServlet
+{
+	private static final long serialVersionUID = -2411413147821629363L;
+	private static final Object [] DIALECT = new Object[]{"http://docs.oasis-open.org/wsrf/rmd-1"};
+	
+	private ProxyHandler proxyHandler;
+	
+	private URI resourceUri;
+		
+	@Override
+	public void init() throws ServletException
+	{
+		proxyHandler  = new ReflectionProxyHandler();
+		proxyHandler.setAction("http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata");
+		proxyHandler.setRequestName(new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "GetMetadata", Names.PREFIX));
+		proxyHandler.setRequestParameterNames(new QName[]{new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "Dialect", Names.PREFIX)});
+		proxyHandler.setResponseName(new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "Metadata", Names.PREFIX));
+		proxyHandler.setReturnType(Element[].class);
+	}
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+	{
+		try 
+		{
+//			String resourceId = request.getParameter("resourceId");
+//			ObjectName objectName = new ObjectName(resourceId);
+//			
+//			String wsresourceid = objectName.getKeyProperty(Names.OBJECT_ID);
+//			EndpointReference resourceEndpointReference = new EndpointReference(getURI(request));
+//			resourceEndpointReference.addParameter(
+//					Names.RESOURCE_ID_QNAME, 
+//					wsresourceid);
+//			
+//			WsResourceClient resourceClient = new WsResourceClient(resourceEndpointReference);
+//			Element rmd = ((Element[])resourceClient.invoke(proxyHandler,DIALECT))[0];
+//						        		
+//        	String output = XmlUtils.toString(rmd);
+//        	
+//			String [] keyProperties = objectName.getKeyPropertyListString().split(",");
+//			
+//			request.setAttribute("resourceId", objectName);
+//			request.setAttribute("nameAttributes",keyProperties);
+//			request.setAttribute("rmd",output);
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/tbd.jsp");
+			dispatcher.forward(request,response); 
+		} catch(Exception exception)
+		{
+			request.setAttribute("errorMessage","Unable to detect the exact cause Please look at the reported stack trace below.");
+			request.setAttribute("exception",exception);
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/error_page.jsp");
+			dispatcher.forward(request,response);			
+		}
+	}
+
+	private URI getURI(HttpServletRequest request)
+	{
+		if (resourceUri == null)
+		{
+			StringBuilder builder = new StringBuilder();
+			builder
+				.append("http://")
+				.append(request.getServerName())
+				.append(":")
+				.append(request.getServerPort())
+				.append("/qman/services/QManWsResource");
+			resourceUri = URI.create(builder.toString());
+		}
+		return resourceUri;
+	}
+}
\ No newline at end of file

Added: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmWsdlPerspectiveAction.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmWsdlPerspectiveAction.java?rev=741032&view=auto
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmWsdlPerspectiveAction.java (added)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/web/action/WsdmWsdlPerspectiveAction.java Thu Feb  5 07:22:17 2009
@@ -0,0 +1,134 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.management.web.action;
+
+import java.io.IOException;
+import java.net.URI;
+
+import javax.management.ObjectName;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.namespace.QName;
+
+import org.apache.muse.core.proxy.ProxyHandler;
+import org.apache.muse.core.proxy.ReflectionProxyHandler;
+import org.apache.muse.util.xml.XmlUtils;
+import org.apache.muse.ws.addressing.EndpointReference;
+import org.apache.muse.ws.resource.remote.WsResourceClient;
+import org.apache.qpid.management.Names;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class WsdmWsdlPerspectiveAction extends HttpServlet
+{
+	private static final long serialVersionUID = -2411413147821629363L;
+	private static final Object [] WSDL_DIALECT = new Object[]{"http://schemas.xmlsoap.org/wsdl/"};
+	
+	private ProxyHandler proxyHandler;
+	
+	private URI resourceUri;
+		
+	@Override
+	public void init() throws ServletException
+	{
+		proxyHandler  = new ReflectionProxyHandler();
+		proxyHandler.setAction("http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata");
+		proxyHandler.setRequestName(new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "GetMetadata", Names.PREFIX));
+		proxyHandler.setRequestParameterNames(new QName[]{new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "Dialect", Names.PREFIX)});
+		proxyHandler.setResponseName(new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "Metadata", Names.PREFIX));
+		proxyHandler.setReturnType(Element[].class);
+	}
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+	{
+		try 
+		{
+			String resourceId = request.getParameter("resourceId");
+			ObjectName objectName = new ObjectName(resourceId);
+
+			String wsresourceid = objectName.getKeyProperty(Names.OBJECT_ID);
+			EndpointReference resourceEndpointReference = new EndpointReference(getURI(request));
+			resourceEndpointReference.addParameter(
+					Names.RESOURCE_ID_QNAME, 
+					wsresourceid);
+			
+			WsResourceClient resourceClient = new WsResourceClient(resourceEndpointReference);
+			Element wsdl = ((Element[])resourceClient.invoke(proxyHandler,WSDL_DIALECT))[0];
+						
+        	NodeList nodelist = wsdl.getChildNodes();
+        	Element definitions = null;
+        	for (int i = 0; i < nodelist.getLength(); i++)
+        	{
+        		Node node = nodelist.item(i);
+        		switch (node.getNodeType())
+        		{
+        			case Node.ELEMENT_NODE:
+        			{
+        				Element element = (Element) node;
+        				if (element.getNodeName().indexOf("definitions") != -1)
+        				{
+        					definitions = element;
+        					break;
+        				}
+        			}
+        		}
+        	}
+        		
+        	String output = XmlUtils.toString(definitions);
+        	
+			String [] keyProperties = objectName.getKeyPropertyListString().split(",");
+			
+			request.setAttribute("resourceId", resourceId);
+			request.setAttribute("nameAttributes",keyProperties);
+			request.setAttribute("wsdl",output);
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/wsdm_wsdl_perspective.jsp");
+			dispatcher.forward(request,response); 
+		} catch(Exception exception)
+		{			
+			request.setAttribute("errorMessage","Unable to detect the exact cause Please look at the reported stack trace below.");
+			request.setAttribute("exception",exception);
+			RequestDispatcher dispatcher = request.getRequestDispatcher("/error_page.jsp");
+			dispatcher.forward(request,response);			
+		}
+	}
+
+	private URI getURI(HttpServletRequest request)
+	{
+		if (resourceUri == null)
+		{
+			StringBuilder builder = new StringBuilder();
+			builder
+				.append("http://")
+				.append(request.getServerName())
+				.append(":")
+				.append(request.getServerPort())
+				.append("/qman/services/QManWsResource");
+			resourceUri = URI.create(builder.toString());
+		}
+		return resourceUri;
+	}
+}
\ No newline at end of file

Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/capabilities/QManAdapterCapability.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/capabilities/QManAdapterCapability.java?rev=741032&r1=741031&r2=741032&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/capabilities/QManAdapterCapability.java (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/capabilities/QManAdapterCapability.java Thu Feb  5 07:22:17 2009
@@ -163,14 +163,14 @@
 			EndpointReference endpointPointReference = new EndpointReference(_resourceURI);			
 			endpointPointReference.addParameter(
 					Names.RESOURCE_ID_QNAME, 
-					eventSourceName.getCanonicalName());
+					eventSourceName.getKeyProperty(Names.OBJECT_ID));
 			
 			ResourceManager resourceManager = getResource().getResourceManager();
 			try 
 			{
 				Resource resource = resourceManager.getResource(endpointPointReference);
 				resource.shutdown();
-				
+					
 				LOGGER.info(
 						Messages.QMAN_000031_RESOURCE_HAS_BEEN_REMOVED, 
 						eventSourceName);

Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/common/ObjectNameIdFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/common/ObjectNameIdFactory.java?rev=741032&r1=741031&r2=741032&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/common/ObjectNameIdFactory.java (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/common/ObjectNameIdFactory.java Thu Feb  5 07:22:17 2009
@@ -20,6 +20,7 @@
  */
 package org.apache.qpid.management.wsdm.common;
 
+import javax.management.ObjectName;
 import javax.xml.namespace.QName;
 
 import org.apache.muse.core.routing.ResourceIdFactory;
@@ -54,6 +55,7 @@
 	 */
 	public String getNextIdentifier() 
 	{
-		return ThreadSessionManager.getInstance().getSession().getObjectName().getCanonicalName();
+		ObjectName objectName = ThreadSessionManager.getInstance().getSession().getObjectName();
+		return objectName.getKeyProperty(Names.OBJECT_ID);
 	}
 }
\ No newline at end of file

Modified: qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.wsdl
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.wsdl?rev=741032&r1=741031&r2=741032&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.wsdl (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.wsdl Thu Feb  5 07:22:17 2009
@@ -536,7 +536,7 @@
 	</wsdl:binding>
 	<wsdl:service name="QManWsResourceService">
     	<wsdl:port name="QManWsResourcePort" binding="qman:QManWsResourceBinding">
-    		<wsdl-soap:address location="http://localhost:8080/qman/wsresource"/>
+    		<wsdl-soap:address location="http://localhost:8080/qman/services/QManWsResource"/>
     	</wsdl:port>
 	</wsdl:service>
 </wsdl:definitions>
\ No newline at end of file



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org