Author: indika
Date: Wed May  7 23:14:40 2008
New Revision: 16658

Log:

fix for ESBJAVA-466

Modified:
   
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ProxyServiceAdmin.java
   
trunk/esb/java/modules/distribution/src/main/www/extensions/core/css/wso2-esb.css
   
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/proxyservices.js
   
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/proxy_services.xsl

Modified: 
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ProxyServiceAdmin.java
==============================================================================
--- 
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ProxyServiceAdmin.java
      (original)
+++ 
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ProxyServiceAdmin.java
      Wed May  7 23:14:40 2008
@@ -339,7 +339,7 @@
                     }
                 }
 
-                
+
 
             } else {
                 handleFault(log, "Unable to save proxy service. Invalid 
definition", null);
@@ -447,4 +447,21 @@
                 .stop(getSynapseConfiguration());
         log.info("Stopped proxy service : " + proxyServiceName);
     }
+
+    /**
+     * Redeploying service
+     * Removes an existing one,Adds a new one
+     *
+     * @param proxyServiceName name of the proxy service which needs to be 
redeployed
+     * @throws AxisFault in case of a failure in redeploying the service
+     */
+    public void redeployProxyService(String proxyServiceName) throws AxisFault 
{
+        ProxyService currentProxy = 
getSynapseConfiguration().getProxyService(proxyServiceName);
+        if (currentProxy != null) {
+            log.debug("Redeploying proxy service : " + proxyServiceName);
+            OMElement proxyElement = 
ProxyServiceSerializer.serializeProxy(null, currentProxy);
+            saveProxyService(proxyElement);
+            log.info("Redeployed proxy service : " + proxyServiceName);
+        }
+    }
 }

Modified: 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/css/wso2-esb.css
==============================================================================
--- 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/css/wso2-esb.css
   (original)
+++ 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/css/wso2-esb.css
   Wed May  7 23:14:40 2008
@@ -353,6 +353,11 @@
     text-decoration: none;
     font-size: 10pt;
 }
+a#redeploy_link {
+    background: url( ../images/start.gif ) transparent no-repeat 0px 0px;
+    text-decoration: none;
+    font-size: 10pt;
+}
 a#statistic_enable{
     background: url( ../images/stat_s_disabled.gif ) transparent no-repeat 0px 
0px;
     text-decoration: none;

Modified: 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/proxyservices.js
==============================================================================
--- 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/proxyservices.js
        (original)
+++ 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/proxyservices.js
        Wed May  7 23:14:40 2008
@@ -96,6 +96,15 @@
 
 }
 
+function redeployproxy(proxyservicename) {
+    var body_xml = '<ns1:redeployProxyService 
xmlns:ns1="http://org.apache.synapse/xsd";>' +
+                   '<ns1:proxyServiceName>' + proxyservicename + 
'</ns1:proxyServiceName>' +
+                   '</ns1:redeployProxyService>';
+
+    var callURL = serverURL + "/" + PROXY_ADMIN + "/" + "redeployProxyService";
+    send("redeployProxyService", body_xml, "", callURL, "", false, 
genericproxycallback);
+}
+
 function enableproxystatistics(proxyservicename) {
 
     var body_xml = '<ns1:enableStatistics 
xmlns:ns1="http://org.apache.synapse/xsd";>' +

Modified: 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/proxy_services.xsl
==============================================================================
--- 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/proxy_services.xsl
    (original)
+++ 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/proxy_services.xsl
    Wed May  7 23:14:40 2008
@@ -125,6 +125,12 @@
                                                         
&#160;&#160;&#160;&#160;
                                                     </a>
                                                 </xsl:if>
+                                                <a href="#" id="redeploy_link">
+                                                    <xsl:attribute 
name="onClick">javascript:redeployproxy('<xsl:value-of select="name"/>'); 
return false;</xsl:attribute>
+                                                    <xsl:attribute 
name="title">Redeploy Proxy Service <xsl:value-of 
select="name"/></xsl:attribute>
+                                                    <xsl:attribute 
name="alt">Redeploy Proxy Service <xsl:value-of select="name"/></xsl:attribute>
+                                                    &#160;&#160;&#160;&#160;
+                                                </a>
                                                 <xsl:if 
test="enableStatistics='true'">
                                                         <a href="#" 
id="statistic_disable">
                                                             <xsl:attribute 
name="onClick">javascript:disableproxystatistics('<xsl:value-of 
select="name"/>'); return false;</xsl:attribute>

_______________________________________________
Esb-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

Reply via email to