incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmidd...@apache.org
Subject svn commit: r559408 - in /incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing: BankWS-corba.idl BankWS-corba.wsdl src/corba/client/Client.java src/corba/server/Bank_impl.java src/yoko/client/Client.java src/yoko/server/BankImpl.java
Date Wed, 25 Jul 2007 11:45:55 GMT
Author: dmiddlem
Date: Wed Jul 25 04:45:53 2007
New Revision: 559408

URL: http://svn.apache.org/viewvc?view=rev&rev=559408
Log:
Committing some updates to the addressing demo to show how to remove/stop endpoints created
by the
demo.

Modified:
    incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/BankWS-corba.idl
    incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/BankWS-corba.wsdl
    incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/corba/client/Client.java
    incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/corba/server/Bank_impl.java
    incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/yoko/client/Client.java
    incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/yoko/server/BankImpl.java

Modified: incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/BankWS-corba.idl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/BankWS-corba.idl?view=diff&rev=559408&r1=559407&r2=559408
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/BankWS-corba.idl
(original)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/BankWS-corba.idl
Wed Jul 25 04:45:53 2007
@@ -7,7 +7,7 @@
     );
 };
 interface Bank {
-    Account
+    ::Account
     create_account(
         in string account_name
     );
@@ -15,7 +15,7 @@
     create_epr_account(
         in string account_name
     );
-    Account
+    ::Account
     get_account(
         in string account_name
     );
@@ -30,5 +30,9 @@
     void
     find_account(
         inout any account_details
+    );
+    void
+    remove_account(
+        in string account_name
     );
 };

Modified: incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/BankWS-corba.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/BankWS-corba.wsdl?view=diff&rev=559408&r1=559407&r2=559408
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/BankWS-corba.wsdl
(original)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/BankWS-corba.wsdl
Wed Jul 25 04:45:53 2007
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <wsdl:definitions targetNamespace="http://schemas.apache.org/yoko/idl/Bank" xmlns:tns="http://schemas.apache.org/yoko/idl/Bank"
xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:corba="http://schemas.apache.org/yoko/bindings/corba"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
   <corba:typeMapping targetNamespace="http://schemas.apache.org/yoko/idl/Bank/typemap">
-    <corba:object xmlns:ns5="http://www.w3.org/2005/08/addressing" xmlns:ns4="http://schemas.apache.org/yoko/idl/Bank/typemap"
xmlns="http://schemas.apache.org/yoko/idl/Bank" binding="AccountCORBABinding" repositoryID="IDL:Account:1.0"
name="ns4:Account" type="ns5:EndpointReferenceType" />
-    <corba:object xmlns:ns4="http://www.w3.org/2005/08/addressing" xmlns="http://schemas.apache.org/yoko/idl/Bank/typemap"
repositoryID="IDL:omg.org/CORBA/Object/1.0" name="CORBA.Object" type="ns4:EndpointReferenceType"
/>
+    <corba:object xmlns:ns4="http://www.w3.org/2005/08/addressing" xmlns="http://schemas.apache.org/yoko/idl/Bank"
binding="AccountCORBABinding" repositoryID="IDL:Account:1.0" type="ns4:EndpointReferenceType"
name="Account" />
+    <corba:object xmlns="http://www.w3.org/2005/08/addressing" repositoryID="IDL:omg.org/CORBA/Object/1.0"
type="EndpointReferenceType" name="CORBA.Object" />
   </corba:typeMapping>
   <wsdl:types>
     <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/Bank"
xmlns="http://schemas.apache.org/yoko/idl/Bank" xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
@@ -138,8 +138,26 @@
           </xs:sequence>
         </xs:complexType>
       </xs:element>
+      <xs:element name="remove_account">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="account_name" type="xs:string">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="remove_accountResponse">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
     </xs:schema>
   </wsdl:types>
+  <wsdl:message name="remove_account">
+    <wsdl:part name="inparameter" element="tns:remove_account">
+    </wsdl:part>
+  </wsdl:message>
   <wsdl:message name="create_epr_accountResponse">
     <wsdl:part name="outparameter" element="tns:create_epr_accountResponse">
     </wsdl:part>
@@ -172,6 +190,10 @@
     <wsdl:part name="inparameter" element="tns:create_account">
     </wsdl:part>
   </wsdl:message>
+  <wsdl:message name="remove_accountResponse">
+    <wsdl:part name="outparameter" element="tns:remove_accountResponse">
+    </wsdl:part>
+  </wsdl:message>
   <wsdl:message name="deposit">
     <wsdl:part name="inparameter" element="tns:deposit">
     </wsdl:part>
@@ -241,6 +263,12 @@
       <wsdl:output name="find_accountResponse" message="tns:find_accountResponse">
     </wsdl:output>
     </wsdl:operation>
+    <wsdl:operation name="remove_account">
+      <wsdl:input name="remove_accountRequest" message="tns:remove_account">
+    </wsdl:input>
+      <wsdl:output name="remove_accountResponse" message="tns:remove_accountResponse">
+    </wsdl:output>
+    </wsdl:operation>
   </wsdl:portType>
   <wsdl:portType name="Account">
     <wsdl:operation name="get_balance">
@@ -315,6 +343,15 @@
       <wsdl:input name="find_accountRequest">
       </wsdl:input>
       <wsdl:output name="find_accountResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="remove_account">
+      <corba:operation name="remove_account">
+        <corba:param mode="in" name="account_name" idltype="corba:string" />
+      </corba:operation>
+      <wsdl:input name="remove_accountRequest">
+      </wsdl:input>
+      <wsdl:output name="remove_accountResponse">
       </wsdl:output>
     </wsdl:operation>
   </wsdl:binding>

Modified: incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/corba/client/Client.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/corba/client/Client.java?view=diff&rev=559408&r1=559407&r2=559408
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/corba/client/Client.java
(original)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/corba/client/Client.java
Wed Jul 25 04:45:53 2007
@@ -80,6 +80,11 @@
         System.out.println("New balance for account \"Account4\" is " + account4.get_balance());
         System.out.println();
 
+        bank.remove_account("Account1");
+        bank.remove_account("Account2");
+        bank.remove_account("Account3");
+        bank.remove_account("Account4");
+
         return 0;
     }
 

Modified: incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/corba/server/Bank_impl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/corba/server/Bank_impl.java?view=diff&rev=559408&r1=559407&r2=559408
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/corba/server/Bank_impl.java
(original)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/corba/server/Bank_impl.java
Wed Jul 25 04:45:53 2007
@@ -81,6 +81,12 @@
         System.out.println("[Bank] Called find_account (account_details)...");
         System.out.println();
     }
+
+    public void remove_account(String account_name) {
+        System.out.println("[Bank] Called remove_account ( " + account_name + ")...");
+        System.out.println();
+        accountList.remove(account_name);
+    }
     
     public POA _default_POA() {
         return poa_;

Modified: incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/yoko/client/Client.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/yoko/client/Client.java?view=diff&rev=559408&r1=559407&r2=559408
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/yoko/client/Client.java
(original)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/yoko/client/Client.java
Wed Jul 25 04:45:53 2007
@@ -103,6 +103,10 @@
         System.out.println();
         */
 
+        port.removeAccount("Account1");
+        port.removeAccount("Account3");
+        port.removeAccount("Account4");
+
         System.exit(0);
     }
 

Modified: incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/yoko/server/BankImpl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/yoko/server/BankImpl.java?view=diff&rev=559408&r1=559407&r2=559408
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/yoko/server/BankImpl.java
(original)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/bank_ws_addressing/src/yoko/server/BankImpl.java
Wed Jul 25 04:45:53 2007
@@ -56,6 +56,7 @@
     private URL wsdlURL;
     private Map<String, EndpointReferenceType> accountList = 
         new HashMap<String, EndpointReferenceType>();
+    private Map<String, Endpoint> endpointList = new HashMap<String, Endpoint>();
 
     public BankImpl(String wsdlLocation) {
         try {
@@ -113,11 +114,21 @@
     public void findAccount(javax.xml.ws.Holder<Object> accountDetails) {
     }
 
+    public void removeAccount(String accountName) {
+        System.out.println("[Bank] Called removeAccount( " + accountName + " )...");
+        System.out.println();
+        accountList.remove(accountName);
+        Endpoint ep = endpointList.remove(accountName);
+        ep.stop();
+    }
+
     private EndpointReferenceType createAccountReference(String accountName) {
         String corbaAddress = "corbaloc::localhost:60000/" + accountName;
 
         Object account = new AccountImpl();
-        Endpoint.publish(corbaAddress, account);
+        //Endpoint.publish(corbaAddress, account);
+        Endpoint ep = Endpoint.publish(corbaAddress, account);
+        endpointList.put(accountName, ep);
         
         // TODO: can we just use the EndpointReferenceUtils.getEndpointRef(manager, impl);
         



Mime
View raw message