Author: damitha
Date: Fri Dec  8 01:28:34 2006
New Revision: 483896

URL: http://svn.apache.org/viewvc?view=rev&rev=483896
Log:
added missing file

Added:
    webservices/sandesha/trunk/c/src/storage/beans/rm_bean.c
Modified:
    webservices/sandesha/trunk/c/src/storage/beans/create_seq_bean.c
    webservices/sandesha/trunk/c/src/storage/beans/invoker_bean.c

Modified: webservices/sandesha/trunk/c/src/storage/beans/create_seq_bean.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/beans/create_seq_bean.c?view=diff&rev=483896&r1=483895&r2=483896
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/beans/create_seq_bean.c (original)
+++ webservices/sandesha/trunk/c/src/storage/beans/create_seq_bean.c Fri Dec  8 
01:28:34 2006
@@ -20,7 +20,6 @@
 #include <axis2_env.h>
 #include <axis2_utils.h>
 #include <axis2_utils_defines.h>
-#include <string.h>
 #include <axis2_string.h>
 
 

Modified: webservices/sandesha/trunk/c/src/storage/beans/invoker_bean.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/beans/invoker_bean.c?view=diff&rev=483896&r1=483895&r2=483896
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/beans/invoker_bean.c (original)
+++ webservices/sandesha/trunk/c/src/storage/beans/invoker_bean.c Fri Dec  8 
01:28:34 2006
@@ -15,14 +15,15 @@
  */
 
 #include <sandesha2_invoker_bean.h>
+#include <sandesha2_transaction.h>
 #include <sandesha2_rm_bean.h>
-#include <string.h>
 #include <axis2_string.h>
 #include <axis2_utils.h>
 
-struct sandesha2_invoker_bean_t
+typedef struct sandesha2_invoker_bean_impl
 {
-    sandesha2_rm_bean_t *rm_bean;
+    sandesha2_invoker_bean_t invoker_bean;
+    sandesha2_rm_bean_t *rm_bean_impl;
        /*  This is the messageContextRefKey that is obtained after saving a 
message context in a storage. */
        axis2_char_t *msg_context_ref_key;
 
@@ -35,32 +36,45 @@
        /* Weather the message has been invoked by the invoker.*/
        axis2_bool_t invoked;
 
+}sandesha2_invoker_bean_impl_t;
+
+#define SANDESHA2_INTF_TO_IMPL(invoker_bean) \
+        ((sandesha2_invoker_bean_impl_t *) invoker_bean)
+
+static const sandesha2_rm_bean_ops_t rm_bean_ops =
+{
+    sandesha2_invoker_bean_free,
+    sandesha2_invoker_bean_set_id,
+    sandesha2_invoker_bean_get_id,
+    sandesha2_invoker_bean_set_transaction,
+    sandesha2_invoker_bean_get_transaction
 };
 
 AXIS2_EXTERN sandesha2_invoker_bean_t* AXIS2_CALL
 sandesha2_invoker_bean_create(
     const axis2_env_t *env )
 {
-       sandesha2_invoker_bean_t *bean = NULL;
+       sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
        AXIS2_ENV_CHECK(env, NULL);
 
-       bean = (sandesha2_invoker_bean_t *) AXIS2_MALLOC( env->allocator, 
-                               sizeof(sandesha2_invoker_bean_t) );
+       invoker_bean_impl = (sandesha2_invoker_bean_impl_t *) AXIS2_MALLOC(
+        env->allocator, sizeof(sandesha2_invoker_bean_impl_t) );
 
-       if (!bean)
+       if (!invoker_bean_impl)
        {
                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, 
AXIS2_FAILURE);
                return NULL;
        }
 
        /* init the properties. */
-       bean->msg_context_ref_key = NULL;
-       bean->msg_no = -1;
-       bean->seq_id = NULL;    
-       bean->invoked = AXIS2_FALSE;
-    bean->rm_bean = NULL;
+       invoker_bean_impl->msg_context_ref_key = NULL;
+       invoker_bean_impl->msg_no = -1;
+       invoker_bean_impl->seq_id = NULL;       
+       invoker_bean_impl->invoked = AXIS2_FALSE;
+    invoker_bean_impl->rm_bean = sandesha2_rm_bean_create(env);
+    invoker_bean_impl->invoker_bean.rm_bean.ops = &rm_bean_ops;
 
-       return bean;
+       return &(invoker_bean_impl->bean);
 }
 
 AXIS2_EXTERN sandesha2_invoker_bean_t* AXIS2_CALL
@@ -71,148 +85,218 @@
     axis2_char_t *seq_id,
     axis2_bool_t invoked)
 {
-       sandesha2_invoker_bean_t *bean = NULL;
+       sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
        AXIS2_ENV_CHECK(env, NULL);
+    
+    invoker_bean_impl = (sandesha2_invoker_bean_impl_t *) AXIS2_MALLOC(
+        env->allocator, sizeof(sandesha2_invoker_bean_impl_t) );
 
-       bean = (sandesha2_invoker_bean_t *) AXIS2_MALLOC( env->allocator, 
-                               sizeof(sandesha2_invoker_bean_t) );
-
-       if (!bean)
+       if (!invoker_bean_impl)
        {
                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, 
AXIS2_FAILURE);
                return NULL;
        }
-
        /* init the properties. */
        if(!ref_key)
-               bean->msg_context_ref_key = NULL;
+               invoker_bean_impl->msg_context_ref_key = NULL;
        else
-               bean->msg_context_ref_key = 
(axis2_char_t*)AXIS2_STRDUP(ref_key, env);
+               invoker_bean_impl->msg_context_ref_key = 
(axis2_char_t*)AXIS2_STRDUP(
+            ref_key, env);
 
        if(!seq_id)
-               bean->seq_id = NULL;    
+               invoker_bean_impl->seq_id = NULL;       
        else
-               bean->seq_id = (axis2_char_t*)AXIS2_STRDUP(seq_id, env);
+               invoker_bean_impl->seq_id = (axis2_char_t*)AXIS2_STRDUP(seq_id, 
env);
 
-       bean->msg_no = msg_no;
-       bean->invoked = invoked;
-    bean->rm_bean = NULL;
+       invoker_bean_impl->msg_no = msg_no;
+       invoker_bean_impl->invoked = invoked;
+    invoker_bean_impl->rm_bean = sandesha2_rm_bean_create(env);
+    invoker_bean_impl->invoker_bean.rm_bean.ops = &rm_bean_ops;
 
-       return bean;
+       return &(invoker_bean_impl->bean);
 }
 
 axis2_status_t AXIS2_CALL
 sandesha2_invoker_bean_free(
-    sandesha2_invoker_bean_t *invoker,
+    sandesha2_invoker_bean_t *invoker_bean,
     const axis2_env_t *env)
 {
-       if(invoker->rm_bean)
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+       if(invoker_bean_impl->rm_bean)
        {
-               sandesha2_rm_bean_free(invoker->rm_bean, env);
-               invoker->rm_bean= NULL;
+               sandesha2_rm_bean_free(invoker_bean_impl->rm_bean, env);
+               invoker_bean_impl->rm_bean= NULL;
        }
-       if(invoker->msg_context_ref_key)
+       if(invoker_bean_impl->msg_context_ref_key)
        {
-               AXIS2_FREE(env->allocator, invoker->msg_context_ref_key);
-               invoker->msg_context_ref_key= NULL;
+               AXIS2_FREE(env->allocator, 
invoker_bean_impl->msg_context_ref_key);
+               invoker_bean_impl->msg_context_ref_key= NULL;
        }
                
-       if(!invoker->seq_id)
+       if(!invoker_bean_impl->seq_id)
        {
-               AXIS2_FREE(env->allocator, invoker->seq_id);
-               invoker->seq_id= NULL;
+               AXIS2_FREE(env->allocator, invoker_bean_impl->seq_id);
+               invoker_bean_impl->seq_id= NULL;
        }
+    if(invoker_bean_impl)
+    {
+        AXIS2_FREE(env->allocator, invoker_bean_impl->seq_id);
+        invoker_bean_impl = NULL;
+    }
     return AXIS2_SUCCESS;
 }
 
 sandesha2_rm_bean_t * AXIS2_CALL
 sandesha2_invoker_bean_get_base( 
-    sandesha2_invoker_bean_t* invoker,
+    sandesha2_invoker_bean_t *invoker_bean,
     const axis2_env_t *env)
 {
-       return invoker->rm_bean;
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+       return invoker_bean_impl->rm_bean;
 
 }      
 
 void AXIS2_CALL
 sandesha2_invoker_bean_set_base (
-    sandesha2_invoker_bean_t *invoker,
+    sandesha2_invoker_bean_t *invoker_bean,
     const axis2_env_t *env, 
     sandesha2_rm_bean_t* rm_bean)
 {
-       invoker->rm_bean = rm_bean;
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+       invoker_bean_impl->rm_bean = rm_bean;
 }
 
 axis2_char_t* AXIS2_CALL 
 sandesha2_invoker_bean_get_msg_ctx_ref_key(
-        sandesha2_invoker_bean_t *invoker,
+        sandesha2_invoker_bean_t *invoker_bean,
                const axis2_env_t *env)
 {
-       return invoker->msg_context_ref_key;
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+       return invoker_bean_impl->msg_context_ref_key;
 }
 
 void AXIS2_CALL 
 sandesha2_invoker_bean_set_msg_context_ref_key(
-    sandesha2_invoker_bean_t *invoker,
+    sandesha2_invoker_bean_t *invoker_bean,
     const axis2_env_t *env, axis2_char_t* context_ref_id)
 {
-       if(invoker->msg_context_ref_key)
-               AXIS2_FREE(env->allocator, invoker->msg_context_ref_key);
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+       if(invoker_bean_impl->msg_context_ref_key)
+               AXIS2_FREE(env->allocator, 
invoker_bean_impl->msg_context_ref_key);
 
-       invoker->msg_context_ref_key = 
+       invoker_bean_impl->msg_context_ref_key = 
         (axis2_char_t*)AXIS2_STRDUP(context_ref_id, env);
 }
        
 
 long AXIS2_CALL 
 sandesha2_invoker_bean_get_msg_no(
-    sandesha2_invoker_bean_t *invoker,
+    sandesha2_invoker_bean_t *invoker_bean,
     const axis2_env_t *env)
 {
-       return invoker->msg_no;
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+       return invoker_bean_impl->msg_no;
 }
        
 void AXIS2_CALL
 sandesha2_invoker_bean_set_msg_no(
-    sandesha2_invoker_bean_t *invoker,
+    sandesha2_invoker_bean_t *invoker_bean,
     const axis2_env_t *env, long msgno)
 {
-       invoker->msg_no = msgno;
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+       invoker_bean_impl->msg_no = msgno;
 }
 
 axis2_char_t* AXIS2_CALL
 sandesha2_invoker_bean_get_seq_id(
-    sandesha2_invoker_bean_t *invoker,
+    sandesha2_invoker_bean_t *invoker_bean,
     const axis2_env_t *env)
 {
-       return invoker->seq_id;
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+       return invoker_bean_impl->seq_id;
 }
 
 void AXIS2_CALL
 sandesha2_invoker_bean_set_seq_id(
-    sandesha2_invoker_bean_t *invoker,
+    sandesha2_invoker_bean_t *invoker_bean,
     const axis2_env_t *env, axis2_char_t* int_seq_id)
 {
-       invoker->seq_id = (axis2_char_t*)AXIS2_STRDUP(int_seq_id, env);
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+       invoker_bean_impl->seq_id = (axis2_char_t*)AXIS2_STRDUP(int_seq_id, 
env);
 
 }
 
-
-
 axis2_bool_t AXIS2_CALL
 sandesha2_invoker_bean_is_invoked (
-    sandesha2_invoker_bean_t *invoker,
+    sandesha2_invoker_bean_t *invoker_bean,
     const axis2_env_t *env)
 {
-       return invoker->invoked;
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+       return invoker_bean_impl->invoked;
 }
 
 void AXIS2_CALL 
 sandesha2_invoker_bean_set_invoked( 
-    sandesha2_invoker_bean_t *invoker,
+    sandesha2_invoker_bean_t *invoker_bean,
     const axis2_env_t *env,
     axis2_bool_t invoked)
 {
-       invoker->invoked = invoked;
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+       invoker_bean_impl->invoked = invoked;
+}
+
+void AXIS2_CALL
+sandesha2_invoker_bean_set_id( 
+    sandesha2_rm_bean_t *invoker_bean,
+       const axis2_env_t *env, 
+    long id)
+{
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+    sandesha2_rm_bean_set_id(invoker_bean_impl->rm_bean_impl, env, id);
+}
+
+long AXIS2_CALL
+sandesha2_invoker_bean_get_id( 
+    sandesha2_rm_bean_t *invoker_bean,
+       const axis2_env_t *env)
+{
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+    return sandesha2_rm_bean_get_id(invoker_bean_impl->rm_bean_impl, env);
+}
+
+void AXIS2_CALL
+sandesha2_invoker_bean_set_transaction( 
+    sandesha2_rm_bean_t *invoker_bean,
+       const axis2_env_t *env, 
+    sandesha2_transaction_t *transaction)
+{
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+    sandesha2_rm_bean_set_transaction(invoker_bean_impl->rm_bean_impl, env, 
+        transaction);
+}
+
+sandesha2_transaction_t *AXIS2_CALL
+sandesha2_invoker_bean_get_transaction( 
+    sandesha2_rm_bean_t *invoker_bean,
+       const axis2_env_t *env)
+{
+    sandesha2_invoker_bean_impl_t *invoker_bean_impl = NULL;
+    invoker_bean_impl = SANDESHA2_INTF_TO_IMPL(invoker_bean);
+    return sandesha2_rm_bean_get_transaction(invoker_bean_impl->rm_bean_impl, 
+        env);
 }
 

Added: webservices/sandesha/trunk/c/src/storage/beans/rm_bean.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/storage/beans/rm_bean.c?view=auto&rev=483896
==============================================================================
--- webservices/sandesha/trunk/c/src/storage/beans/rm_bean.c (added)
+++ webservices/sandesha/trunk/c/src/storage/beans/rm_bean.c Fri Dec  8 
01:28:34 2006
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+#include <sandesha2_rm_bean.h>
+#include <sandesha2_transaction.h>
+#include <string.h>
+#include <axis2_string.h>
+#include <axis2_utils.h>
+
+/* rm_bean struct */
+typedef struct sandesha2_rm_bean_impl
+{
+    sandesha2_rm_bean_t rm_bean;
+       long id;
+    sandesha2_transaction_t *transaction;
+} sandesha2_rm_bean_impl_t;
+
+#define SANDESHA2_INTF_TO_IMPL(rm_bean) ((sandesha2_rm_bean_impl_t *) rm_bean)
+static const sandesha2_rm_bean_ops_t rm_bean_ops =
+{
+    sandesha2_rm_bean_free,
+    sandesha2_rm_bean_set_id,
+    sandesha2_rm_bean_get_id,
+    sandesha2_rm_bean_set_transaction,
+    sandesha2_rm_bean_get_transaction
+};
+
+AXIS2_EXTERN sandesha2_rm_bean_t* AXIS2_CALL
+sandesha2_rm_bean_create(const axis2_env_t *env)
+{
+       sandesha2_rm_bean_impl_t *rm_bean_impl = NULL;
+       AXIS2_ENV_CHECK(env, NULL);
+       rm_bean_impl = (sandesha2_rm_bean_impl_t *)AXIS2_MALLOC(env->allocator,
+           sizeof(sandesha2_rm_bean_impl_t));
+       if(!rm_bean_impl)
+       {
+               AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, 
AXIS2_FAILURE);
+               return NULL;
+       }
+       /* init the properties. */
+       rm_bean_impl->id = -1;
+    rm_bean_impl->transaction = NULL;
+    rm_bean_impl->rm_bean.ops = &rm_bean_ops;
+       return &(rm_bean_impl->rm_bean);
+}
+
+void AXIS2_CALL
+sandesha2_rm_bean_free (
+    sandesha2_rm_bean_t *rm_bean,
+       const axis2_env_t *env)
+{
+}
+
+void AXIS2_CALL
+sandesha2_rm_bean_set_id( 
+    sandesha2_rm_bean_t *rm_bean,
+       const axis2_env_t *env, 
+    long id)
+{
+    sandesha2_rm_bean_impl_t *rm_bean_impl = NULL;
+    rm_bean_impl = SANDESHA2_INTF_TO_IMPL(rm_bean);
+    rm_bean_impl->id = id;
+}
+
+long AXIS2_CALL
+sandesha2_rm_bean_get_id( 
+    sandesha2_rm_bean_t *rm_bean,
+       const axis2_env_t *env)
+{
+    sandesha2_rm_bean_impl_t *rm_bean_impl = NULL;
+    rm_bean_impl = SANDESHA2_INTF_TO_IMPL(rm_bean);
+    return rm_bean_impl->id;
+}
+
+void AXIS2_CALL
+sandesha2_rm_bean_set_transaction( 
+    sandesha2_rm_bean_t *rm_bean,
+       const axis2_env_t *env, 
+    sandesha2_transaction_t *transaction)
+{
+    sandesha2_rm_bean_impl_t *rm_bean_impl = NULL;
+    rm_bean_impl = SANDESHA2_INTF_TO_IMPL(rm_bean);
+    rm_bean_impl->transaction = transaction;
+}
+
+sandesha2_transaction_t *AXIS2_CALL
+sandesha2_rm_bean_get_transaction( 
+    sandesha2_rm_bean_t *rm_bean,
+       const axis2_env_t *env)
+{
+    sandesha2_rm_bean_impl_t *rm_bean_impl = NULL;
+    rm_bean_impl = SANDESHA2_INTF_TO_IMPL(rm_bean);
+    return rm_bean_impl->transaction;
+}
+
+



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to