servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r468730 - in /incubator/servicemix/trunk/servicemix-web-console/src/main: java/org/apache/servicemix/web/ resources/ webapp/WEB-INF/ webapp/styles/
Date Sat, 28 Oct 2006 19:52:08 GMT
Author: gnodet
Date: Sat Oct 28 12:52:07 2006
New Revision: 468730

URL: http://svn.apache.org/viewvc?view=rev&rev=468730
Log:
Use spring 2.0 xsds, fix css, externalize jmx properties.
Allow the web app to start even if jdbc auditor or dot service are not configured

Added:
    incubator/servicemix/trunk/servicemix-web-console/src/main/resources/servicemix-web-console.properties
Modified:
    incubator/servicemix/trunk/servicemix-web-console/src/main/java/org/apache/servicemix/web/Auditor.java
    incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/applicationContext.xml
    incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/dispatcher-servlet.xml
    incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/web.xml
    incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/styles/style.css

Modified: incubator/servicemix/trunk/servicemix-web-console/src/main/java/org/apache/servicemix/web/Auditor.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-web-console/src/main/java/org/apache/servicemix/web/Auditor.java?view=diff&rev=468730&r1=468729&r2=468730
==============================================================================
--- incubator/servicemix/trunk/servicemix-web-console/src/main/java/org/apache/servicemix/web/Auditor.java
(original)
+++ incubator/servicemix/trunk/servicemix-web-console/src/main/java/org/apache/servicemix/web/Auditor.java
Sat Oct 28 12:52:07 2006
@@ -1,28 +1,37 @@
+/*
+ * 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.servicemix.web;
 
-import java.io.IOException;
 import java.net.URI;
 import java.text.DateFormat;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import javax.jbi.messaging.MessageExchange;
-import javax.jbi.messaging.MessagingException;
 import javax.jbi.messaging.NormalizedMessage;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
 
 import org.apache.servicemix.JbiConstants;
 import org.apache.servicemix.jbi.audit.AuditorException;
 import org.apache.servicemix.jbi.audit.AuditorMBean;
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
 import org.apache.servicemix.jbi.messaging.MessageExchangeSupport;
-import org.xml.sax.SAXException;
 
 public class Auditor {
 
@@ -52,7 +61,6 @@
     
     public int getCount() throws AuditorException {
         int count = mbean.getExchangeCount();
-        System.err.println(count);
         return count;
     }
 
@@ -176,6 +184,7 @@
         public MessageInfo(NormalizedMessage message) {
             this.message = message;
         }
+        @SuppressWarnings("unchecked")
         public String getProperties() {
             StringBuilder sb = new StringBuilder();
             for (String name : (Set<String>) message.getPropertyNames()) {

Added: incubator/servicemix/trunk/servicemix-web-console/src/main/resources/servicemix-web-console.properties
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-web-console/src/main/resources/servicemix-web-console.properties?view=auto&rev=468730
==============================================================================
--- incubator/servicemix/trunk/servicemix-web-console/src/main/resources/servicemix-web-console.properties
(added)
+++ incubator/servicemix/trunk/servicemix-web-console/src/main/resources/servicemix-web-console.properties
Sat Oct 28 12:52:07 2006
@@ -0,0 +1,7 @@
+jmx-service-url=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
+jmx-username=smx
+jmx-password=smx
+jdbc-auditor-mbean-name=org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=JdbcAuditor
+admin-commands-service-mbean-name=org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=AdminCommandsService
+registry-mbean-service-name=org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=Registry
+dot-view-mbean-service-name=org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=DotViewService
\ No newline at end of file

Modified: incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/applicationContext.xml?view=diff&rev=468730&r1=468729&r2=468730
==============================================================================
--- incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/applicationContext.xml
(original)
+++ incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/applicationContext.xml
Sat Oct 28 12:52:07 2006
@@ -15,53 +15,55 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
-<beans>
-
-  <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
/>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans 
+                           http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+  
+  <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+    <property name="location" value="classpath:servicemix-web-console.properties" />
+  </bean>
   
   <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
   </bean>
   
   <bean id="server" class="org.springframework.jmx.support.MBeanServerConnectionFactoryBean">
-    <property name="serviceUrl" value="service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"
/>
+    <property name="serviceUrl" value="${jmx-service-url}" />
     <property name="environmentMap">
       <map>
         <entry key="jmx.remote.credentials">
           <bean class="org.springframework.util.StringUtils" factory-method="commaDelimitedListToStringArray">
-            <constructor-arg value="smx,smx" />
+            <constructor-arg value="${jmx-username},${jmx-password}" />
           </bean>
         </entry>
       </map>
-    </property>
+    </property>
+  </bean>
+  
+  <bean id="jmxProxy" abstract="true" class="org.springframework.jmx.access.MBeanProxyFactoryBean">
+    <property name="server" ref="server"/>
+    <property name="useStrictCasing" value="false" />
+    <property name="connectOnStartup" value="false" />
   </bean>
   
-  <bean id="jdbcAuditorMBean" class="org.springframework.jmx.access.MBeanProxyFactoryBean">
-    <property name="objectName" value="org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=JdbcAuditor"
/>
+  <bean id="jdbcAuditorMBean" parent="jmxProxy">
+    <property name="objectName" value="${jdbc-auditor-mbean-name}" />
     <property name="proxyInterface" value="org.apache.servicemix.jbi.audit.AuditorMBean"
/>
-    <property name="server" ref="server"/>
-    <property name="useStrictCasing" value="false" />
   </bean>
   
-  <bean id="adminCommandsServiceMBean" class="org.springframework.jmx.access.MBeanProxyFactoryBean">
-    <property name="objectName" value="org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=AdminCommandsService"
/>
+  <bean id="adminCommandsServiceMBean" parent="jmxProxy">
+    <property name="objectName" value="${admin-commands-service-mbean-name}" />
     <property name="proxyInterface" value="org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean"
/>
-    <property name="server" ref="server"/>
-    <property name="useStrictCasing" value="false" />
   </bean>
   
-  <bean id="registryMBean" class="org.springframework.jmx.access.MBeanProxyFactoryBean">
-    <property name="objectName" value="org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=Registry"
/>
+  <bean id="registryMBean" parent="jmxProxy">
+    <property name="objectName" value="${registry-mbean-service-name}" />
     <property name="proxyInterface" value="org.apache.servicemix.jbi.framework.RegistryMBean"
/>
-    <property name="server" ref="server"/>
-    <property name="useStrictCasing" value="false" />
   </bean>
   
-  <bean id="dotViewServiceMBean" class="org.springframework.jmx.access.MBeanProxyFactoryBean">
-    <property name="objectName" value="org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=DotViewService"
/>
+  <bean id="dotViewServiceMBean" parent="jmxProxy">
+    <property name="objectName" value="${dot-view-mbean-service-name}" />
     <property name="proxyInterface" value="org.apache.servicemix.jbi.view.DotViewServiceMBean"
/>
-    <property name="server" ref="server"/>
-    <property name="useStrictCasing" value="false" />
   </bean>
   
   <bean id="proxyManager" class="org.apache.servicemix.web.model.ProxyManager">
@@ -73,16 +75,16 @@
     <constructor-arg ref="registryMBean" />
   </bean>
   
-  <bean id="auditor" class="org.apache.servicemix.web.Auditor" singleton="false">
+  <bean id="auditor" class="org.apache.servicemix.web.Auditor" scope="prototype">
     <constructor-arg ref="jdbcAuditorMBean" />
   </bean>
-  <bean id="components" factory-bean="registry" factory-method="getComponents" singleton="false"
/>
-  <bean id="endpoints" factory-bean="registry" factory-method="getEndpoints" singleton="false"
/>
-  <bean id="serviceAssemblies" factory-bean="registry" factory-method="getServiceAssemblies"
singleton="false" />
-  <bean id="serviceUnits" factory-bean="registry" factory-method="getServiceUnits" singleton="false"
/>
-  <bean id="sharedLibraries" factory-bean="registry" factory-method="getSharedLibraries"
singleton="false" />
+  <bean id="components" factory-bean="registry" factory-method="getComponents" scope="prototype"
/>
+  <bean id="endpoints" factory-bean="registry" factory-method="getEndpoints" scope="prototype"
/>
+  <bean id="serviceAssemblies" factory-bean="registry" factory-method="getServiceAssemblies"
scope="prototype" />
+  <bean id="serviceUnits" factory-bean="registry" factory-method="getServiceUnits" scope="prototype"
/>
+  <bean id="sharedLibraries" factory-bean="registry" factory-method="getSharedLibraries"
scope="prototype" />
   <bean id="component" class="org.apache.servicemix.web.ComponentFactoryBean">
-    <property name="registry" ref="registry" />
+    <property name="registry" ref="registry" />
   </bean>
   <bean id="endpoint" class="org.apache.servicemix.web.EndpointFactoryBean">
     <property name="registry" ref="registry" />

Modified: incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/dispatcher-servlet.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/dispatcher-servlet.xml?view=diff&rev=468730&r1=468729&r2=468730
==============================================================================
--- incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/dispatcher-servlet.xml
(original)
+++ incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/dispatcher-servlet.xml
Sat Oct 28 12:52:07 2006
@@ -15,76 +15,81 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
-<beans>
-
-  <bean id="handlerMapping" class="org.apache.servicemix.web.handler.BindingBeanNameUrlHandlerMapping"
singleton="false" />
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans 
+                           http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+  
+  <bean id="handlerMapping" class="org.apache.servicemix.web.handler.BindingBeanNameUrlHandlerMapping"
/>
 
-  <bean name="/installComponent.action" class="org.apache.servicemix.web.controller.InstallComponent"
autowire="constructor"  singleton="false">
+  <bean name="/installComponent.action" class="org.apache.servicemix.web.controller.InstallComponent"
scope="request">
+    <constructor-arg ref="adminCommandsServiceMBean" />
     <property name="commandClass" value="org.apache.servicemix.web.controller.FileUploadBean"
/>
     <property name="formView" value="redirect:/components.jsp" />
     <property name="successView" value="redirect:/components.jsp" />
   </bean>
-  <bean name="/startComponent.action" class="org.apache.servicemix.web.controller.ComponentLifeCycle"
singleton="false">
+  <bean name="/startComponent.action" class="org.apache.servicemix.web.controller.ComponentLifeCycle"
scope="request">
     <constructor-arg ref="adminCommandsServiceMBean" />
     <constructor-arg value="start" />
     <property name="view" value="redirect:/components.jsp" />
   </bean>
-  <bean name="/stopComponent.action" class="org.apache.servicemix.web.controller.ComponentLifeCycle"
singleton="false">
+  <bean name="/stopComponent.action" class="org.apache.servicemix.web.controller.ComponentLifeCycle"
scope="request">
     <constructor-arg ref="adminCommandsServiceMBean" />
     <constructor-arg value="stop" />
     <property name="view" value="redirect:/components.jsp" />
   </bean>
-  <bean name="/shutdownComponent.action" class="org.apache.servicemix.web.controller.ComponentLifeCycle"
singleton="false">
+  <bean name="/shutdownComponent.action" class="org.apache.servicemix.web.controller.ComponentLifeCycle"
scope="request">
     <constructor-arg ref="adminCommandsServiceMBean" />
     <constructor-arg value="shutdown" />
     <property name="view" value="redirect:/components.jsp" />
   </bean>
-  <bean name="/uninstallComponent.action" class="org.apache.servicemix.web.controller.ComponentLifeCycle"
singleton="false">
+  <bean name="/uninstallComponent.action" class="org.apache.servicemix.web.controller.ComponentLifeCycle"
scope="request">
     <constructor-arg ref="adminCommandsServiceMBean" />
     <constructor-arg value="uninstall" />
     <property name="view" value="redirect:/components.jsp" />
   </bean>
 
-  <bean name="/installSharedLibrary.action" class="org.apache.servicemix.web.controller.InstallSharedLibrary"
autowire="constructor"  singleton="false">
+  <bean name="/installSharedLibrary.action" class="org.apache.servicemix.web.controller.InstallSharedLibrary"
scope="request">
+    <constructor-arg ref="adminCommandsServiceMBean" />
     <property name="commandClass" value="org.apache.servicemix.web.controller.FileUploadBean"
/>
     <property name="formView" value="redirect:/shared-libraries.jsp" />
     <property name="successView" value="redirect:/shared-libraries.jsp" />
   </bean>
 
-  <bean name="/deployServiceAssembly.action" class="org.apache.servicemix.web.controller.DeployServiceAssembly"
autowire="constructor"  singleton="false">
+  <bean name="/deployServiceAssembly.action" class="org.apache.servicemix.web.controller.DeployServiceAssembly"
scope="request">
+    <constructor-arg ref="adminCommandsServiceMBean" />
     <property name="commandClass" value="org.apache.servicemix.web.controller.FileUploadBean"
/>
     <property name="formView" value="redirect:/service-assemblies.jsp" />
     <property name="successView" value="redirect:/service-assemblies.jsp" />
   </bean>
-  <bean name="/startServiceAssembly.action" class="org.apache.servicemix.web.controller.ServiceAssemblyLifeCycle"
singleton="false">
+  <bean name="/startServiceAssembly.action" class="org.apache.servicemix.web.controller.ServiceAssemblyLifeCycle"
scope="request">
     <constructor-arg ref="adminCommandsServiceMBean" />
     <constructor-arg value="start" />
     <property name="view" value="redirect:/service-assemblies.jsp" />
   </bean>
-  <bean name="/stopServiceAssembly.action" class="org.apache.servicemix.web.controller.ServiceAssemblyLifeCycle"
singleton="false">
+  <bean name="/stopServiceAssembly.action" class="org.apache.servicemix.web.controller.ServiceAssemblyLifeCycle"
scope="request">
     <constructor-arg ref="adminCommandsServiceMBean" />
     <constructor-arg value="stop" />
     <property name="view" value="redirect:/service-assemblies.jsp" />
   </bean>
-  <bean name="/shutdownServiceAssembly.action" class="org.apache.servicemix.web.controller.ServiceAssemblyLifeCycle"
singleton="false">
+  <bean name="/shutdownServiceAssembly.action" class="org.apache.servicemix.web.controller.ServiceAssemblyLifeCycle"
scope="request">
     <constructor-arg ref="adminCommandsServiceMBean" />
     <constructor-arg value="shutdown" />
     <property name="view" value="redirect:/service-assemblies.jsp" />
   </bean>
-  <bean name="/uninstallServiceAssembly.action" class="org.apache.servicemix.web.controller.ServiceAssemblyLifeCycle"
singleton="false">
+  <bean name="/uninstallServiceAssembly.action" class="org.apache.servicemix.web.controller.ServiceAssemblyLifeCycle"
scope="request">
     <constructor-arg ref="adminCommandsServiceMBean" />
     <constructor-arg value="uninstall" />
     <property name="view" value="redirect:/service-assemblies.jsp" />
   </bean>
   
-  <bean name="/dot-flow.svg" class="org.apache.servicemix.web.controller.DotViewController"
singleton="false">
+  <bean name="/dot-flow.svg" class="org.apache.servicemix.web.controller.DotViewController"
scope="session">
     <constructor-arg ref="dotViewServiceMBean" />
     <property name="type" value="flow" />
     <property name="view" ref="dotView" />
   </bean>
   
-  <bean name="/dot-endpoints.svg" class="org.apache.servicemix.web.controller.DotViewController"
singleton="false">
+  <bean name="/dot-endpoints.svg" class="org.apache.servicemix.web.controller.DotViewController"
scope="request">
     <constructor-arg ref="dotViewServiceMBean" />
     <property name="type" value="endpoints" />
     <property name="view" ref="dotView" />

Modified: incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/web.xml?view=diff&rev=468730&r1=468729&r2=468730
==============================================================================
--- incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/WEB-INF/web.xml Sat
Oct 28 12:52:07 2006
@@ -19,7 +19,7 @@
 <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
-         http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+                             http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
          version="2.4">
 
     <description>
@@ -63,6 +63,9 @@
     <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
 		<listener>
 		  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+		</listener>
+    <listener>
+      <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
 		</listener>
 
     <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
@@ -77,6 +80,9 @@
     <servlet-mapping>
         <servlet-name>dispatcher</servlet-name>
         <url-pattern>*.action</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
         <url-pattern>*.svg</url-pattern>
     </servlet-mapping>
 

Modified: incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/styles/style.css
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/styles/style.css?view=diff&rev=468730&r1=468729&r2=468730
==============================================================================
--- incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/styles/style.css (original)
+++ incubator/servicemix/trunk/servicemix-web-console/src/main/webapp/styles/style.css Sat
Oct 28 12:52:07 2006
@@ -170,7 +170,7 @@
 
 #content {
   background: transparent url( '../images/bg02-white-right.png' ) no-repeat right top;
-  padding: 5px 25px 5px 210px;
+  padding: 5px 25px 5px 240px;
   display: block;
   text-align: left;
   min-height: 214px;



Mime
View raw message