[PATCH 1.1] transport: mamaTransportImpl_getAdvisoryCauseAndPlatformInfo new function


John Gray <jgray@...>
 

This method allows bridges to pass middleware specific details regarding errors

and events.

 

Index: c_cpp/src/c/transport.c

===================================================================

RCS file: /cvsroot/products/mama/c_cpp/src/c/transport.c,v

retrieving revision 1.79.4.6.2.2.2.8.4.1

diff -u -r1.79.4.6.2.2.2.8.4.1 transport.c

--- c_cpp/src/c/transport.c          27 Dec 2011 21:27:26 -0000           1.79.4.6.2.2.2.8.4.1

+++ c_cpp/src/c/transport.c       29 Dec 2011 19:38:47 -0000

@@ -1960,32 +1960,6 @@

     }

}

-/**

- * Return the cause and platform info for the last message processed on the

- * transport.

- *

- * @param transport       The transport.

- * @param cause           To return the cause.

- * @param platformInfo    To return the bridge specific info, under no circumstances

- *                                        should the returned object be deleted.

- */

-void

-mamaTransportImpl_getAdvisoryCauseAndPlatformInfo (mamaTransport transport,

-                                                   short*        cause,

-                                                   const void**  platformInfo)

-{

-    if (!self)

-    {

-        mama_log (MAMA_LOG_LEVEL_ERROR,

-                "mamaTransportImpl_getAdvisoryCauseAndPlatformInfo (): "

-                "NULL transport.");

-        return;

-    }

-

-    *cause  = self->mCause;

-    *platformInfo = self->mPlatformInfo;

-}

-

void

mamaTransportImpl_getTransportIndex (mamaTransport transport,

                                      int*          transportIndex)

@@ -2363,3 +2337,44 @@

     return MAMA_STATUS_OK;

}

+/* *************************************************** */

+/* Internal Functions. */

+/* *************************************************** */

+

+void mamaTransportImpl_getAdvisoryCauseAndPlatformInfo(mamaTransport transport,

+        short *cause, const void **platformInfo)

+{

+    /* Get the impl. */

+    transportImpl *impl = (transportImpl *)transport;

+    if(NULL != impl)

+    {

+        /* Return the cause. */

+        *cause        = impl->mCause;

+        *platformInfo = impl->mPlatformInfo;

+    }

+    else

+    {

+        mama_log (MAMA_LOG_LEVEL_ERROR,

+                "mamaTransportImpl_getAdvisoryCauseAndPlatformInfo(): NULL "

+                "transport.");

+    }

+}

+

+void mamaTransportImpl_setAdvisoryCauseAndPlatformInfo (mamaTransport transport,

+        short cause, const void *platformInfo)

+{

+    /* Get the impl. */

+    transportImpl *impl = (transportImpl *)transport;

+    if(NULL != impl)

+    {

+        /* Set the cause. */

+        impl->mCause        = cause;

+        impl->mPlatformInfo = (void*)platformInfo;

+    }

+    else

+    {

+        mama_log (MAMA_LOG_LEVEL_ERROR,

+                "mamaTransportImpl_setAdvisoryCauseAndPlatformInfo(): NULL "

+                "transport.");

+    }

+}

Index: c_cpp/src/c/transportimpl.h

===================================================================

RCS file: /cvsroot/products/mama/c_cpp/src/c/transportimpl.h,v

retrieving revision 1.22.4.2.2.1.4.5

diff -u -r1.22.4.2.2.1.4.5 transportimpl.h

--- c_cpp/src/c/transportimpl.h 1 Sep 2011 16:34:38 -0000             1.22.4.2.2.1.4.5

+++ c_cpp/src/c/transportimpl.h              29 Dec 2011 19:38:47 -0000

@@ -158,12 +158,6 @@

extern void

mamaTransportImpl_unsetAllPossiblyStale (mamaTransport tport);

-MAMAExpDLL

-extern void

-mamaTransportImpl_getAdvisoryCauseAndPlatformInfo (mamaTransport tport,

-                                                   short*        cause,

-                                                   const void**  platformInfo);

-

/*

    Get the bridge impl associated with the specified transport.

    This will be how other objects gain access to the bridge.

@@ -251,4 +245,37 @@

}

#endif

+

+/**

+ * This function will return the cause and platform info for the last message

+ * processed on the transport.

+ *

+ * @param[in] transport            The transport.

+ * @param[out] cause To return the cause.

+ * @param[out] platformInfo To return the bridge specific info, under no

+ *             circumstances should the returned object be deleted.

+ *

+ */

+MAMAExpDLL

+extern void

+mamaTransportImpl_getAdvisoryCauseAndPlatformInfo(

+        mamaTransport tport,

+        short *cause,

+        const void **platformInfo);

+

+/**

+ * This function will set the cause and platform info for the transport.

+ *

+ * @param[in] transport            The transport.

+ * @param[in] cause The cause.

+ * @param[in] platformInfo Bridge specific info.

+ *

+ */

+MAMAExpDLL

+extern void

+mamaTransportImpl_setAdvisoryCauseAndPlatformInfo(

+        mamaTransport transport,

+        short cause,

+        const void *platformInfo);

+

#endif /* TransportImplH__ */

 

Signed-off-by: John Gray <jgray@...>