You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2008/11/13 23:13:25 UTC
svn commit: r713841 [2/5] - in /webservices/axis/trunk/c/src: cbindings/
common/ engine/ engine/client/ engine/server/ platforms/aix/
platforms/hp-ux/ platforms/os400/ platforms/unix/ platforms/windows/
server/simple_axis_server/ soap/ transport/ trans...
Modified: webservices/axis/trunk/c/src/common/Param.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/common/Param.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/common/Param.cpp (original)
+++ webservices/axis/trunk/c/src/common/Param.cpp Thu Nov 13 14:13:23 2008
@@ -42,8 +42,11 @@
int AxisEngine::m_bServer;
-Param::~Param ()
+Param::
+~Param ()
{
+ logEntryEngine("Param::~Param")
+
if (m_AnySimpleType)
{
delete m_AnySimpleType;
@@ -65,11 +68,16 @@
break;
default:;
}
+
+ logExit()
}
-int Param::serialize (SoapSerializer &pSZ)
+int Param::
+serialize (SoapSerializer &pSZ)
{
+ logEntryEngine("Param::serialize")
+
AxisString ATprefix;
switch (m_Type)
{
@@ -80,7 +88,11 @@
* enc:arrayType="abc:phoneNumberType[2]" >";
*/
if (!m_Value.pArray)
+ {
+ logExitWithReturnCode(AXIS_FAIL)
+
return AXIS_FAIL;
+ }
if (RPC_ENCODED == pSZ.getStyle ())
{
@@ -165,10 +177,11 @@
case USER_TYPE:
if (RPC_ENCODED == pSZ.getStyle ())
{
- TRACE_SERIALIZE_FUNCT_ENTRY(m_Value.pCplxObj->pSZFunct, m_Value.pCplxObj->pObject, &pSZ, false);
- int stat = AXIS_FAIL;
- stat = m_Value.pCplxObj->pSZFunct (m_Value.pCplxObj->pObject, &pSZ, false);
- TRACE_SERIALIZE_FUNCT_EXIT(m_Value.pCplxObj->pSZFunct, stat);
+ logDebugArg2("Calling serializer function %p for complex object %p", m_Value.pCplxObj->pSZFunct, m_Value.pCplxObj->pObject)
+
+ int stat = m_Value.pCplxObj->pSZFunct (m_Value.pCplxObj->pObject, &pSZ, false);
+
+ logDebugArg2("Returned from serializer function %p, status=%d", m_Value.pCplxObj->pSZFunct, stat)
}
else
{
@@ -179,10 +192,11 @@
if (!m_sName.empty())
pSZ.serialize ("<", m_sName.c_str (), NULL);
- TRACE_SERIALIZE_FUNCT_ENTRY(m_Value.pCplxObj->pSZFunct, m_Value.pCplxObj->pObject, &pSZ, false);
- int stat = AXIS_FAIL;
- stat = m_Value.pCplxObj->pSZFunct (m_Value.pCplxObj->pObject, &pSZ, false);
- TRACE_SERIALIZE_FUNCT_EXIT(m_Value.pCplxObj->pSZFunct, stat);
+ logDebugArg2("Calling serializer function %p for complex object %p", m_Value.pCplxObj->pSZFunct, m_Value.pCplxObj->pObject)
+
+ int stat = m_Value.pCplxObj->pSZFunct (m_Value.pCplxObj->pObject, &pSZ, false);
+
+ logDebugArg2("Returned from serializer function %p, status=%d", m_Value.pCplxObj->pSZFunct, stat)
if (!m_sName.empty())
pSZ.serialize ("</", m_sName.c_str (), ">\n", NULL);
@@ -199,14 +213,21 @@
break;
}
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-void Param::setValue(XSDTYPE nType,
- IAnySimpleType* value)
+void Param::
+setValue(XSDTYPE nType,
+ IAnySimpleType* value)
{
+ logEntryEngine("Param::setValue")
+
m_Type = nType;
m_AnySimpleType = value;
+
+ logExit()
}
void Param::setPrefix (const AxisChar* prefix)
@@ -219,10 +240,13 @@
m_strUri = uri;
}
-int Param::setUserType (void* pObject,
- AXIS_DESERIALIZE_FUNCT pDZFunct,
- AXIS_OBJECT_DELETE_FUNCT pDelFunct)
+int Param::
+setUserType (void* pObject,
+ AXIS_DESERIALIZE_FUNCT pDZFunct,
+ AXIS_OBJECT_DELETE_FUNCT pDelFunct)
{
+ logEntryEngine("Param::setUserType")
+
if (m_Type != USER_TYPE)
return AXIS_FAIL;
@@ -231,51 +255,64 @@
m_Value.pCplxObj->pDZFunct = pDZFunct;
m_Value.pCplxObj->pDelFunct = pDelFunct;
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-int Param::setArrayElements (void* pElements)
+int Param::
+setArrayElements (void* pElements)
{
- if (m_Type != XSD_ARRAY)
- return AXIS_FAIL;
-
- if (m_Value.pArray)
- {
- if (m_Value.pArray->m_type != USER_TYPE)
- {
- m_Value.pArray->m_value.sta = pElements;
- return AXIS_SUCCESS;
- }
- else // unexpected situation
- return AXIS_FAIL;
+ logEntryEngine("Param::setArrayElements")
+
+ int rc = AXIS_FAIL;
+
+ if (m_Type == XSD_ARRAY)
+ {
+ if (m_Value.pArray)
+ {
+ if (m_Value.pArray->m_type != USER_TYPE)
+ {
+ m_Value.pArray->m_value.sta = pElements;
+ rc = AXIS_SUCCESS;
+ }
+ }
}
- return AXIS_FAIL;
+ logExitWithReturnCode(rc)
+
+ return rc;
}
// following function is called to set array of user types.
-int Param::setArrayElements (void* pObject,
- AXIS_DESERIALIZE_FUNCT pDZFunct,
- AXIS_OBJECT_DELETE_FUNCT pDelFunct)
+int Param::
+setArrayElements (void* pObject,
+ AXIS_DESERIALIZE_FUNCT pDZFunct,
+ AXIS_OBJECT_DELETE_FUNCT pDelFunct)
{
- if (m_Type != XSD_ARRAY)
- return AXIS_FAIL;
-
- if (m_Value.pArray)
- {
- if (m_Value.pArray->m_type == USER_TYPE)
- {
- m_Value.pArray->m_value.cta = new ComplexObjectHandler;
- m_Value.pArray->m_value.cta->pDZFunct = pDZFunct;
- m_Value.pArray->m_value.cta->pDelFunct = pDelFunct;
- m_Value.pArray->m_value.cta->pObject = pObject;
- return AXIS_SUCCESS;
- }
- else //unexpected situation
- return AXIS_FAIL;
+ logEntryEngine("Param::setArrayElements")
+
+ int rc = AXIS_FAIL;
+
+ if (m_Type == XSD_ARRAY)
+ {
+ if (m_Value.pArray)
+ {
+ if (m_Value.pArray->m_type == USER_TYPE)
+ {
+ m_Value.pArray->m_value.cta = new ComplexObjectHandler;
+ m_Value.pArray->m_value.cta->pDZFunct = pDZFunct;
+ m_Value.pArray->m_value.cta->pDelFunct = pDelFunct;
+ m_Value.pArray->m_value.cta->pObject = pObject;
+
+ rc = AXIS_SUCCESS;
+ }
+ }
}
- return AXIS_FAIL;
+ logExitWithReturnCode(rc)
+
+ return rc;
}
void Param::setName (const AxisChar* sName)
@@ -284,26 +321,39 @@
}
// ComplexObjectHandler functions
-ComplexObjectHandler::ComplexObjectHandler ()
+ComplexObjectHandler::
+ComplexObjectHandler ()
{
+ logEntryEngine("ComplexObjectHandler::ComplexObjectHandler")
+
init ();
+
+ logExit()
}
-ComplexObjectHandler::~ComplexObjectHandler ()
+ComplexObjectHandler::
+~ComplexObjectHandler ()
{
+ logEntryEngine("ComplexObjectHandler::~ComplexObjectHandler")
+
/* At client side we do not delete either output or return objects */
if (AxisEngine::m_bServer)
{
if (pObject && pDelFunct)
{
- TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pObject, 0);
+ logDebugArg2("Calling object delete function %p for object %p", pDelFunct, pObject)
+
pDelFunct(pObject, 0);
- TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
+
+ logDebugArg1("Returned from object delete function %p", pDelFunct)
}
}
+
+ logExit()
}
-void ComplexObjectHandler::init ()
+void ComplexObjectHandler::
+init ()
{
pObject = NULL;
pSZFunct = NULL;
Modified: webservices/axis/trunk/c/src/engine/AppScopeHandlerPool.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/AppScopeHandlerPool.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/AppScopeHandlerPool.cpp (original)
+++ webservices/axis/trunk/c/src/engine/AppScopeHandlerPool.cpp Thu Nov 13 14:13:23 2008
@@ -43,6 +43,8 @@
AppScopeHandlerPool::~AppScopeHandlerPool ()
{
+ logEntryEngine("AppScopeHandlerPool::~AppScopeHandlerPool")
+
for (map < int, list <BasicHandler*> >::iterator it =
m_Handlers.begin (); it != m_Handlers.end (); it++)
{
@@ -54,6 +56,8 @@
(*it).second.clear ();
}
m_Handlers.clear ();
+
+ logExit()
}
/* This method does not block the object. Instead expects that the calling
@@ -62,9 +66,11 @@
int AppScopeHandlerPool::getInstance (BasicHandler** pHandler, int nLibId)
{
- //lock ();
+ logEntryEngine("AppScopeHandlerPool::getInstance")
+
Lock l(this);
- int Status;
+ int Status = AXIS_SUCCESS;
+
if (m_Handlers.find (nLibId) != m_Handlers.end ())
{
if (m_Handlers[nLibId].empty ())
@@ -73,15 +79,14 @@
* application scope object. So just return SERVER_ENGINE_HANDLERBEINGUSED
*/
{
- //unlock ();
- throw AxisEngineException(SERVER_ENGINE_HANDLER_BEING_USED);
+ logThrowException("AxisEngineException - SERVER_ENGINE_HANDLER_BEING_USED")
+
+ throw AxisEngineException(SERVER_ENGINE_HANDLER_BEING_USED);
}
else
{
*pHandler = m_Handlers[nLibId].front ();
m_Handlers[nLibId].pop_front ();
- //unlock ();
- return AXIS_SUCCESS;
}
}
else // Not even the handler DLL loaded
@@ -94,17 +99,22 @@
*/
m_Handlers[nLibId].clear ();
}
- //unlock ();
- return Status;
}
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
int AppScopeHandlerPool::putInstance (BasicHandler* pHandler, int nLibId)
{
- //lock ();
+ logEntryEngine("AppScopeHandlerPool::putInstance")
+
Lock l(this);
m_Handlers[nLibId].push_back (pHandler);
- //unlock ();
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
Modified: webservices/axis/trunk/c/src/engine/Axis.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/Axis.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/Axis.cpp (original)
+++ webservices/axis/trunk/c/src/engine/Axis.cpp Thu Nov 13 14:13:23 2008
@@ -26,6 +26,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include <stdarg.h>
+
#include <string>
#include <map>
#include <iostream>
@@ -67,27 +69,22 @@
// The relative location of the wsdl files hardcoded
#define WSDLDIRECTORY "/wsdls/"
-// Define all global variables of the axisengine
-#ifdef ENABLE_AXISTRACE
-unsigned char chEBuf[1024];
-#endif
-
// Synchronized global variables.
-HandlerLoader* g_pHandlerLoader;
-AppScopeHandlerPool* g_pAppScopeHandlerPool;
+HandlerLoader* g_pHandlerLoader;
+AppScopeHandlerPool* g_pAppScopeHandlerPool;
RequestScopeHandlerPool* g_pRequestScopeHandlerPool;
SessionScopeHandlerPool* g_pSessionScopeHandlerPool;
-DeserializerPool* g_pDeserializerPool;
-SerializerPool* g_pSerializerPool;
-HandlerPool* g_pHandlerPool;
-bool g_isRunning;
+DeserializerPool* g_pDeserializerPool;
+SerializerPool* g_pSerializerPool;
+HandlerPool* g_pHandlerPool;
+bool g_isRunning;
// Unsynchronized read-only global variables.
-WSDDDeployment* g_pWSDDDeployment;
-AxisConfig* g_pConfig;
+WSDDDeployment* g_pWSDDDeployment;
+AxisConfig* g_pConfig;
//Keeps track of how many times initialize_module/uninitialize_module was called
-static volatile long g_uModuleInitialize = 0;
+static volatile long g_uModuleInitialize = 0;
void ModuleInitialize ()
@@ -126,8 +123,6 @@
g_pConfig = NULL;
g_pWSDDDeployment = NULL;
-
- AxisTrace::terminate();
}
#ifndef AXIS_CLIENT_LIB
@@ -358,31 +353,46 @@
SoapFault::initialize ();
ModuleInitialize ();
+ // Read from the configuration file
+ status = g_pConfig->readConfFile ();
+ if (status == AXIS_SUCCESS)
+ {
+ // One can also start trace via Axis::startTrace(). If that has been done,
+ // ignore the config file.
+ if (!AxisTrace::isLoggingEnabled())
+ {
+ AxisTrace::setLogFilter(g_pConfig->getAxisConfProperty(AXCONF_LOGFILTER));
+
+ if (bServer)
+ AxisTrace::startTrace(g_pConfig->getAxisConfProperty(AXCONF_LOGPATH));
+ else
+ AxisTrace::startTrace(g_pConfig->getAxisConfProperty(AXCONF_CLIENTLOGPATH));
+ }
+
+ string configProperties = g_pConfig->toString();
+ AxisTrace::writeTrace(configProperties.c_str(), configProperties.length());
+ }
+
+ // The entry log must start here - may revisit so as to start earlier.
+ logEntryEngine("initialize_module")
+
if (bServer) // no client side wsdd processing at the moment
{
- // Read from the configuration file
- status = g_pConfig->readConfFile ();
-
if (status == AXIS_SUCCESS)
- {
+ {
try
{
XMLParserFactory::initialize();
}
catch (AxisException& e)
{
+ logRethrowException()
+
throw AxisEngineException(e.getExceptionCode(), e.what());
}
char *pWsddPath = g_pConfig->getAxisConfProperty(AXCONF_WSDDFILEPATH);
-#if defined(ENABLE_AXISTRACE)
- status = AxisTrace::openFile ();
- if (status == AXIS_FAIL)
- {
- // Samisa - make sure that we start service, even if we cannot open log file
- // Hence do not return from here, may be we can log an error here
- }
-#endif
+
try
{
if (AXIS_SUCCESS != g_pWSDDDeployment->loadWSDD (pWsddPath))
@@ -390,6 +400,8 @@
}
catch (AxisException& e)
{
+ logRethrowException()
+
throw AxisEngineException(e.getExceptionCode(), e.what());
}
}
@@ -398,13 +410,8 @@
}
else if (bServer == 0) // client side module initialization
{
- status = g_pConfig->readConfFile (); //Read from the configuration file
-
if (status == AXIS_SUCCESS)
- {
-#if defined(ENABLE_AXISTRACE)
- status = AxisTrace::openFileByClient ();
-#endif
+ {
XMLParserFactory::initialize();
SOAPTransportFactory::initialize();
@@ -415,16 +422,6 @@
if (AXIS_SUCCESS != g_pWSDDDeployment->loadWSDD (pClientWsddPath))
status = AXIS_FAIL;
}
- else
- {
- AXISTRACE3( "Reading from the configuration file failed. \
- Check for error in the configuration file.\n\
- Handlers and logging are not working");
- /* TODO:Improve the AxisTrace so that it will log these kind of
- * messages into a log file according to the critical level
- * specified.
- */
- }
}
else
{
@@ -432,15 +429,17 @@
status = AXIS_SUCCESS;
}
g_isRunning = true;
+
+ logExitWithReturnCode(status)
}
else if (AxisEngine::m_bServer != bServer)
- {
+ {
throw AxisEngineException(SERVER_ENGINE_EXCEPTION);
}
}
catch (...)
{
- done_initializing();
+ done_initializing();
throw;
}
@@ -456,6 +455,8 @@
STORAGE_CLASS_INFO
int uninitialize_module ()
{
+ logEntryEngine("uninitialize_module")
+
start_initializing();
try
@@ -467,7 +468,7 @@
g_isRunning = false;
TypeMapping::uninitialize();
URIMapping::uninitialize();
- if (!AxisEngine::m_bServer) // we have to deal with transport factory only if it is the client
+ if (!AxisEngine::m_bServer)
SOAPTransportFactory::uninitialize();
ModuleUnInitialize();
SoapKeywordMapping::uninitialize();
@@ -478,10 +479,15 @@
catch (...)
{
done_initializing();
+
+ logRethrowException()
+
throw;
}
done_initializing();
+
+ logExitWithReturnCode(AXIS_SUCCESS)
return AXIS_SUCCESS;
}
@@ -498,16 +504,26 @@
void Axis::initialize(bool bIsServer)
{
+ logEntryEngine("Axis::initialize")
+
initialize_module(bIsServer);
+
+ logExit()
}
void Axis::terminate()
{
+ logEntryEngine("Axis::terminate")
+
uninitialize_module();
+
+ logExit()
}
void Axis::AxisDelete(void *pValue, XSDTYPE type)
{
+ logEntryEngine("Axis::AxisDelete")
+
if (pValue == NULL)
return;
@@ -752,6 +768,8 @@
default:
;
}
+
+ logExit()
}
bool Axis::isRunning()
@@ -761,7 +779,48 @@
void Axis::stopAxis()
{
+ logEntryEngine("Axis::stopAxis")
+
start_initializing();
g_isRunning = false;
done_initializing();
+
+ logExit()
}
+
+int Axis::
+startTrace(const char* logFilePath, const char *logFilter)
+{
+ AxisTrace::setLogFilter(logFilter);
+ return AxisTrace::startTrace(logFilePath);
+}
+
+void Axis::
+stopTrace()
+{
+ AxisTrace::stopTrace();
+}
+
+void Axis::
+writeTrace(const char* functionName, const char * fmt, ...)
+{
+ // If logging is not enabled, just return.
+ if (!AxisTrace::isLoggingEnabled() || !AxisTrace::isStubLoggingEnabled())
+ return;
+
+ // Construct final formatter
+ string myfmt;
+ string blank = " ";
+ if (NULL == fmt)
+ fmt = "";
+ myfmt += TRACE_COMPONENT_STUB + blank;
+ myfmt += TRACE_TYPE_DEBUG + blank;
+ myfmt += functionName;
+ myfmt += "(): ";
+ myfmt += fmt;
+
+ va_list vargs;
+ va_start(vargs,fmt);
+ AxisTrace::writeTrace(myfmt.c_str(), vargs);
+ va_end(vargs);
+}
\ No newline at end of file
Modified: webservices/axis/trunk/c/src/engine/AxisEngine.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/AxisEngine.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/AxisEngine.cpp (original)
+++ webservices/axis/trunk/c/src/engine/AxisEngine.cpp Thu Nov 13 14:13:23 2008
@@ -38,6 +38,8 @@
AxisEngine::AxisEngine ()
{
+ logEntryEngine("AxisEngine::AxisEngine")
+
m_pSZ = NULL;
m_pDZ = NULL;
m_pGReqFChain = NULL;
@@ -47,76 +49,84 @@
m_pSReqFChain = NULL;
m_pSResFChain = NULL;
m_pMsgData = NULL;
-
+
+ logExit()
}
AxisEngine::~AxisEngine ()
{
+ logEntryEngine("AxisEngine::~AxisEngine")
+
if (m_pDZ)
g_pDeserializerPool->putInstance (m_pDZ);
if (m_pSZ)
g_pSerializerPool->putInstance (m_pSZ);
if (m_pMsgData)
delete m_pMsgData;
+
+ logExit()
}
int AxisEngine::initialize ()
{
- int Status;
+ logEntryEngine("AxisEngine::initialize")
+
+ int Status = AXIS_SUCCESS;
+
m_pMsgData = new MessageData ();
if (!m_pMsgData)
- return AXIS_FAIL;
+ Status = AXIS_FAIL;
+
// Create and initialize Serializer and Deserializer objects
- if (AXIS_SUCCESS != (Status = g_pSerializerPool->getInstance ((IWrapperSoapSerializer**)&m_pSZ)))
- return Status;
- if (AXIS_SUCCESS != (Status = g_pDeserializerPool->getInstance ((IWrapperSoapDeSerializer**)&m_pDZ)))
- return Status;
- m_pMsgData->setSerializer (m_pSZ);
- m_pMsgData->setDeSerializer (m_pDZ);
+ if (AXIS_SUCCESS == Status)
+ Status = g_pSerializerPool->getInstance ((IWrapperSoapSerializer**)&m_pSZ);
+
+ if (AXIS_SUCCESS == Status)
+ Status = g_pDeserializerPool->getInstance ((IWrapperSoapDeSerializer**)&m_pDZ);
+
+ if (AXIS_SUCCESS == Status)
+ {
+ m_pMsgData->setSerializer (m_pSZ);
+ m_pMsgData->setDeSerializer (m_pDZ);
+ }
+
+ logExitWithReturnCode(Status)
- return AXIS_SUCCESS;
+ return Status;
}
void AxisEngine::unInitialize ()
{
+ logEntryEngine("AxisEngine::unInitialize")
+
if (m_pMsgData)
{
delete m_pMsgData;
m_pMsgData = NULL;
}
- /* nothing to do with m_pWSDD because its destructor deletes its objects
- * nothing to do with m_pHandlerPool because its destructor deletes its
- * objects
- */
+
+ logExit()
}
-int AxisEngine::initializeHandlers (string & sSessionId,
- AXIS_PROTOCOL_TYPE protocol)
+int AxisEngine::initializeHandlers (string & sSessionId, AXIS_PROTOCOL_TYPE protocol)
{
- int Status = AXIS_SUCCESS;
+ logEntryEngine("AxisEngine::initializeHandlers")
+
+ int Status;
+
// Get Global Handlers from the pool if configured any
- if (AXIS_SUCCESS !=
- (Status =
- g_pHandlerPool->getGlobalRequestFlowHandlerChain (&m_pGReqFChain,
- sSessionId)))
- return Status;
- if (AXIS_SUCCESS !=
- (Status =
- g_pHandlerPool->getGlobalResponseFlowHandlerChain (&m_pGResFChain,
- sSessionId)))
- return Status;
+ Status = g_pHandlerPool->getGlobalRequestFlowHandlerChain (&m_pGReqFChain, sSessionId);
+ if (AXIS_SUCCESS == Status)
+ Status = g_pHandlerPool->getGlobalResponseFlowHandlerChain (&m_pGResFChain, sSessionId);
// Get Transport Handlers from the pool if configured any
- if (AXIS_SUCCESS !=
- (Status =
- g_pHandlerPool->getTransportRequestFlowHandlerChain (&m_pTReqFChain,
- sSessionId, protocol)))
- return Status;
- if (AXIS_SUCCESS !=
- (Status =
- g_pHandlerPool->getTransportResponseFlowHandlerChain (&m_pTResFChain,
- sSessionId, protocol)))
- return Status;
+ if (AXIS_SUCCESS == Status)
+ Status = g_pHandlerPool->getTransportRequestFlowHandlerChain (&m_pTReqFChain, sSessionId, protocol);
+ if (AXIS_SUCCESS == Status)
+ Status = g_pHandlerPool->getTransportResponseFlowHandlerChain (&m_pTResFChain, sSessionId, protocol);
+
+ logExitWithReturnCode(Status)
+
return Status;
}
Modified: webservices/axis/trunk/c/src/engine/DeserializerPool.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/DeserializerPool.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/DeserializerPool.cpp (original)
+++ webservices/axis/trunk/c/src/engine/DeserializerPool.cpp Thu Nov 13 14:13:23 2008
@@ -37,40 +37,31 @@
m_DZList.clear();
}
-/*
- * ~DeserializerPool sometimes fails on AIX, so this method has been
- * recoded to make it more defensive and added extra trace. It fails
- * intermittently and the last line in the trace shows the exit of
- * the last ~SoapSerializer().
- *
- *
- */
+
DeserializerPool::~DeserializerPool ()
{
+ logEntryEngine("DeserializerPool::~DeserializerPool")
+
list<IWrapperSoapDeSerializer*>::iterator it = m_DZList.begin();
while (it != m_DZList.end())
{
IWrapperSoapDeSerializer *dz = *it;
-#ifdef ENABLE_AXISTRACE
- if (AxisTrace::isTraceOn())
- {
- char text[256];
- sprintf(text, "~DeserializerPool<%p> dz=%p", this, dz);
- AxisTrace::traceLine(text);
- }
-#endif
-
if (NULL != dz)
delete dz;
it++;
}
m_DZList.clear();
+
+ logExit()
}
int DeserializerPool::getInstance (IWrapperSoapDeSerializer** ppDZ)
{
- //lock ();
+ logEntryEngine("DeserializerPool::getInstance")
+
+ int Status = AXIS_SUCCESS;
+
Lock l(this);
if (!m_DZList.empty ())
{
@@ -84,27 +75,32 @@
{
delete* ppDZ;
*ppDZ = NULL;
- //unlock ();
- AXISTRACE1 ("Deserializer could not be initialized", CRITICAL);
- return AXIS_FAIL;
+ Status = AXIS_FAIL;
}
}
- //unlock ();
- return AXIS_SUCCESS;
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
int DeserializerPool::putInstance (IWrapperSoapDeSerializer* pDZ)
{
- if (AXIS_SUCCESS != ((SoapDeSerializer*)pDZ)->init ())
+ logEntryEngine("DeserializerPool::putInstance")
+
+ int Status = ((SoapDeSerializer*)pDZ)->init ();
+
+ if (AXIS_SUCCESS == Status)
{
- delete pDZ;
- return AXIS_FAIL;
+ Lock l(this);
+ m_DZList.push_back (pDZ);
}
- //lock ();
- Lock l(this);
- m_DZList.push_back (pDZ);
- //unlock ();
- return AXIS_SUCCESS;
+ else
+ delete pDZ;
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
AXIS_CPP_NAMESPACE_END
Modified: webservices/axis/trunk/c/src/engine/HandlerChain.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/HandlerChain.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/HandlerChain.cpp (original)
+++ webservices/axis/trunk/c/src/engine/HandlerChain.cpp Thu Nov 13 14:13:23 2008
@@ -29,89 +29,104 @@
AXIS_CPP_NAMESPACE_START
-HandlerChain::HandlerChain ()
+HandlerChain::
+HandlerChain ()
{
}
-HandlerChain::~HandlerChain ()
+HandlerChain::
+~HandlerChain ()
{
/* Nothing to do because the list keeps only pointers to objects that
* belongs to the Handler pool;
*/
}
-int HandlerChain::invoke (void* pMsg)
+int HandlerChain::
+invoke (void* pMsg)
{
+ logEntryEngine("HandlerChain::invoke")
+
+ int Status=AXIS_SUCCESS;
+
m_itCurrHandler = m_HandlerList.begin ();
while (m_itCurrHandler != m_HandlerList.end ())
{
BasicHandler* pHandler = (*m_itCurrHandler).m_pHandler;
- /*
- * if (AXIS_SUCCESS == pHandler->_functions->Invoke(pHandler->_object,
- * pMsg))
- * {
- * m_itCurrHandler++;
- * }
- * else
- * {
- * AXISTRACE1("Handler invoke not successful", WARN);
- * OnFault(pMsg);
- * return AXIS_FAIL;
- * }
- */
-
- //----------change by roshan on 12Feb2004-------------
+
if (0 != pHandler->_functions)
{
/* This is a C Handler */
}
else if (0 != pHandler->_object)
{
- if (AXIS_SUCCESS ==
- ((Handler *) (pHandler->_object))->invoke (pMsg))
- {
+ logDebugArg1("Calling invoke() method for handler %p", pHandler->_object)
+
+ Status = ((Handler *) (pHandler->_object))->invoke (pMsg);
+
+ logDebugArg2("Returned from invoke() method for handler %p with status=%d", pHandler->_object, Status)
+
+ if (AXIS_SUCCESS == Status)
m_itCurrHandler++;
- }
else
{
- AXISTRACE1 ("Handler invoke not successful", WARN);
onFault (pMsg);
- return AXIS_FAIL;
+ break;
}
}
}
- return AXIS_SUCCESS;
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-void HandlerChain::onFault (void* pMsg)
+void HandlerChain::
+onFault (void* pMsg)
{
+ logEntryEngine("HandlerChain::onFault")
+
while (m_itCurrHandler != m_HandlerList.begin ())
{
BasicHandler* pHandler = (*m_itCurrHandler).m_pHandler;
+
+ logDebugArg1("Calling onFault() method for handler %p", pHandler->_object)
+
pHandler->_functions->onFault (pHandler->_object, pMsg);
+
+ logDebugArg1("Returned from onFault() method for handler %p", pHandler->_object)
+
m_itCurrHandler--;
}
+
+ logExit()
}
-int HandlerChain::addHandler (BasicHandler* pHandler, int nScope, int nLibId)
+int HandlerChain::
+addHandler (BasicHandler* pHandler, int nScope, int nLibId)
{
+ logEntryEngine("HandlerChain::addHandler")
+
ChainItem item;
item.m_pHandler = pHandler;
item.m_nScope = nScope;
item.m_nLibId = nLibId;
m_HandlerList.push_back (item);
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-int HandlerChain::init ()
+int HandlerChain::
+init ()
{
m_HandlerList.clear ();
return AXIS_SUCCESS;
}
-int HandlerChain::fini ()
+int HandlerChain::
+fini ()
{
m_HandlerList.clear ();
return AXIS_SUCCESS;
Modified: webservices/axis/trunk/c/src/engine/HandlerLoader.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/HandlerLoader.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/HandlerLoader.cpp (original)
+++ webservices/axis/trunk/c/src/engine/HandlerLoader.cpp Thu Nov 13 14:13:23 2008
@@ -36,13 +36,17 @@
AXIS_CPP_NAMESPACE_START
-HandlerLoader::HandlerLoader ()
+HandlerLoader::
+HandlerLoader ()
{
PLATFORM_LOADLIBINIT();
}
-HandlerLoader::~HandlerLoader ()
+HandlerLoader::
+~HandlerLoader ()
{
+ logEntryEngine("HandlerLoader::~HandlerLoader")
+
//lock ();
Lock l(this);
HandlerInformation* pHandlerInfo = NULL;
@@ -55,10 +59,15 @@
}
l.unlock ();
PLATFORM_LOADLIBEXIT()
+
+ logExit()
}
-int HandlerLoader::deleteHandler (BasicHandler* pHandler, int nLibId)
+int HandlerLoader::
+deleteHandler (BasicHandler* pHandler, int nLibId)
{
+ logEntryEngine("HandlerLoader::deleteHandler")
+
Lock l(this);
if (m_HandlerInfoList.find (nLibId) != m_HandlerInfoList.end ())
{
@@ -68,13 +77,23 @@
}
else
{
+ logThrowException("AxisEngineException - SERVER_ENGINE_HANDLER_NOT_LOADED")
+
throw AxisEngineException(SERVER_ENGINE_HANDLER_NOT_LOADED);
}
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-int HandlerLoader::loadLib (HandlerInformation* pHandlerInfo)
+int HandlerLoader::
+loadLib (HandlerInformation* pHandlerInfo)
{
+ logEntryEngine("HandlerLoader::loadLib")
+
+ logDebugArg1("Loading handler %s", pHandlerInfo->m_sLib.c_str())
+
pHandlerInfo->m_Handler = PLATFORM_LOADLIB(pHandlerInfo->m_sLib.c_str());
if (!pHandlerInfo->m_Handler)
@@ -83,21 +102,35 @@
string sFullMessage = "Failed to load handler library " +
pHandlerInfo->m_sLib + ". " + PLATFORM_LOADLIB_ERROR;
+ logThrowExceptionWithData("AxisEngineException - SERVER_ENGINE_HANDLER_NOT_LOADED", sFullMessage.c_str())
+
throw AxisEngineException(SERVER_ENGINE_LIBRARY_LOADING_FAILED, sFullMessage.c_str());
}
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-int HandlerLoader::unloadLib (HandlerInformation* pHandlerInfo)
+int HandlerLoader::
+unloadLib (HandlerInformation* pHandlerInfo)
{
+ logEntryEngine("HandlerLoader::unloadLib")
+
+ logDebugArg1("Unloading handler %s", pHandlerInfo->m_sLib.c_str())
+
PLATFORM_UNLOADLIB(pHandlerInfo->m_Handler);
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-int HandlerLoader::createHandler (BasicHandler** pHandler, int nLibId)
+int HandlerLoader::
+createHandler (BasicHandler** pHandler, int nLibId)
{
+ logEntryEngine("HandlerLoader::createHandler")
+
//lock ();
Lock l(this);
*pHandler = NULL;
@@ -109,7 +142,9 @@
if (pHandlerInfo->m_sLib.empty ())
{
delete pHandlerInfo;
- AXISTRACE1("SERVER_CONFIG_LIBRARY_PATH_EMPTY", CRITICAL);
+
+ logThrowException("AxisEngineException - SERVER_CONFIG_LIBRARY_PATH_EMPTY")
+
throw AxisConfigException(SERVER_CONFIG_LIBRARY_PATH_EMPTY);
}
@@ -130,9 +165,11 @@
// Unload library - this must be done after obtaining error info above
unloadLib (pHandlerInfo);
-
delete pHandlerInfo;
- throw AxisEngineException(SERVER_ENGINE_LIBRARY_LOADING_FAILED);
+
+ logThrowExceptionWithData("AxisEngineException - SERVER_ENGINE_LIBRARY_LOADING_FAILED", sFullMessage.c_str())
+
+ throw AxisEngineException(SERVER_ENGINE_LIBRARY_LOADING_FAILED, sFullMessage.c_str());
}
else // success
{
@@ -142,6 +179,8 @@
else
{
// dead code - will never be reached, need to remove.
+ logThrowException("AxisEngineException - SERVER_ENGINE_LIBRARY_LOADING_FAILED")
+
throw AxisEngineException(SERVER_ENGINE_LIBRARY_LOADING_FAILED);
}
}
@@ -163,14 +202,16 @@
{
pBH->_functions->fini (pBH->_object);
pHandlerInfo->m_Delete (pBH);
- //unlock ();
- AXISTRACE1("SERVER_ENGINE_HANDLER_INIT_FAILED", CRITICAL);
+
+ logThrowException("AxisEngineException - SERVER_ENGINE_HANDLER_INIT_FAILED")
+
throw AxisEngineException(SERVER_ENGINE_HANDLER_INIT_FAILED);
}
}
else if (0 == pBH->_object)
{
- AXISTRACE1("SERVER_ENGINE_HANDLER_CREATION_FAILED", CRITICAL);
+ logThrowException("AxisEngineException - SERVER_ENGINE_HANDLER_CREATION_FAILED")
+
throw AxisEngineException(SERVER_ENGINE_HANDLER_CREATION_FAILED);
}
else
@@ -185,17 +226,22 @@
{
((HandlerBase*) pBH->_object)->fini ();
pHandlerInfo->m_Delete (pBH);
- AXISTRACE1("SERVER_ENGINE_HANDLER_INIT_FAILED", CRITICAL);
+
+ logThrowException("AxisEngineException - SERVER_ENGINE_HANDLER_INIT_FAILED")
+
throw AxisEngineException(SERVER_ENGINE_HANDLER_INIT_FAILED);
}
}
}
else
{
- AXISTRACE1("SERVER_ENGINE_HANDLER_CREATION_FAILED", CRITICAL);
+ logThrowException("AxisEngineException - SERVER_ENGINE_HANDLER_CREATION_FAILED")
+
throw AxisEngineException(SERVER_ENGINE_HANDLER_CREATION_FAILED);
}
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
Modified: webservices/axis/trunk/c/src/engine/HandlerPool.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/HandlerPool.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/HandlerPool.cpp (original)
+++ webservices/axis/trunk/c/src/engine/HandlerPool.cpp Thu Nov 13 14:13:23 2008
@@ -39,22 +39,29 @@
AXIS_CPP_NAMESPACE_START
-HandlerPool::HandlerPool ()
+HandlerPool::
+HandlerPool ()
{
}
-HandlerPool::~HandlerPool ()
+HandlerPool::
+~HandlerPool ()
{
- for (list <HandlerChain*>::iterator it = m_ChainStore.begin ();
- it != m_ChainStore.end (); it++)
+ logEntryEngine("HandlerPool::~HandlerPool")
+
+ for (list <HandlerChain*>::iterator it = m_ChainStore.begin (); it != m_ChainStore.end (); it++)
{
delete (*it);
}
+
+ logExit()
}
-int HandlerPool::getHandler (BasicHandler** ppHandler, string & sSessionId,
- int nScope, int nLibId)
+int HandlerPool::
+getHandler (BasicHandler** ppHandler, string & sSessionId, int nScope, int nLibId)
{
+ logEntryEngine("HandlerPool::getHandler")
+
*ppHandler = NULL;
int Status = AXIS_FAIL;
@@ -63,153 +70,175 @@
case AH_APPLICATION:
do
{
- if ((Status =
- g_pAppScopeHandlerPool->getInstance (ppHandler,
- nLibId)) ==
- AXIS_SUCCESS)
- {
- return Status;
- }
+ Status = g_pAppScopeHandlerPool->getInstance (ppHandler, nLibId);
+ if (AXIS_SUCCESS == Status)
+ break;
else if (Status == SERVER_ENGINE_HANDLER_BEING_USED)
- { //block this thread not this object
+ {
+ //block this thread not this object
PLATFORM_SLEEP(0);
}
else
- {
- return Status;
- }
- } while (Status == SERVER_ENGINE_HANDLER_BEING_USED);
+ break;
+ }
+ while (Status == SERVER_ENGINE_HANDLER_BEING_USED);
+
break;
+
case AH_SESSION:
- return g_pSessionScopeHandlerPool->getInstance (sSessionId,
- ppHandler, nLibId);
+ Status = g_pSessionScopeHandlerPool->getInstance (sSessionId, ppHandler, nLibId);
+ break;
+
case AH_REQUEST:
- return g_pRequestScopeHandlerPool->getInstance (ppHandler, nLibId);
+ Status = g_pRequestScopeHandlerPool->getInstance (ppHandler, nLibId);
+ break;
}
- return Status;
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-int HandlerPool::poolHandler (string &sSessionId, BasicHandler* pHandler,
- int nScope, int nLibId, bool bWebService)
+int HandlerPool::
+poolHandler (string &sSessionId, BasicHandler* pHandler, int nScope, int nLibId, bool bWebService)
{
+ logEntryEngine("HandlerPool::poolHandler")
+
switch (nScope)
{
case AH_APPLICATION:
g_pAppScopeHandlerPool->putInstance (pHandler, nLibId);
break;
case AH_SESSION:
- g_pSessionScopeHandlerPool->putInstance (sSessionId, pHandler,
- nLibId);
+ g_pSessionScopeHandlerPool->putInstance (sSessionId, pHandler, nLibId);
break;
case AH_REQUEST:
g_pRequestScopeHandlerPool->putInstance (pHandler, nLibId, bWebService);
break;
}
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-int HandlerPool::getGlobalRequestFlowHandlerChain (HandlerChain** ppChain,
- string & sSessionId)
+int HandlerPool::
+getGlobalRequestFlowHandlerChain (HandlerChain** ppChain, string & sSessionId)
{
- const WSDDHandlerList* pHandlerList =
- g_pWSDDDeployment->getGlobalRequestFlowHandlers ();
+ logEntryEngine("HandlerPool::getGlobalRequestFlowHandlerChain")
+
+ int Status = AXIS_SUCCESS;
+
+ const WSDDHandlerList* pHandlerList = g_pWSDDDeployment->getGlobalRequestFlowHandlers ();
if (pHandlerList)
- {
- return getHandlerChain (sSessionId, ppChain, pHandlerList);
- }
+ Status = getHandlerChain (sSessionId, ppChain, pHandlerList);
else
- {
*ppChain = NULL;
- return AXIS_SUCCESS; // NO_HANDLERS_CONFIGURED
- }
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-int HandlerPool::getGlobalResponseFlowHandlerChain (HandlerChain** ppChain,
- string &sSessionId)
+int HandlerPool::
+getGlobalResponseFlowHandlerChain (HandlerChain** ppChain, string &sSessionId)
{
- const WSDDHandlerList *pHandlerList =
- g_pWSDDDeployment->getGlobalResponseFlowHandlers ();
+ logEntryEngine("HandlerPool::getGlobalResponseFlowHandlerChain")
+
+ int Status = AXIS_SUCCESS;
+
+ const WSDDHandlerList *pHandlerList = g_pWSDDDeployment->getGlobalResponseFlowHandlers ();
if (pHandlerList)
- {
- return getHandlerChain (sSessionId, ppChain, pHandlerList);
- }
+ Status = getHandlerChain (sSessionId, ppChain, pHandlerList);
else
- {
*ppChain = NULL;
- return AXIS_SUCCESS; // NO_HANDLERS_CONFIGURED
- }
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-int HandlerPool::getTransportRequestFlowHandlerChain (HandlerChain** ppChain,
- string &sSessionId, AXIS_PROTOCOL_TYPE Protocol)
+int HandlerPool::
+getTransportRequestFlowHandlerChain (HandlerChain** ppChain, string &sSessionId, AXIS_PROTOCOL_TYPE Protocol)
{
- const WSDDHandlerList* pHandlerList =
- g_pWSDDDeployment->getTransportRequestFlowHandlers (Protocol);
+ logEntryEngine("HandlerPool::getTransportRequestFlowHandlerChain")
+
+ int Status = AXIS_SUCCESS;
+
+ const WSDDHandlerList* pHandlerList = g_pWSDDDeployment->getTransportRequestFlowHandlers (Protocol);
if (pHandlerList)
- {
- return getHandlerChain (sSessionId, ppChain, pHandlerList);
- }
+ Status = getHandlerChain (sSessionId, ppChain, pHandlerList);
else
- {
*ppChain = NULL;
- return AXIS_SUCCESS; // NO_HANDLERS_CONFIGURED
- }
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-int HandlerPool::getTransportResponseFlowHandlerChain (HandlerChain** ppChain,
- string & sSessionId, AXIS_PROTOCOL_TYPE Protocol)
+int HandlerPool::
+getTransportResponseFlowHandlerChain (HandlerChain** ppChain, string & sSessionId, AXIS_PROTOCOL_TYPE Protocol)
{
- const WSDDHandlerList* pHandlerList =
- g_pWSDDDeployment->getTransportResponseFlowHandlers (Protocol);
+ logEntryEngine("HandlerPool::getTransportResponseFlowHandlerChain")
+
+ int Status = AXIS_SUCCESS;
+
+ const WSDDHandlerList* pHandlerList = g_pWSDDDeployment->getTransportResponseFlowHandlers (Protocol);
if (pHandlerList)
- {
- return getHandlerChain (sSessionId, ppChain, pHandlerList);
- }
+ Status = getHandlerChain (sSessionId, ppChain, pHandlerList);
else
- {
*ppChain = NULL;
- return AXIS_SUCCESS; // NO_HANDLERS_CONFIGURED
- }
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-int HandlerPool::getRequestFlowHandlerChain (HandlerChain** ppChain,
- string &sSessionId, const WSDDService* pService)
+int HandlerPool::
+getRequestFlowHandlerChain (HandlerChain** ppChain, string &sSessionId, const WSDDService* pService)
{
+ logEntryEngine("HandlerPool::getRequestFlowHandlerChain")
+
+ int Status = AXIS_SUCCESS;
+
const WSDDHandlerList* pHandlerList = pService->getRequestFlowHandlers ();
if (pHandlerList)
- {
- return getHandlerChain (sSessionId, ppChain, pHandlerList);
- }
+ Status = getHandlerChain (sSessionId, ppChain, pHandlerList);
else
- {
*ppChain = NULL;
- /* AXISTRACE1("No handlers configured", INFO); */
- return AXIS_SUCCESS; // NO_HANDLERS_CONFIGURED
- }
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-int HandlerPool::getResponseFlowHandlerChain (HandlerChain** ppChain,
- string &sSessionId, const WSDDService* pService)
+int HandlerPool::
+getResponseFlowHandlerChain (HandlerChain** ppChain, string &sSessionId, const WSDDService* pService)
{
+ logEntryEngine("HandlerPool::getResponseFlowHandlerChain")
+
+ int Status = AXIS_SUCCESS;
+
const WSDDHandlerList* pHandlerList = pService->getResponseFlowHandlers ();
if (pHandlerList)
- {
- return getHandlerChain (sSessionId, ppChain, pHandlerList);
- }
+ Status = getHandlerChain (sSessionId, ppChain, pHandlerList);
else
- {
*ppChain = NULL;
- return AXIS_SUCCESS; // NO_HANDLERS_CONFIGURED
- }
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-int HandlerPool::getHandlerChain (string &sSessionId, HandlerChain** ppChain,
- const WSDDHandlerList* pHandlerList)
+int HandlerPool::
+getHandlerChain (string &sSessionId, HandlerChain** ppChain, const WSDDHandlerList* pHandlerList)
{
- //lock ();
+ logEntryEngine("HandlerPool::getHandlerChain")
+
Lock l(this);
*ppChain = NULL;
HandlerChain* pChain = NULL;
+
// check m_ChainStore to get a HandlerChain
if (!m_ChainStore.empty ())
{
@@ -218,35 +247,17 @@
pChain->init ();
}
else
- {
pChain = new HandlerChain ();
- }
WSDDHandler* pWSDDH = NULL;
BasicHandler* pBH = NULL;
int Status = AXIS_SUCCESS;
- for (WSDDHandlerList::const_iterator it = pHandlerList->begin ();
- it != pHandlerList->end (); it++)
+ for (WSDDHandlerList::const_iterator it = pHandlerList->begin (); it != pHandlerList->end (); it++)
{
pWSDDH = (*it);
- if ((Status = getHandler (&pBH, sSessionId, pWSDDH->getScope (),
- pWSDDH->getLibId ())) == AXIS_SUCCESS)
+ if ((Status = getHandler (&pBH, sSessionId, pWSDDH->getScope (), pWSDDH->getLibId ())) == AXIS_SUCCESS)
{
- /*
- * if (NORMAL_HANDLER == pBH->_functions->GetType(pBH->_object))
- * {
- * ((Handler*)
- * (pBH->_object))->SetOptionList(pWSDDH->GetParameterList());
- * pChain->AddHandler(pBH, pWSDDH->GetScope(), pWSDDH->GetLibId());
- * }
- * else
- * {
- * Status = SERVER_ENGINE_WRONGHANDLERTYPE;
- * break;
- * }
- */
-
if (0 != pBH->_functions)
{
/* C Handler */
@@ -255,10 +266,8 @@
{
if (NORMAL_HANDLER == ((Handler*) (pBH->_object))->getType ())
{
- ((Handler*) (pBH->_object))->
- setOptionList (pWSDDH->getParameterList ());
- pChain->addHandler (pBH, pWSDDH->getScope (),
- pWSDDH->getLibId ());
+ ((Handler*) (pBH->_object))-> setOptionList (pWSDDH->getParameterList ());
+ pChain->addHandler (pBH, pWSDDH->getScope (), pWSDDH->getLibId ());
}
else
{
@@ -268,13 +277,12 @@
}
}
else
- {
break;
- }
}
+
+
if (Status != AXIS_SUCCESS) //some failure so undo whatever done here
{
- AXISTRACE1 ("Handler failure", WARN);
string nosession = SESSIONLESSHANDLERS;
for (pChain->m_itCurrHandler = pChain->m_HandlerList.begin ();
pChain->m_itCurrHandler != pChain->m_HandlerList.end ();
@@ -289,19 +297,20 @@
}
pChain->fini ();
m_ChainStore.push_back (pChain);
- //unlock ();
- return Status;
}
else
- {
*ppChain = pChain;
- //unlock ();
- return Status;
- }
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-void HandlerPool::poolHandlerChain (HandlerChain* pChain, string &sSessionId)
+void HandlerPool::
+poolHandlerChain (HandlerChain* pChain, string &sSessionId)
{
+ logEntryEngine("HandlerPool::poolHandlerChain")
+
for (pChain->m_itCurrHandler = pChain->m_HandlerList.begin ();
pChain->m_itCurrHandler != pChain->m_HandlerList.end ();
pChain->m_itCurrHandler++)
@@ -314,14 +323,18 @@
}
}
pChain->fini ();
- //lock ();
+
Lock l(this);
m_ChainStore.push_back (pChain);
- //unlock ();
+
+ logExit()
}
-int HandlerPool::getWebService( BasicHandler ** ppHandler, string & sSessionId, const WSDDHandler * pService)
+int HandlerPool::
+getWebService( BasicHandler ** ppHandler, string & sSessionId, const WSDDHandler * pService)
{
+ logEntryEngine("HandlerPool::getWebService")
+
int Status = getHandler( ppHandler, sSessionId, pService->getScope(), pService->getLibId());
if( Status == AXIS_SUCCESS)
@@ -357,13 +370,20 @@
}*/
}
}
+
+ logExitWithReturnCode(Status)
+
return Status;
}
-void HandlerPool::poolWebService (string &sSessionId, BasicHandler* pHandler,
- const WSDDHandler * pHandlerInfo)
+void HandlerPool::
+poolWebService (string &sSessionId, BasicHandler* pHandler, const WSDDHandler * pHandlerInfo)
{
+ logEntryEngine("HandlerPool::poolWebService")
+
poolHandler (sSessionId, pHandler, pHandlerInfo->getScope (), pHandlerInfo->getLibId (), true);
+
+ logExit()
}
AXIS_CPP_NAMESPACE_END
Modified: webservices/axis/trunk/c/src/engine/RequestScopeHandlerPool.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/RequestScopeHandlerPool.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/RequestScopeHandlerPool.cpp (original)
+++ webservices/axis/trunk/c/src/engine/RequestScopeHandlerPool.cpp Thu Nov 13 14:13:23 2008
@@ -32,72 +32,72 @@
AXIS_CPP_NAMESPACE_START
-RequestScopeHandlerPool::RequestScopeHandlerPool ()
+RequestScopeHandlerPool::
+RequestScopeHandlerPool ()
{
}
-RequestScopeHandlerPool::~RequestScopeHandlerPool ()
+RequestScopeHandlerPool::
+~RequestScopeHandlerPool ()
{
- for (map < int, list <BasicHandler*> >::iterator it =
- m_Handlers.begin (); it != m_Handlers.end (); it++)
+ logEntryEngine("RequestScopeHandlerPool::~RequestScopeHandlerPool")
+
+ for (map < int, list <BasicHandler*> >::iterator it = m_Handlers.begin (); it != m_Handlers.end (); it++)
{
- for (list <BasicHandler*>::iterator itr = (*it).second.begin ();
- itr != (*it).second.end (); itr++)
+ for (list <BasicHandler*>::iterator itr = (*it).second.begin (); itr != (*it).second.end (); itr++)
{
g_pHandlerLoader->deleteHandler (*itr, (*it).first);
}
+
(*it).second.clear ();
}
+
m_Handlers.clear ();
+
+ logExit()
}
-int RequestScopeHandlerPool::getInstance (BasicHandler** pHandler, int nLibId)
+int RequestScopeHandlerPool::
+getInstance (BasicHandler** pHandler, int nLibId)
{
- //lock ();
+ logEntryEngine("RequestScopeHandlerPool::getInstance")
+
Lock l(this);
- int Status;
+
+ int Status = AXIS_SUCCESS;
+
if (m_Handlers.find (nLibId) != m_Handlers.end ())
{
if (m_Handlers[nLibId].empty ())
{
Status = g_pHandlerLoader->createHandler (pHandler, nLibId);
if (AXIS_SUCCESS == Status)
- {
- /* This just creates the entry in m_Handlers so that next
- * time we know that the DLL is loaded
- */
m_Handlers[nLibId].clear ();
- }
- //unlock ();
- return Status;
}
else
{
*pHandler = m_Handlers[nLibId].front ();
m_Handlers[nLibId].pop_front ();
- //unlock ();
- return AXIS_SUCCESS;
}
}
else // Not even the handler DLL loaded
{
Status = g_pHandlerLoader->createHandler (pHandler, nLibId);
if (AXIS_SUCCESS == Status)
- {
- /* This just creates the entry in m_Handlers so that next time we
- * know that the DLL is loaded
- */
m_Handlers[nLibId].clear ();
- }
- //unlock ();
- return Status;
}
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-int RequestScopeHandlerPool::putInstance (BasicHandler* pHandler, int nLibId, bool bWebService)
+int RequestScopeHandlerPool::
+putInstance (BasicHandler* pHandler, int nLibId, bool bWebService)
{
- //lock ();
+ logEntryEngine("RequestScopeHandlerPool::putInstance")
+
Lock l(this);
if (0 != pHandler->_functions)
@@ -111,7 +111,9 @@
}
m_Handlers[nLibId].push_back (pHandler);
- //unlock ();
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
Modified: webservices/axis/trunk/c/src/engine/SOAPTransportFactory.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/SOAPTransportFactory.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/SOAPTransportFactory.cpp (original)
+++ webservices/axis/trunk/c/src/engine/SOAPTransportFactory.cpp Thu Nov 13 14:13:23 2008
@@ -38,18 +38,25 @@
//void(*SOAPTransportFactory::m_startEventLoop)(void) = NULL;
//void(*SOAPTransportFactory::m_stopEventLoop)(void) = NULL;
-SOAPTransportFactory::SOAPTransportFactory()
+SOAPTransportFactory::
+SOAPTransportFactory()
{
m_LibHandler = 0;
}
-SOAPTransportFactory::~SOAPTransportFactory()
+SOAPTransportFactory::
+~SOAPTransportFactory()
{
+ logEntryEngine("SOAPTransportFactory::~SOAPTransportFactory")
+ logExit()
}
-int SOAPTransportFactory::initialize()
+int SOAPTransportFactory::
+initialize()
{
+ logEntryEngine("SOAPTransportFactory::initialize")
+
m_pcLibraryPath = g_pConfig->getAxisConfProperty(AXCONF_TRANSPORTHTTP);
if (!loadLib())
@@ -64,19 +71,13 @@
string sFullMessage = "Failed to resolve to SOAP transport procedures in library " +
string(m_pcLibraryPath) + ". " + PLATFORM_LOADLIB_ERROR;
+ logThrowExceptionWithData("AxisEngineException - SERVER_ENGINE_LOADING_TRANSPORT_FAILED", sFullMessage.c_str())
+
// Unload library - this must be done after obtaining error info above
unloadLib();
throw AxisEngineException(SERVER_ENGINE_LOADING_TRANSPORT_FAILED, sFullMessage.c_str());
}
-#ifdef ENABLE_AXISTRACE
- // Load function to do lib level inits
- void (*initializeLibrary) (AxisTraceEntrypoints*);
- initializeLibrary = (void (*)(AxisTraceEntrypoints*))PLATFORM_GETPROCADDR(m_LibHandler, INIT_FUNCTION);
-
- if (initializeLibrary)
- (*initializeLibrary)(AxisTrace::getTraceEntrypoints());
-#endif
void (*preloadChannels) (char*, char*);
preloadChannels = (void (*)(char*, char*))PLATFORM_GETPROCADDR(m_LibHandler, "preloadChannels");
@@ -87,38 +88,73 @@
else
{
// dead code - will never be reached, need to remove.
+ logThrowException("AxisEngineException - SERVER_ENGINE_LOADING_TRANSPORT_FAILED")
+
throw AxisEngineException(SERVER_ENGINE_LOADING_TRANSPORT_FAILED);
}
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-int SOAPTransportFactory::uninitialize()
+int SOAPTransportFactory::
+uninitialize()
{
+ logEntryEngine("SOAPTransportFactory::uninitialize")
+
void (*uninitializeLibrary) (void);
uninitializeLibrary = (void (*)(void))PLATFORM_GETPROCADDR(m_LibHandler, UNINIT_FUNCTION);
if (uninitializeLibrary)
(*uninitializeLibrary)();
- return unloadLib();
+
+ int Status = unloadLib();
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
/**
* Should create an instance of transport of type given by eProtocol
*/
-SOAPTransport* SOAPTransportFactory::getTransportObject(AXIS_PROTOCOL_TYPE eProtocol)
+SOAPTransport* SOAPTransportFactory::
+getTransportObject(AXIS_PROTOCOL_TYPE eProtocol)
{
+ logEntryEngine("SOAPTransportFactory::getTransportObject")
+
SOAPTransport* pTpt = NULL;
m_Create(&pTpt);
- pTpt->setProtocol(eProtocol);
+
+ if (pTpt)
+ {
+ pTpt->setProtocol(eProtocol);
+ if (AxisTrace::isTransportLoggingEnabled())
+ pTpt->enableTrace(AxisTrace::getLogFilePath().c_str(), AxisTrace::getLogFilter().c_str());
+ }
+
+ logExitWithPointer(pTpt)
+
return pTpt;
}
-void SOAPTransportFactory::destroyTransportObject(SOAPTransport* pObject)
+void SOAPTransportFactory::
+destroyTransportObject(SOAPTransport* pObject)
{
+ logEntryEngine("SOAPTransportFactory::destroyTransportObject")
+
m_Delete(pObject);
+
+ logExit()
}
-int SOAPTransportFactory::loadLib()
+int SOAPTransportFactory::
+loadLib()
{
+ logEntryEngine("SOAPTransportFactory::loadLib")
+
+ logDebugArg1("Loading transport %s", m_pcLibraryPath)
+
m_LibHandler = PLATFORM_LOADLIB(m_pcLibraryPath);
if (!m_LibHandler)
@@ -127,31 +163,29 @@
string sFullMessage = "Failed to load transport library " +
string(m_pcLibraryPath) + ". " + PLATFORM_LOADLIB_ERROR;
+ logThrowExceptionWithData("AxisEngineException - SERVER_ENGINE_LOADING_TRANSPORT_FAILED", sFullMessage.c_str())
+
throw AxisEngineException(SERVER_ENGINE_LOADING_TRANSPORT_FAILED, sFullMessage.c_str());
}
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-int SOAPTransportFactory::unloadLib()
+int SOAPTransportFactory::
+unloadLib()
{
- PLATFORM_UNLOADLIB(m_LibHandler);
+ logEntryEngine("SOAPTransportFactory::unloadLib")
- return AXIS_SUCCESS;
-}
+ logDebugArg1("Unloading transport %s", m_pcLibraryPath)
-/*
-void SOAPTransportFactory::startEventLoop()
-{
- if (m_startEventLoop)
- (*m_startEventLoop)();
-}
+ PLATFORM_UNLOADLIB(m_LibHandler);
-void SOAPTransportFactory::stopEventLoop()
-{
- if (m_stopEventLoop)
- (*m_stopEventLoop)();
+ logExitWithReturnCode(AXIS_SUCCESS)
+
+ return AXIS_SUCCESS;
}
-*/
AXIS_CPP_NAMESPACE_END
Modified: webservices/axis/trunk/c/src/engine/SOAPTransportFactory.h
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/SOAPTransportFactory.h?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/SOAPTransportFactory.h (original)
+++ webservices/axis/trunk/c/src/engine/SOAPTransportFactory.h Thu Nov 13 14:13:23 2008
@@ -76,21 +76,14 @@
static SOAPTransport* getTransportObject(AXIS_PROTOCOL_TYPE eProtocol);
static void destroyTransportObject(SOAPTransport* pObject);
- //static void startEventLoop();
- //static void stopEventLoop();
-
static int loadLib();
static int unloadLib();
private:
- static const char* m_pcLibraryPath; /* later this should be a list with libraries with thier other information */
+ static const char* m_pcLibraryPath;
static DLHandler m_LibHandler;
static CREATE_OBJECT1 m_Create;
static DELETE_OBJECT1 m_Delete;
-
-// static void (*m_startEventLoop) (void);
-// static void (*m_stopEventLoop) (void);
-
};
AXIS_CPP_NAMESPACE_END
Modified: webservices/axis/trunk/c/src/engine/SerializerPool.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/SerializerPool.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/SerializerPool.cpp (original)
+++ webservices/axis/trunk/c/src/engine/SerializerPool.cpp Thu Nov 13 14:13:23 2008
@@ -29,25 +29,37 @@
AXIS_CPP_NAMESPACE_START
-SerializerPool::SerializerPool ()
+SerializerPool::
+SerializerPool ()
{
+ logEntryEngine("SerializerPool::SerializerPool")
+ logExit()
}
-SerializerPool::~SerializerPool ()
+SerializerPool::
+~SerializerPool ()
{
+ logEntryEngine("SerializerPool::~SerializerPool")
+
for (list <IWrapperSoapSerializer*>::iterator it = m_SZList.begin ();
it != m_SZList.end (); it++)
{
delete (*it);
}
+
+ logExit()
}
// Pooling should be implemented
-int SerializerPool::getInstance (IWrapperSoapSerializer** ppSZ)
+int SerializerPool::
+getInstance (IWrapperSoapSerializer** ppSZ)
{
- //lock ();
+ logEntryEngine("SerializerPool::getInstance")
+
Lock l(this);
+
+ int Status = AXIS_SUCCESS;
if (!m_SZList.empty ())
{
@@ -63,25 +75,30 @@
#endif
}
+
if (AXIS_SUCCESS != ((SoapSerializer*)(*ppSZ))->init ())
{
delete *ppSZ;
*ppSZ = NULL;
- //unlock ();
- AXISTRACE1 ("Serializer pool could not be initialized", CRITICAL);
- return AXIS_FAIL;
+ Status = AXIS_FAIL;
}
- //unlock ();
- return AXIS_SUCCESS;
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-int SerializerPool::putInstance (IWrapperSoapSerializer* pSZ)
+int SerializerPool::
+putInstance (IWrapperSoapSerializer* pSZ)
{
- //lock ();
+ logEntryEngine("SerializerPool::putInstance")
+
Lock l(this);
m_SZList.push_back (pSZ);
- //unlock ();
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
Modified: webservices/axis/trunk/c/src/engine/SessionScopeHandlerPool.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/SessionScopeHandlerPool.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/SessionScopeHandlerPool.cpp (original)
+++ webservices/axis/trunk/c/src/engine/SessionScopeHandlerPool.cpp Thu Nov 13 14:13:23 2008
@@ -31,15 +31,20 @@
AXIS_CPP_NAMESPACE_START
-SessionScopeHandlerPool::SessionScopeHandlerPool ()
+SessionScopeHandlerPool::
+SessionScopeHandlerPool ()
{
+ logEntryEngine("SessionScopeHandlerPool::SessionScopeHandlerPool")
+ logExit()
}
-SessionScopeHandlerPool::~SessionScopeHandlerPool ()
+SessionScopeHandlerPool::
+~SessionScopeHandlerPool ()
{
- for (map <int, SessionHandlers*>::iterator it = m_Handlers.begin ();
- it != m_Handlers.end (); it++)
+ logEntryEngine("SessionScopeHandlerPool::~SessionScopeHandlerPool")
+
+ for (map <int, SessionHandlers*>::iterator it = m_Handlers.begin (); it != m_Handlers.end (); it++)
{
SessionHandlers *pSH = (*it).second;
for (SessionHandlers::iterator itr = pSH->begin ();
@@ -56,15 +61,20 @@
delete pSH;
}
m_Handlers.clear ();
+
+ logExit()
}
-int SessionScopeHandlerPool::getInstance (string &sSessionId,
- BasicHandler** pHandler, int nLibId)
+int SessionScopeHandlerPool::
+getInstance (string &sSessionId, BasicHandler** pHandler, int nLibId)
{
+ logEntryEngine("SessionScopeHandlerPool::getInstance")
+
//lock ();
Lock l(this);
- int Status;
+ int Status = AXIS_SUCCESS;
+
if (m_Handlers.find (nLibId) != m_Handlers.end ())
{
SessionHandlers *pSesHandlers = m_Handlers[nLibId];
@@ -76,44 +86,33 @@
// check in the store for reuse
if ((*pSesHandlers)[SESSIONLESSHANDLERS].empty ())
{
- //unlock ();
l.unlock ();
- return g_pHandlerLoader->createHandler (pHandler, nLibId);
+ Status = g_pHandlerLoader->createHandler (pHandler, nLibId);
}
else
{
*pHandler = (*pSesHandlers)[SESSIONLESSHANDLERS].front ();
(*pSesHandlers)[SESSIONLESSHANDLERS].pop_front ();
- //unlock ();
- return AXIS_SUCCESS;
}
}
else
{
*pHandler = HandlerList.front ();
HandlerList.pop_front ();
- //unlock ();
- return AXIS_SUCCESS;
}
- //unlock ();
- l.unlock ();
- return g_pHandlerLoader->createHandler (pHandler, nLibId);
}
else // No handler list for this session id
{
// Check in the store for reuse
if ((*pSesHandlers)[SESSIONLESSHANDLERS].empty ())
{
- //unlock ();
l.unlock ();
- return g_pHandlerLoader->createHandler (pHandler, nLibId);
+ Status = g_pHandlerLoader->createHandler (pHandler, nLibId);
}
else
{
*pHandler = (*pSesHandlers)[SESSIONLESSHANDLERS].front ();
(*pSesHandlers)[SESSIONLESSHANDLERS].pop_front ();
- //unlock ();
- return AXIS_SUCCESS;
}
}
}
@@ -122,28 +121,26 @@
Status = g_pHandlerLoader->createHandler (pHandler, nLibId);
if (AXIS_SUCCESS == Status)
{
- /* This just creates the entry in m_Handlers so that next time we
- * know that the DLL is loaded
- */
SessionHandlers* pNewSH = new SessionHandlers;
pNewSH->clear ();
m_Handlers[nLibId] = pNewSH;
}
- //unlock ();
- return Status;
}
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
-int SessionScopeHandlerPool::putInstance (string &sSessionId,
- BasicHandler* pHandler, int nLibId)
+int SessionScopeHandlerPool::
+putInstance (string &sSessionId, BasicHandler* pHandler, int nLibId)
{
- //lock ();
+ logEntryEngine("SessionScopeHandlerPool::putInstance")
+
Lock l(this);
SessionHandlers* pSesHandlers;
if (m_Handlers.find (nLibId) != m_Handlers.end ())
- {
pSesHandlers = m_Handlers[nLibId];
- }
else // This is unexpected situation. anyway do it
{
pSesHandlers = new SessionHandlers;
@@ -152,15 +149,22 @@
}
list <BasicHandler*>&HandlerList = ((*pSesHandlers)[sSessionId]);
HandlerList.push_back (pHandler);
- //unlock ();
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-void SessionScopeHandlerPool::endSession (string &sSessionId)
+void SessionScopeHandlerPool::
+endSession (string &sSessionId)
{
+ logEntryEngine("SessionScopeHandlerPool::endSession")
+
/* Traverse all the lists and remove corresponding handlers if any and put
* to SESSIONLESSHANDLERS
*/
+
+ logExit()
}
AXIS_CPP_NAMESPACE_END
Modified: webservices/axis/trunk/c/src/engine/XMLParserFactory.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/XMLParserFactory.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/XMLParserFactory.cpp (original)
+++ webservices/axis/trunk/c/src/engine/XMLParserFactory.cpp Thu Nov 13 14:13:23 2008
@@ -36,18 +36,25 @@
CREATE_OBJECT2 XMLParserFactory::m_Create = 0;
DELETE_OBJECT2 XMLParserFactory::m_Delete = 0;
-XMLParserFactory::XMLParserFactory()
+XMLParserFactory::
+XMLParserFactory()
{
m_LibHandler = 0;
}
-XMLParserFactory::~XMLParserFactory()
+XMLParserFactory::
+~XMLParserFactory()
{
-
+ logEntryEngine("XMLParserFactory::~XMLParserFactory")
+
+ logExit()
}
-int XMLParserFactory::initialize()
+int XMLParserFactory::
+initialize()
{
+ logEntryEngine("XMLParserFactory::initialize")
+
m_pcLibraryPath = g_pConfig->getAxisConfProperty(AXCONF_XMLPARSER);
if (!loadLib())
@@ -62,60 +69,79 @@
string sFullMessage = "Failed to resolve to XML Parser procedures in library " +
string(m_pcLibraryPath) + ". " + PLATFORM_LOADLIB_ERROR;
+ logThrowExceptionWithData("AxisEngineException - SERVER_ENGINE_LOADING_PARSER_FAILED", sFullMessage.c_str())
+
// Unload library - this must be done after obtaining error info above
unloadLib();
throw AxisEngineException(SERVER_ENGINE_LOADING_PARSER_FAILED, sFullMessage.c_str());
}
- else
- {
-#ifdef ENABLE_AXISTRACE
- // Load function to do lib level inits
- INIT_OBJECT2 initializeLibrary;
- initializeLibrary = (INIT_OBJECT2) PLATFORM_GETPROCADDR(m_LibHandler, INIT_FUNCTION2);
-
- if (initializeLibrary)
- (*initializeLibrary)(AxisTrace::getTraceEntrypoints());
-#endif
- }
}
else
{
// dead code - will never be reached, need to remove.
+ logThrowException("AxisEngineException - SERVER_ENGINE_LOADING_PARSER_FAILED")
+
throw AxisEngineException(SERVER_ENGINE_LOADING_PARSER_FAILED);
}
- return AXIS_SUCCESS;
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
+ return AXIS_SUCCESS;
}
-int XMLParserFactory::uninitialize()
+int XMLParserFactory::
+uninitialize()
{
-#ifdef ENABLE_AXISTRACE
- UNINIT_OBJECT2 uninitializeLibrary;
- uninitializeLibrary = (UNINIT_OBJECT2) PLATFORM_GETPROCADDR(m_LibHandler, UNINIT_FUNCTION2);
+ logEntryEngine("XMLParserFactory::uninitialize")
- if (uninitializeLibrary)
- (*uninitializeLibrary)();
-#endif
- return unloadLib();
+ int Status = unloadLib();
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
/**
* Should create an instance of transport of type given by eProtocol
*/
-XMLParser* XMLParserFactory::getParserObject()
+XMLParser* XMLParserFactory::
+getParserObject()
{
+ logEntryEngine("XMLParserFactory::getParserObject")
+
XMLParser* pTpt = 0;
- if (m_Create) m_Create(&pTpt);
+ if (m_Create)
+ m_Create(&pTpt);
+
+ if (pTpt)
+ {
+ if (AxisTrace::isParserLoggingEnabled())
+ pTpt->enableTrace(AxisTrace::getLogFilePath().c_str(), AxisTrace::getLogFilter().c_str());
+ }
+
+ logExitWithPointer(pTpt)
+
return pTpt;
}
-void XMLParserFactory::destroyParserObject(XMLParser* pObject)
+void XMLParserFactory::
+destroyParserObject(XMLParser* pObject)
{
+ logEntryEngine("XMLParserFactory::destroyParserObject")
+
m_Delete(pObject);
+
+ logExit()
}
-int XMLParserFactory::loadLib()
+int XMLParserFactory::
+loadLib()
{
+ logEntryEngine("XMLParserFactory::loadLib")
+
+ logDebugArg1("Loading parser %s", m_pcLibraryPath)
+
m_LibHandler = PLATFORM_LOADLIB(m_pcLibraryPath);
if (!m_LibHandler)
@@ -124,16 +150,27 @@
string sFullMessage = "Failed to load XML Parser library " +
string(m_pcLibraryPath) + ". " + PLATFORM_LOADLIB_ERROR;
+ logThrowExceptionWithData("AxisEngineException - SERVER_ENGINE_LOADING_PARSER_FAILED", sFullMessage.c_str())
+
throw AxisEngineException(SERVER_ENGINE_LOADING_PARSER_FAILED, sFullMessage.c_str());
}
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
-int XMLParserFactory::unloadLib()
+int XMLParserFactory::
+unloadLib()
{
+ logEntryEngine("XMLParserFactory::unloadLib")
+
+ logDebugArg1("Unloading parser %s", m_pcLibraryPath)
+
PLATFORM_UNLOADLIB(m_LibHandler);
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
Modified: webservices/axis/trunk/c/src/engine/XMLParserFactory.h
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/XMLParserFactory.h?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/XMLParserFactory.h (original)
+++ webservices/axis/trunk/c/src/engine/XMLParserFactory.h Thu Nov 13 14:13:23 2008
@@ -39,7 +39,7 @@
typedef int (* CREATE_OBJECT2) (XMLParser** inst);
typedef int (* DELETE_OBJECT2) (XMLParser* inst);
-typedef void (* INIT_OBJECT2) (AxisTraceEntrypoints* ep);
+typedef void (* INIT_OBJECT2) ();
typedef void (* UNINIT_OBJECT2) ();
AXIS_CPP_NAMESPACE_START
Modified: webservices/axis/trunk/c/src/engine/client/Call.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/client/Call.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/client/Call.cpp (original)
+++ webservices/axis/trunk/c/src/engine/client/Call.cpp Thu Nov 13 14:13:23 2008
@@ -48,15 +48,20 @@
AXIS_CPP_NAMESPACE_USE
-Call::Call ()
+Call::
+Call ()
:m_pcEndPointUri(NULL), m_strProxyHost(""), m_uiProxyPort(0), m_bUseProxy(false),
m_bCallInitialized(false), m_pContentIdSet(NULL), m_pStub(NULL)
{
+
m_pAxisEngine = NULL;
m_pIWSSZ = NULL;
m_pIWSDZ = NULL;
initialize_module (0);
+ // This needs to be here, after the initialize_module, otherwise, trace filter is not honored.
+ logEntryEngine("Call::Call")
+
m_pTransport = NULL;
m_nTransportType = APTHTTP1_1;
@@ -86,13 +91,21 @@
catch(...)
{
cleanup();
+
+ logRethrowException()
+
throw;
}
+
+ logExit()
}
-Call::~Call ()
+Call::
+~Call ()
{
- if (m_pAxisEngine)
+ logEntryEngine("Call::~Call")
+
+ if (m_pAxisEngine)
m_pAxisEngine->unInitialize ();
cleanup();
@@ -110,9 +123,12 @@
// Following is for C-binding support.
resetSoapFaultList();
+
+ logExit()
}
-void Call::cleanup()
+void Call::
+cleanup()
{
delete m_pContentIdSet;
m_pContentIdSet = NULL;
@@ -128,15 +144,17 @@
m_pcEndPointUri = NULL;
}
-int Call::setEndpointURI( const char * pchEndpointURI)
+int Call::
+setEndpointURI( const char * pchEndpointURI)
{
m_pTransport->setEndpointUri( pchEndpointURI);
return AXIS_SUCCESS;
}
-void Call::setOperation (const char* pchOperation,
- const char* pchNamespace)
+void Call::
+setOperation (const char* pchOperation,
+ const char* pchNamespace)
{
setOperation(pchOperation, pchNamespace, true);
}
@@ -145,11 +163,15 @@
const char* pchNamespace,
bool bIsWrapperStyle)
{
+ logEntryEngine("Call::setOperation")
+
m_pIWSSZ->createSoapMethod (pchOperation, pchNamespace);
m_pAxisEngine->getMessageData()->setOperationName(pchOperation);
SoapMethod* sm = getSOAPSerializer()->getSOAPMethod();
sm->setWrapperStyle(bIsWrapperStyle);
+
+ logExit()
}
void Call::addParameter( void * pValue,
@@ -193,15 +215,23 @@
int Call::sendAndReceive()
{
+ logEntryEngine("Call::sendAndReceive")
+
m_nStatus = m_pAxisEngine->process( m_pTransport, false);
+ logExitWithReturnCode(m_nStatus)
+
return m_nStatus;
}
int Call::send()
{
+ logEntryEngine("Call::send")
+
m_nStatus = m_pAxisEngine->process( m_pTransport, true);
+ logExitWithReturnCode(m_nStatus)
+
return m_nStatus;
}
@@ -218,6 +248,8 @@
int Call::initialize( PROVIDERTYPE nStyle)
{
+ logEntryEngine("Call::initialize")
+
m_bCallInitialized = true;
// Initialize re-usable objects of this instance (objects may have been
@@ -297,29 +329,44 @@
}
m_attachments.clear();
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
}
m_nStatus = AXIS_FAIL;
+
+ logExitWithReturnCode(AXIS_FAIL)
+
return AXIS_FAIL;
}
-
catch( AxisException& e)
{
e = e;
m_nStatus = AXIS_FAIL;
+
+ logRethrowException()
+
throw;
}
catch( ...)
{
- m_nStatus = AXIS_FAIL;
+ m_nStatus = AXIS_FAIL;
+
+ logRethrowException()
+
throw;
}
+
+ logExit()
}
int Call::unInitialize()
{
+ logEntryEngine("Call::unInitialize")
+
m_bCallInitialized = false;
if( m_pAxisEngine)
@@ -359,6 +406,9 @@
}
closeConnection(false);
+
+ logExitWithReturnCode(AXIS_SUCCESS)
+
return AXIS_SUCCESS;
}
@@ -393,6 +443,8 @@
int Call::setTransportProperty( AXIS_TRANSPORT_INFORMATION_TYPE type, const char* value)
{
+ logEntryEngine("Call::setTransportProperty")
+
int iSuccess = AXIS_SUCCESS;
// if SOAPAction is being set add extra "" to value
@@ -409,6 +461,8 @@
else
{
// need to throw some sort of exception relating to memory allocation failure?
+ logExitWithReturnCode(AXIS_FAIL)
+
return AXIS_FAIL;
}
}
@@ -416,7 +470,13 @@
iSuccess = m_pTransport->setTransportProperty( type, value);
if( iSuccess < 0)
+ {
+ logThrowExceptionWithData("AxisGenException", m_pTransport->getLastChannelError())
+
throw AxisGenException( -iSuccess, m_pTransport->getLastChannelError());
+ }
+
+ logExitWithReturnCode(iSuccess)
return iSuccess;
}
@@ -1175,6 +1235,8 @@
void Call::processSoapFault(AxisException *e,
void *exceptionHandlerFp)
{
+ logEntryEngine("Call::processSoapFault")
+
AXIS_EXCEPTION_HANDLER_FUNCT excFp = (AXIS_EXCEPTION_HANDLER_FUNCT)exceptionHandlerFp;
ISoapFault* pSoapFault = NULL;
@@ -1238,6 +1300,8 @@
}
else
excFp(e->getExceptionCode(), e->what(), NULL, NULL);
+
+ logExit()
}
void Call::resetSoapFaultList()
Modified: webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.cpp (original)
+++ webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.cpp Thu Nov 13 14:13:23 2008
@@ -43,13 +43,17 @@
ClientAxisEngine::
ClientAxisEngine ()
{
+ logEntryEngine("ClientAxisEngine::ClientAxisEngine")
+ logExit()
}
ClientAxisEngine::
~ClientAxisEngine ()
{
-
+ logEntryEngine("ClientAxisEngine::~ClientAxisEngine")
+
+ logExit()
}
MessageData* ClientAxisEngine::
@@ -67,87 +71,93 @@
int ClientAxisEngine::
process (SOAPTransport* pSoap, bool noResponse)
{
+ logEntryEngine("ClientAxisEngine::process")
+
int Status = AXIS_FAIL;
const WSDDService* pService = NULL;
try
{
- if (!pSoap)
- return AXIS_FAIL;
-
- m_pSoap = pSoap;
- string sSessionId = m_pSoap->getSessionId();
-
- do
+ if (pSoap)
{
- // Get the service name that was specified in the second parameter of the call
- // to setTransportProperty( SOAPACTION_HEADER , "") matches a service name in
- // the 'service' part of the WSDD file then call that service now.
- const char* pchService = pSoap->getServiceName();
-
- // Check that there is a valid service name.
- if( pchService != NULL)
- {
- // The convention for the service name appears to be service#port
- if( strchr( pchService, '#') == NULL)
- {
- int iStringLength = strlen( pchService);
- char * pszService = new char[iStringLength];
-
- memset( pszService, 0, iStringLength);
- // If there is no # seperator, then strip off the outer quotes. if they exist !
- if(strchr(pchService, '"') == NULL)
- memcpy( pszService, pchService, iStringLength);
- else
- memcpy( pszService, pchService + 1, iStringLength - 2);
-
- pService = g_pWSDDDeployment->getService( pszService);
-
- delete [] pszService;
- }
- else
- {
- char * pchTempService = new char [strlen(pchService)+1];
-
- // Skip the starting double quote
- strcpy(pchTempService, pchService+1);
-
- // The String returned as the service name has the format "Calculator#add".
- // So null terminate string at #.
- *(strchr(pchTempService, '#')) = '\0';
-
- // get service description object from the WSDD Deployment object
- pService = g_pWSDDDeployment->getService (pchTempService);
-
- delete [] pchTempService;
- }
- }
-
- //Get Global and Transport Handlers
- Status = initializeHandlers (sSessionId, pSoap->getProtocol());
- if (AXIS_SUCCESS != Status)
- throw AxisEngineException(SERVER_ENGINE_HANDLER_INIT_FAILED);
-
- //Get Service specific Handlers from the pool if configured any
- if (pService != NULL)
- {
- Status = g_pHandlerPool->getRequestFlowHandlerChain(&m_pSReqFChain, sSessionId, pService);
- if (AXIS_SUCCESS != Status)
- break;
-
- Status = g_pHandlerPool->getResponseFlowHandlerChain(&m_pSResFChain, sSessionId, pService);
- if (AXIS_SUCCESS != Status)
- break;
- }
-
- // Invoke all handlers and then the remote webservice
- // we generate response in the same way even if this has failed
- Status = invoke (m_pMsgData, noResponse);
+ m_pSoap = pSoap;
+ string sSessionId = m_pSoap->getSessionId();
+
+ do
+ {
+ // Get the service name that was specified in the second parameter of the call
+ // to setTransportProperty( SOAPACTION_HEADER , "") matches a service name in
+ // the 'service' part of the WSDD file then call that service now.
+ const char* pchService = pSoap->getServiceName();
+
+ // Check that there is a valid service name.
+ if( pchService != NULL)
+ {
+ // The convention for the service name appears to be service#port
+ if( strchr( pchService, '#') == NULL)
+ {
+ int iStringLength = strlen( pchService);
+ char * pszService = new char[iStringLength];
+
+ memset( pszService, 0, iStringLength);
+ // If there is no # seperator, then strip off the outer quotes. if they exist !
+ if(strchr(pchService, '"') == NULL)
+ memcpy( pszService, pchService, iStringLength);
+ else
+ memcpy( pszService, pchService + 1, iStringLength - 2);
+
+ pService = g_pWSDDDeployment->getService( pszService);
+
+ delete [] pszService;
+ }
+ else
+ {
+ char * pchTempService = new char [strlen(pchService)+1];
+
+ // Skip the starting double quote
+ strcpy(pchTempService, pchService+1);
+
+ // The String returned as the service name has the format "Calculator#add".
+ // So null terminate string at #.
+ *(strchr(pchTempService, '#')) = '\0';
+
+ // get service description object from the WSDD Deployment object
+ pService = g_pWSDDDeployment->getService (pchTempService);
+
+ delete [] pchTempService;
+ }
+ }
+
+ //Get Global and Transport Handlers
+ Status = initializeHandlers (sSessionId, pSoap->getProtocol());
+ if (AXIS_SUCCESS != Status)
+ {
+ logThrowException("AxisEngineException - SERVER_ENGINE_HANDLER_INIT_FAILED")
+
+ throw AxisEngineException(SERVER_ENGINE_HANDLER_INIT_FAILED);
+ }
+
+ //Get Service specific Handlers from the pool if configured any
+ if (pService != NULL)
+ {
+ Status = g_pHandlerPool->getRequestFlowHandlerChain(&m_pSReqFChain, sSessionId, pService);
+ if (AXIS_SUCCESS != Status)
+ break;
+
+ Status = g_pHandlerPool->getResponseFlowHandlerChain(&m_pSResFChain, sSessionId, pService);
+ if (AXIS_SUCCESS != Status)
+ break;
+ }
+
+ // Invoke all handlers and then the remote webservice
+ // we generate response in the same way even if this has failed
+ Status = invoke (m_pMsgData, noResponse);
+ }
+ while (0);
+
+ //release the handlers
+ releaseHandlers(sSessionId);
}
- while (0);
-
- //release the handlers
- releaseHandlers(sSessionId);
}
catch(AxisException& e)
{
@@ -155,19 +165,28 @@
* the original exception may be an transport exception which will go out of scope when
* the transport library is unloaded.
*/
+ logRethrowException()
+
throw AxisGenException(e);
}
- return Status;
+
+ logExitWithReturnCode(Status)
+
+ return Status;
}
void ClientAxisEngine::
releaseHandlers(string sSessionId)
{
+ logEntryEngine("ClientAxisEngine::releaseHandlers")
+
// Pool back the Service specific handlers
if (m_pSReqFChain)
g_pHandlerPool->poolHandlerChain(m_pSReqFChain, sSessionId);
if (m_pSResFChain)
g_pHandlerPool->poolHandlerChain(m_pSResFChain, sSessionId);
+
+ logExit()
}
int ClientAxisEngine::
@@ -179,6 +198,8 @@
int ClientAxisEngine::
invoke (MessageData* pMsg, bool noResponse)
{
+ logEntryEngine("ClientAxisEngine::invoke")
+
enum AE_LEVEL { AE_START = 1, AE_SERH, AE_GLH, AE_TRH, AE_SERV };
int Status = AXIS_FAIL;
int level = AE_START;
@@ -186,27 +207,54 @@
do
{
// Invoke client side service specific request handlers
+
+ logDebug("Invoke client side request handlers, if any.")
+
if (m_pSReqFChain)
+ {
+ logDebug("Invoke client side service specific request handlers")
+
if (AXIS_SUCCESS != (Status = m_pSReqFChain->invoke (pMsg)))
+ {
+ logDebug("Invoke of client side service-specific request handlers failed")
+
break;
+ }
+ }
- // AXISTRACE1("AFTER invoke service specific request handlers");
level++; //AE_SERH
// Invoke global request handlers
+
if (m_pGReqFChain)
+ {
+ logDebug("Invoke global request handlers")
+
if (AXIS_SUCCESS != (Status = m_pGReqFChain->invoke (pMsg)))
+ {
+ logDebug("Invoke of global request handlers failed")
+
break;
+ }
+ }
- // AXISTRACE1("AFTER invoke global request handlers");
level++; //AE_GLH
// Invoke transport request handlers
+
+
if (m_pTReqFChain)
+ {
+ logDebug("Invoke transport request handlers")
+
if (AXIS_SUCCESS != (Status = m_pTReqFChain->invoke (pMsg)))
+ {
+ logDebug("Invoke of transport request handlers failed")
+
break;
+ }
+ }
- // AXISTRACE1("AFTER invoke transport request handlers");
level++; // AE_TRH
if (AXIS_SUCCESS != (Status = m_pSZ->setOutputStream (m_pSoap)))
@@ -251,6 +299,9 @@
* at some point the response handlers from that point onwards
* are invoked.
*/
+
+ logDebug("Invoke client side response handlers, if any.")
+
switch (level)
{
case AE_SERV:
@@ -264,22 +315,36 @@
case AE_TRH:
// After invoking the transport handlers (at actual service invokation) it has failed
if (m_pTResFChain)
+ {
+ logDebug("Invoke client side transport handlers.")
+
m_pTResFChain->invoke (pMsg);
+ }
case AE_GLH:
// transport handlers have failed invoke global response handlers
if (m_pGResFChain)
+ {
+ logDebug("Invoke client side global response handlers.")
+
m_pGResFChain->invoke (pMsg);
+ }
case AE_SERH: // global handlers have failed
// invoke web service specific response handlers
if (m_pSResFChain)
+ {
+ logDebug("Invoke Web service-specific client side handlers.")
+
m_pSResFChain->invoke (pMsg);
+ }
case AE_START:;
// service specific handlers have failed
};
+ logExitWithReturnCode(Status)
+
return Status;
}