You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by de...@apache.org on 2005/09/21 07:28:42 UTC

svn commit: r290623 - in /webservices/axis2/trunk/java/modules/core: src/org/apache/axis2/context/AbstractContext.java webapp/ViewContexts.jsp webapp/viewServiceContext.jsp webapp/viewServiceGroupContext.jsp

Author: deepal
Date: Tue Sep 20 22:28:31 2005
New Revision: 290623

URL: http://svn.apache.org/viewcvs?rev=290623&view=rev
Log:
via axis2 wen adming one can see SGC and SC their properties , remove context so on. 

Added:
    webservices/axis2/trunk/java/modules/core/webapp/viewServiceContext.jsp
    webservices/axis2/trunk/java/modules/core/webapp/viewServiceGroupContext.jsp
Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java
    webservices/axis2/trunk/java/modules/core/webapp/ViewContexts.jsp

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java?rev=290623&r1=290622&r2=290623&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java Tue Sep 20 22:28:31 2005
@@ -63,6 +63,7 @@
      */
     public void setProperty(String key, Object value, boolean persistent) {
         if (persistent) {
+            //todo has to check the seralizabilty 
             persistentMap.put(key, value);
         } else {
             nonPersistentMap.put(key, value);
@@ -122,6 +123,14 @@
      */
     public AbstractContext getParent() {
         return parent;
+    }
+
+    public HashMap getNonPersistentMap() {
+        return nonPersistentMap;
+    }
+
+    public HashMap getPersistentMap() {
+        return persistentMap;
     }
 
 }

Modified: webservices/axis2/trunk/java/modules/core/webapp/ViewContexts.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/ViewContexts.jsp?rev=290623&r1=290622&r2=290623&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/webapp/ViewContexts.jsp (original)
+++ webservices/axis2/trunk/java/modules/core/webapp/ViewContexts.jsp Tue Sep 20 22:28:31 2005
@@ -30,8 +30,8 @@
         String groupContextID = (String)serviceGroupContext.next();
         ServiceGroupContext groupContext = (ServiceGroupContext)serviceGroupContextsMap.get(groupContextID);
         %>
-           <li><%=groupContextID%><font color="blue"><a href="viewServiceGroupContext.jsp?V=Y&ID=<%=groupContextID%>">
-                    View</a></font>  <font color="red"><a href="viewServiceGroupContext.jsp?R=Y&ID=<%=groupContextID%>">
+           <li><%=groupContextID%><font color="blue"><a href="viewServiceGroupContext.jsp?TYPE=VIEW&ID=<%=groupContextID%>">
+                    View</a></font>  <font color="red"><a href="viewServiceGroupContext.jsp?TYPE=DELETE&ID=<%=groupContextID%>">
                     Remove</a> </font></li>
         <%
         Iterator serviceContextItr = groupContext.getServiceContexts();
@@ -40,9 +40,8 @@
             ServiceContext serviceContext = (ServiceContext)serviceContextItr.next();
              String serviceConID = serviceContext.getServiceInstanceID();
         %>
-            <li><%=serviceConID%><font color="blue"><a href="viewServiceContext.jsp?V=y&ID=<%=serviceConID%>&PID=<%=groupContextID%>">
-                    View</a></font>  <font color="red"><a href="viewServiceContext.jsp?R=Y&ID=<%=serviceConID%>&PID=<%=groupContextID%>">
-                    Reomove</a></font></li>
+            <li><%=serviceConID%><font color="blue"><a href="viewServiceContext.jsp?TYPE=VIEW&ID=<%=serviceConID%>&PID=<%=groupContextID%>">
+                    View</a></font></li>
         <%
         }
                 %></ul><hr><%

Added: webservices/axis2/trunk/java/modules/core/webapp/viewServiceContext.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/viewServiceContext.jsp?rev=290623&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/core/webapp/viewServiceContext.jsp (added)
+++ webservices/axis2/trunk/java/modules/core/webapp/viewServiceContext.jsp Tue Sep 20 22:28:31 2005
@@ -0,0 +1,80 @@
+<%@ page import="org.apache.axis2.context.ConfigurationContext"%>
+<%@ page import="org.apache.axis2.Constants"%>
+<%@ page import="org.apache.axis2.context.ServiceGroupContext"%>
+<%@ page import="java.util.Iterator"%>
+<%@ page import="java.util.HashMap"%>
+<%@ page import="org.apache.axis2.context.ServiceContext"%>
+<%--
+  Created by IntelliJ IDEA.
+  User: Indika Deepal
+  Date: Sep 21, 2005
+  Time: 11:15:46 AM
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<head><title>View ServiceGroup Context property :: Delete Context</title></head>
+<body>
+<h1>Runing Context hierachy</h1>
+<%
+    ConfigurationContext configContext = (ConfigurationContext)request.getSession().getAttribute(Constants.CONFIG_CONTEXT);
+    HashMap serviceGroupContextsMap = configContext.getServiceGroupContexts();
+    String type = request.getParameter("TYPE");
+    String sgID = request.getParameter("PID");
+    String ID = request.getParameter("ID");
+    ServiceGroupContext sgContext = (ServiceGroupContext)serviceGroupContextsMap.get(sgID);
+    ServiceContext serviceContext =null;
+    if(sgContext !=null){
+        serviceContext = sgContext.getServiceContext(ID);
+    }
+    if(sgID !=null && serviceContext !=null){
+        if(type != null){
+            if("VIEW".equals(type)){
+             HashMap perMap = serviceContext.getPersistentMap();
+             if(perMap.size()>0){
+             %>
+             <h4>Persistance properties</h4><ul>
+             <%
+                 Iterator itr = perMap.keySet().iterator();
+                 while (itr.hasNext()) {
+                     String key = (String) itr.next();
+                     Object property =  perMap.get(key);
+              %>
+                   <li><%=key%> : <%=property.toString()%></li>
+              <%
+                 }
+                 %></ul>
+                 <%
+             } else {
+            %>
+             <h4>No persistance property found in the context</h4>
+            <%
+             }
+             HashMap transientMap = serviceContext.getNonPersistentMap();
+                          if(perMap.size()>0){
+             %>
+             <h4>Non persistance properties</h4><ul>
+             <%
+                 Iterator itr = transientMap.keySet().iterator();
+                 while (itr.hasNext()) {
+                     String key = (String) itr.next();
+                     Object property =  transientMap.get(key);
+              %>
+                   <li><%=key%> : <%=property.toString()%></li>
+              <%
+                 }
+                 %></ul>
+                 <%
+             } else {
+            %>
+            <h4> No non-persistance property found in the context</h4>
+            <%
+             }
+            }
+        }
+    } else {
+%> <h4>No Service Context found</h4><%
+    }
+%>
+</body>
+</html>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/core/webapp/viewServiceGroupContext.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/viewServiceGroupContext.jsp?rev=290623&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/core/webapp/viewServiceGroupContext.jsp (added)
+++ webservices/axis2/trunk/java/modules/core/webapp/viewServiceGroupContext.jsp Tue Sep 20 22:28:31 2005
@@ -0,0 +1,81 @@
+<%@ page import="org.apache.axis2.context.ConfigurationContext"%>
+<%@ page import="org.apache.axis2.Constants"%>
+<%@ page import="java.util.Iterator"%>
+<%@ page import="java.util.HashMap"%>
+<%@ page import="org.apache.axis2.context.ServiceGroupContext"%>
+<%--
+  Created by IntelliJ IDEA.
+  User: Indika Deepal
+  Date: Sep 21, 2005
+  Time: 10:41:24 AM
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<head><title>View ServiceGroup Context property :: Delete Context</title></head>
+<body>
+<h1>Runing Context hierachy</h1>
+<%
+    ConfigurationContext configContext = (ConfigurationContext)request.getSession().getAttribute(Constants.CONFIG_CONTEXT);
+    HashMap serviceGroupContextsMap = configContext.getServiceGroupContexts();
+    String type = request.getParameter("TYPE");
+    String sgID = request.getParameter("ID");
+    ServiceGroupContext sgContext = (ServiceGroupContext)serviceGroupContextsMap.get(sgID);
+    if(sgID !=null && sgContext !=null){
+        if(type != null){
+            if("VIEW".equals(type)){
+             HashMap perMap = sgContext.getPersistentMap();
+             if(perMap.size()>0){
+             %>
+             <h4>Persistance properties</h4><ul>
+             <%
+                 Iterator itr = perMap.keySet().iterator();
+                 while (itr.hasNext()) {
+                     String key = (String) itr.next();
+                     Object property =  perMap.get(key);
+              %>
+                   <li><%=key%> : <%=property.toString()%></li>
+              <%
+                 }
+                 %></ul>
+                 <%
+             } else {
+            %>
+             <h4>No persistance properties found in the context</h4>
+            <%
+             }
+             HashMap transientMap = sgContext.getNonPersistentMap();
+                          if(perMap.size()>0){
+             %>
+             <h4>Non persistance properties</h4><ul>
+             <%
+                 Iterator itr = transientMap.keySet().iterator();
+                 while (itr.hasNext()) {
+                     String key = (String) itr.next();
+                     Object property =  transientMap.get(key);
+              %>
+                   <li><%=key%> : <%=property.toString()%></li>
+              <%
+                 }
+                 %></ul>
+                 <%
+             } else {
+            %>
+            <h4> No non-persistance properties found in the context</h4>
+            <%
+             }
+            }   else if("DELETE".equals(type)){
+                Object obj = serviceGroupContextsMap.remove(sgID);
+                if(obj != null){
+                 %>Reomoved the context <%
+            }else {
+                %>Unable to reomove the context <%
+            }
+            }
+        }
+    } else {
+%> <h4>No Service Group Context found</h4><%
+    }
+%>
+</body>
+</html>
\ No newline at end of file



Re: svn commit: r290623 - in /webservices/axis2/trunk/java/modules/core: src/org/apache/axis2/context/AbstractContext.java webapp/ViewContexts.jsp webapp/viewServiceContext.jsp webapp/viewServiceGroupContext.jsp

Posted by Deepal Jayasinghe <de...@opensource.lk>.
sorry for my comments it should be

provide a way to view and remove ServiceGroupContext and ServiceContext via 
axis2 web admin.

Thanks,
 Deepal
................................................................
~Future is Open~

----- Original Message ----- 
From: <de...@apache.org>
To: <ax...@ws.apache.org>
Sent: Wednesday, September 21, 2005 11:28 AM
Subject: svn commit: r290623 - in 
/webservices/axis2/trunk/java/modules/core: 
src/org/apache/axis2/context/AbstractContext.java webapp/ViewContexts.jsp 
webapp/viewServiceContext.jsp webapp/viewServiceGroupContext.jsp


> Author: deepal
> Date: Tue Sep 20 22:28:31 2005
> New Revision: 290623
>
> URL: http://svn.apache.org/viewcvs?rev=290623&view=rev
> Log:
> via axis2 wen adming one can see SGC and SC their properties , remove 
> context so on.
>
> Added:
>    webservices/axis2/trunk/java/modules/core/webapp/viewServiceContext.jsp
> 
> webservices/axis2/trunk/java/modules/core/webapp/viewServiceGroupContext.jsp
> Modified:
> 
> webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java
>    webservices/axis2/trunk/java/modules/core/webapp/ViewContexts.jsp
>
> Modified: 
> webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java
> URL: 
> http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java?rev=290623&r1=290622&r2=290623&view=diff
> ==============================================================================
> ---  
> webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java 
> (original)
> +++ 
> webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java 
> Tue Sep 20 22:28:31 2005
> @@ -63,6 +63,7 @@
>      */
>     public void setProperty(String key, Object value, boolean persistent) 
> {
>         if (persistent) {
> +            //todo has to check the seralizabilty
>             persistentMap.put(key, value);
>         } else {
>             nonPersistentMap.put(key, value);
> @@ -122,6 +123,14 @@
>      */
>     public AbstractContext getParent() {
>         return parent;
> +    }
> +
> +    public HashMap getNonPersistentMap() {
> +        return nonPersistentMap;
> +    }
> +
> +    public HashMap getPersistentMap() {
> +        return persistentMap;
>     }
>
> }
>
> Modified: 
> webservices/axis2/trunk/java/modules/core/webapp/ViewContexts.jsp
> URL: 
> http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/ViewContexts.jsp?rev=290623&r1=290622&r2=290623&view=diff
> ==============================================================================
> --- webservices/axis2/trunk/java/modules/core/webapp/ViewContexts.jsp 
> (original)
> +++ webservices/axis2/trunk/java/modules/core/webapp/ViewContexts.jsp Tue 
> Sep 20 22:28:31 2005
> @@ -30,8 +30,8 @@
>         String groupContextID = (String)serviceGroupContext.next();
>         ServiceGroupContext groupContext = 
> (ServiceGroupContext)serviceGroupContextsMap.get(groupContextID);
>         %>
> -           <li><%=groupContextID%><font color="blue"><a 
> href="viewServiceGroupContext.jsp?V=Y&ID=<%=groupContextID%>">
> -                    View</a></font>  <font color="red"><a 
> href="viewServiceGroupContext.jsp?R=Y&ID=<%=groupContextID%>">
> +           <li><%=groupContextID%><font color="blue"><a 
> href="viewServiceGroupContext.jsp?TYPE=VIEW&ID=<%=groupContextID%>">
> +                    View</a></font>  <font color="red"><a 
> href="viewServiceGroupContext.jsp?TYPE=DELETE&ID=<%=groupContextID%>">
>                     Remove</a> </font></li>
>         <%
>         Iterator serviceContextItr = groupContext.getServiceContexts();
> @@ -40,9 +40,8 @@
>             ServiceContext serviceContext = 
> (ServiceContext)serviceContextItr.next();
>              String serviceConID = serviceContext.getServiceInstanceID();
>         %>
> -            <li><%=serviceConID%><font color="blue"><a 
> href="viewServiceContext.jsp?V=y&ID=<%=serviceConID%>&PID=<%=groupContextID%>">
> -                    View</a></font>  <font color="red"><a 
> href="viewServiceContext.jsp?R=Y&ID=<%=serviceConID%>&PID=<%=groupContextID%>">
> -                    Reomove</a></font></li>
> +            <li><%=serviceConID%><font color="blue"><a 
> href="viewServiceContext.jsp?TYPE=VIEW&ID=<%=serviceConID%>&PID=<%=groupContextID%>">
> +                    View</a></font></li>
>         <%
>         }
>                 %></ul><hr><%
>
> Added: 
> webservices/axis2/trunk/java/modules/core/webapp/viewServiceContext.jsp
> URL: 
> http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/viewServiceContext.jsp?rev=290623&view=auto
> ==============================================================================
> ---  
> webservices/axis2/trunk/java/modules/core/webapp/viewServiceContext.jsp 
> (added)
> +++ 
> webservices/axis2/trunk/java/modules/core/webapp/viewServiceContext.jsp 
> Tue Sep 20 22:28:31 2005
> @@ -0,0 +1,80 @@
> +<%@ page import="org.apache.axis2.context.ConfigurationContext"%>
> +<%@ page import="org.apache.axis2.Constants"%>
> +<%@ page import="org.apache.axis2.context.ServiceGroupContext"%>
> +<%@ page import="java.util.Iterator"%>
> +<%@ page import="java.util.HashMap"%>
> +<%@ page import="org.apache.axis2.context.ServiceContext"%>
> +<%--
> +  Created by IntelliJ IDEA.
> +  User: Indika Deepal
> +  Date: Sep 21, 2005
> +  Time: 11:15:46 AM
> +  To change this template use File | Settings | File Templates.
> +--%>
> +<%@ page contentType="text/html;charset=UTF-8" language="java" %>
> +<html>
> +<head><title>View ServiceGroup Context property :: Delete 
> Context</title></head>
> +<body>
> +<h1>Runing Context hierachy</h1>
> +<%
> +    ConfigurationContext configContext = 
> (ConfigurationContext)request.getSession().getAttribute(Constants.CONFIG_CONTEXT);
> +    HashMap serviceGroupContextsMap = 
> configContext.getServiceGroupContexts();
> +    String type = request.getParameter("TYPE");
> +    String sgID = request.getParameter("PID");
> +    String ID = request.getParameter("ID");
> +    ServiceGroupContext sgContext = 
> (ServiceGroupContext)serviceGroupContextsMap.get(sgID);
> +    ServiceContext serviceContext =null;
> +    if(sgContext !=null){
> +        serviceContext = sgContext.getServiceContext(ID);
> +    }
> +    if(sgID !=null && serviceContext !=null){
> +        if(type != null){
> +            if("VIEW".equals(type)){
> +             HashMap perMap = serviceContext.getPersistentMap();
> +             if(perMap.size()>0){
> +             %>
> +             <h4>Persistance properties</h4><ul>
> +             <%
> +                 Iterator itr = perMap.keySet().iterator();
> +                 while (itr.hasNext()) {
> +                     String key = (String) itr.next();
> +                     Object property =  perMap.get(key);
> +              %>
> +                   <li><%=key%> : <%=property.toString()%></li>
> +              <%
> +                 }
> +                 %></ul>
> +                 <%
> +             } else {
> +            %>
> +             <h4>No persistance property found in the context</h4>
> +            <%
> +             }
> +             HashMap transientMap = serviceContext.getNonPersistentMap();
> +                          if(perMap.size()>0){
> +             %>
> +             <h4>Non persistance properties</h4><ul>
> +             <%
> +                 Iterator itr = transientMap.keySet().iterator();
> +                 while (itr.hasNext()) {
> +                     String key = (String) itr.next();
> +                     Object property =  transientMap.get(key);
> +              %>
> +                   <li><%=key%> : <%=property.toString()%></li>
> +              <%
> +                 }
> +                 %></ul>
> +                 <%
> +             } else {
> +            %>
> +            <h4> No non-persistance property found in the context</h4>
> +            <%
> +             }
> +            }
> +        }
> +    } else {
> +%> <h4>No Service Context found</h4><%
> +    }
> +%>
> +</body>
> +</html>
> \ No newline at end of file
>
> Added: 
> webservices/axis2/trunk/java/modules/core/webapp/viewServiceGroupContext.jsp
> URL: 
> http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/viewServiceGroupContext.jsp?rev=290623&view=auto
> ==============================================================================
> ---  
> webservices/axis2/trunk/java/modules/core/webapp/viewServiceGroupContext.jsp 
> (added)
> +++ 
> webservices/axis2/trunk/java/modules/core/webapp/viewServiceGroupContext.jsp 
> Tue Sep 20 22:28:31 2005
> @@ -0,0 +1,81 @@
> +<%@ page import="org.apache.axis2.context.ConfigurationContext"%>
> +<%@ page import="org.apache.axis2.Constants"%>
> +<%@ page import="java.util.Iterator"%>
> +<%@ page import="java.util.HashMap"%>
> +<%@ page import="org.apache.axis2.context.ServiceGroupContext"%>
> +<%--
> +  Created by IntelliJ IDEA.
> +  User: Indika Deepal
> +  Date: Sep 21, 2005
> +  Time: 10:41:24 AM
> +  To change this template use File | Settings | File Templates.
> +--%>
> +<%@ page contentType="text/html;charset=UTF-8" language="java" %>
> +<html>
> +<head><title>View ServiceGroup Context property :: Delete 
> Context</title></head>
> +<body>
> +<h1>Runing Context hierachy</h1>
> +<%
> +    ConfigurationContext configContext = 
> (ConfigurationContext)request.getSession().getAttribute(Constants.CONFIG_CONTEXT);
> +    HashMap serviceGroupContextsMap = 
> configContext.getServiceGroupContexts();
> +    String type = request.getParameter("TYPE");
> +    String sgID = request.getParameter("ID");
> +    ServiceGroupContext sgContext = 
> (ServiceGroupContext)serviceGroupContextsMap.get(sgID);
> +    if(sgID !=null && sgContext !=null){
> +        if(type != null){
> +            if("VIEW".equals(type)){
> +             HashMap perMap = sgContext.getPersistentMap();
> +             if(perMap.size()>0){
> +             %>
> +             <h4>Persistance properties</h4><ul>
> +             <%
> +                 Iterator itr = perMap.keySet().iterator();
> +                 while (itr.hasNext()) {
> +                     String key = (String) itr.next();
> +                     Object property =  perMap.get(key);
> +              %>
> +                   <li><%=key%> : <%=property.toString()%></li>
> +              <%
> +                 }
> +                 %></ul>
> +                 <%
> +             } else {
> +            %>
> +             <h4>No persistance properties found in the context</h4>
> +            <%
> +             }
> +             HashMap transientMap = sgContext.getNonPersistentMap();
> +                          if(perMap.size()>0){
> +             %>
> +             <h4>Non persistance properties</h4><ul>
> +             <%
> +                 Iterator itr = transientMap.keySet().iterator();
> +                 while (itr.hasNext()) {
> +                     String key = (String) itr.next();
> +                     Object property =  transientMap.get(key);
> +              %>
> +                   <li><%=key%> : <%=property.toString()%></li>
> +              <%
> +                 }
> +                 %></ul>
> +                 <%
> +             } else {
> +            %>
> +            <h4> No non-persistance properties found in the context</h4>
> +            <%
> +             }
> +            }   else if("DELETE".equals(type)){
> +                Object obj = serviceGroupContextsMap.remove(sgID);
> +                if(obj != null){
> +                 %>Reomoved the context <%
> +            }else {
> +                %>Unable to reomove the context <%
> +            }
> +            }
> +        }
> +    } else {
> +%> <h4>No Service Group Context found</h4><%
> +    }
> +%>
> +</body>
> +</html>
> \ No newline at end of file
>
>
>