logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

cvs: pecl(AVOCET) /sdo/SCA/Bindings/tuscany SCA_TuscanyProxy.php SCA_Tuscan: msg#00248

Subject: cvs: pecl(AVOCET) /sdo/SCA/Bindings/tuscany SCA_TuscanyProxy.php SCA_TuscanyWrapper.php
cem             Wed Feb 21 12:22:55 2007 UTC

  Modified files:              (Branch: AVOCET)
    /pecl/sdo/SCA/Bindings/tuscany      SCA_TuscanyWrapper.php 
                                        SCA_TuscanyProxy.php 
  Log:
  Update the SCA Tuscany bindings to work with the latest Tuscany extension 
submitted as a patch against the Tuscany repository. 
  
http://cvs.php.net/viewvc.cgi/pecl/sdo/SCA/Bindings/tuscany/SCA_TuscanyWrapper.php?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: pecl/sdo/SCA/Bindings/tuscany/SCA_TuscanyWrapper.php
diff -u pecl/sdo/SCA/Bindings/tuscany/SCA_TuscanyWrapper.php:1.1.2.2 
pecl/sdo/SCA/Bindings/tuscany/SCA_TuscanyWrapper.php:1.1.2.3
--- pecl/sdo/SCA/Bindings/tuscany/SCA_TuscanyWrapper.php:1.1.2.2        Wed Feb 
14 18:42:12 2007
+++ pecl/sdo/SCA/Bindings/tuscany/SCA_TuscanyWrapper.php        Wed Feb 21 
12:22:54 2007
@@ -23,7 +23,7 @@
 |         Caroline Maynard,                                                   |
 |         Simon Laws                                                          |
 +-----------------------------------------------------------------------------+
-$Id: SCA_TuscanyWrapper.php,v 1.1.2.2 2007/02/14 18:42:12 cem Exp $
+$Id: SCA_TuscanyWrapper.php,v 1.1.2.3 2007/02/21 12:22:54 cem Exp $
 */
 
 /**
@@ -41,7 +41,6 @@
 if (! class_exists('SCA_TuscanyWrapper', false)) {
     class SCA_TuscanyWrapper {
 
-        private $mediator_id     = null;
         private $mediator        = null;
         private $service         = null;
         private $component_name  = null;
@@ -54,25 +53,22 @@
          * @param string $component_name
          * @param string $wsdl_filename
          */
-        public function __construct($mediator_id, $component_name, 
$class_name, $method_name)
+        public function __construct($mediator, $component_name, $class_name, 
$method_name, $arg_array)
         {
             SCA::$logger->log('Entering');
             SCA::$logger->log("component_name = $component_name, class name = 
$class_name");
             
             SCA::setIsEmbedded(true);
 
-            $this->mediator_id    = $mediator_id;
+            $this->mediator       = $mediator;
             $this->component_name = $component_name;
             $this->method_name    = $method_name;
             $this->class_name     = $class_name;
-
-            // get the mediator object based on the id provided
-            $this->mediator = 
SCA_Tuscany::getSCATuscanyObject($this->mediator_id);
             
             // if a class name has not been provided 
             // then this may just be a script. 
             if ( $class_name == null ){
-                $arg_array = $this->mediator->getArgArray(); 
+             //   $arg_array = $this->mediator->getArgArray(); 
 
                 // get the arguments and put them into the request
                 $index = 0;
@@ -82,7 +78,7 @@
                 }
 
                 // its just a script so get ready to 
-                // capture it's output. We have to do this here
+                // capture its output. We have to do this here
                 // as the script is included between construction
                 // and invoke of this object
                 ob_start(); 
@@ -97,11 +93,12 @@
             SCA::$logger->log('Entering');
               
 //component_name, string reference_name, string method_name, array arguments
-//            Reflection::export(new ReflectionExtension("sca"));
+//           Reflection::export(new ReflectionObject($this->mediator));
 
             try {
                 // get the arguments from the mediator
                 $arg_array = $this->mediator->getArgArray(); 
+                
 //var_dump($arg_array);
 
                 if ( $this->class_name != null ){     
@@ -136,7 +133,7 @@
                 } else if ( function_exists($this->method_name) ) {
                     SCA::$logger->log('Invoke service as PHP function');
                     // it's not just a script so turn
-                    // of output buffering and then call 
+                    // off output buffering and then call 
                     // the function
                     ob_end_clean();
                     $return = call_user_func_array($this->method_name,  
@@ -152,13 +149,14 @@
                 }
 
             } catch ( Exception $e ) {
+                SCA::$logger->log('Caught '.$e->getMessage());
                 throw $e;
             }
 
             SCA::$logger->log('Exiting');
+         
+            return $return;
             
-            // put return values back into mediator
-            $this->mediator->setResponse($return);
         }
     }
 }?>
http://cvs.php.net/viewvc.cgi/pecl/sdo/SCA/Bindings/tuscany/SCA_TuscanyProxy.php?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: pecl/sdo/SCA/Bindings/tuscany/SCA_TuscanyProxy.php
diff -u pecl/sdo/SCA/Bindings/tuscany/SCA_TuscanyProxy.php:1.1.2.1 
pecl/sdo/SCA/Bindings/tuscany/SCA_TuscanyProxy.php:1.1.2.2
--- pecl/sdo/SCA/Bindings/tuscany/SCA_TuscanyProxy.php:1.1.2.1  Mon Feb 12 
17:55:18 2007
+++ pecl/sdo/SCA/Bindings/tuscany/SCA_TuscanyProxy.php  Wed Feb 21 12:22:54 2007
@@ -23,7 +23,7 @@
 |         Caroline Maynard,                                                   |
 |         Simon Laws                                                          |
 +-----------------------------------------------------------------------------+
-$Id: SCA_TuscanyProxy.php,v 1.1.2.1 2007/02/12 17:55:18 mfp Exp $
+$Id: SCA_TuscanyProxy.php,v 1.1.2.2 2007/02/21 12:22:54 cem Exp $
 */
 
 /**
@@ -71,12 +71,9 @@
          */
         public function __call($method_name, $arguments)
         {
-            // create a new mediator object. The 0 parameter
-            // just means we aren't interested in its wrapper
-            // functionality
-            $mediator = new SCA_Tuscany(0);
-
-            $return = $mediator->invoke( $this->containing_class_name,
+            // Invoke the Tuscany service
+            
+            $return = SCA_Tuscany::invoke( $this->containing_class_name,
                                          $this->reference_name,
                                          $method_name,
                                          $arguments);         
@@ -86,7 +83,8 @@
         public function createDataObject( $namespace_uri, $type_name )
         {
             try {
-                return SCA_Helper::createDataObject($namespace_uri, 
$type_name, $this->component_class_name);
+                return SCA_Helper::createDataObject(
+                    $namespace_uri, $type_name, $this->component_class_name);
             } catch( Exception $e ) {
                 throw new SCA_RuntimeException($e->getMessage());
             }



<Prev in Thread] Current Thread [Next in Thread>