You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Roshan Weerasuriya <ro...@opensource.lk> on 2004/07/30 13:19:23 UTC
RE: memory clean up
hi,
>1. Any outbound objects created either by the client application or a
> handlers should be managed by the creator itself. The Axis engine donot
> delete any objects (HeaderBlocks, Attributes, BasicNodes etc).
Yes, So the folliwng are the posibilities.
1) If you create those at the client side withing a client application
then it is done baically throught the Stub base classs. i.e From a
client application what you do to create and add a HeaderBlock is to
call the following method :
IHeaderBlock* Stub::createSOAPHeaderBlock(AxisChar * pachLocalName,
AxisChar * pachUri)
method, here the Stub base class will maintain a list of created
HeaderBlocks, and in the destructior of the Stub base class it will
delete those at its Destructor. (Just have a look at the Stub.cpp
source).
Note1: if a client wants it can delete them at any time using the delete
methods available in the Stub base class.
Note2 : Actualy here it deletes only the HeaderBlocks and from the
Destructor of the HeaderBlock it will delte the BasicNodes (i.e its
children) and the Attributes. (So the idea is basically that only
HeaderBlocks has to be delted by the user.)
2) If the HeaderBlocks etc are created from within a Handler then it is
the responsiblity of the Handler writer to write code to delete those.
For that the user can write the cleanup code in either the fini() method
or in the Destructor of the Handler. Depending on the following.
eg: if it is a sessoin handler which needs to maintain its informatoin
then the cleanup has to be done in the Destructor.
if it is a request type handler the clean up can be done in the "fini()"
mehtod of the Handler. Here user has to explicitly write the clean up
code as oppose to situation 1 which is described above.
Also Note 2 above will apply to this situation as well.
>2. Any
> inbound objects that are created by Axis Engine as a result of
> deserialization should be deallocated by a target handler. Axis Engine
> deallocates only the headerblocks that will remain in the deserializer
> (headerblocks with no target handler).
i.e if a target handler access a HeaderBlock through the DeSerializer
then it is the responsibility of the Handler to delete it.
Roshan
On Wed, 2004-07-28 at 17:28, Susantha Kumara wrote:
> >
> > For XML element and attribute objects that are created by
> > IHandlerSoapSerializer, HeaderBlock and Attribute, who is responsible
> for
> > deleting the objects when the request or response is processed? When
> does
> > memory purging happen?
> >
> The rules in this regard are as follows,
>
> 1. Any outbound objects created either by the client application or a
> handlers should be managed by the creator itself. The Axis engine donot
> delete any objects (HeaderBlocks, Attributes, BasicNodes etc). 2. Any
> inbound objects that are created by Axis Engine as a result of
> deserialization should be deallocated by a target handler. Axis Engine
> deallocates only the headerblocks that will remain in the deserializer
> (headerblocks with no target handler).
>
> Susantha.
>
>