[
https://issues.apache.org/jira/browse/AXIS2-3870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608298#action_12608298
]
Amila Chinthaka Suriarachchi commented on AXIS2-3870:
-----------------------------------------------------
Please see the removeServiceGroup method.
which removes all the services of the service group.
public AxisServiceGroup removeServiceGroup(String serviceGroupName) throws
AxisFault {
AxisServiceGroup axisServiceGroup = (AxisServiceGroup)
getChild(serviceGroupName);
if (axisServiceGroup == null) {
throw new AxisFault(Messages.getMessage("invalidservicegroupname",
serviceGroupName));
}
Iterator services = axisServiceGroup.getServices();
while (services.hasNext()) {
AxisService axisService = (AxisService) services.next();
allServices.remove(axisService.getName());
if (!axisService.isClientSide()) {
notifyObservers(AxisEvent.SERVICE_REMOVE, axisService);
}
}
removeChild(serviceGroupName);
notifyObservers(AxisEvent.SERVICE_REMOVE, axisServiceGroup);
return axisServiceGroup;
}
I tested with this client.
ConfigurationContext configurationContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
AXIS2_REPOSITORY_LOCATION,
AXIS2_CLIENT_CONFIG_FILE);
ServiceClient serviceClient = new
ServiceClient(configurationContext, null);
serviceClient.setTargetEPR(new
EndpointReference("http://localhost:8088/axis2/services/PlainTestInOutService"));
serviceClient.getOptions().setAction("urn:PlainTestInOutOperation");
OMElement response =
serviceClient.sendReceive(getTestOMElement("test"));
System.out.println("OMElement ==> " + response.toString());
serviceClient.cleanup();
try {
System.out.println("Waiting thread to sleep");
Thread.sleep(2000);
} catch (InterruptedException e) {
here I put a debug point at serviceClient.cleanup() method and checked. before
this statement there was a service and after that it has removed.
> Memory Leak using ServiceClient
> -------------------------------
>
> Key: AXIS2-3870
> URL: https://issues.apache.org/jira/browse/AXIS2-3870
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: kernel
> Affects Versions: 1.4
> Reporter: Hans G Knudsen
> Attachments: ClientLeak.java
>
>
> Hi!
> I think I see a leak when using ServiceClient.
> In my client I intialize the ConfigurationContext once and resuse it to
> initialize the ServiceClient :
> ServiceClient sender = new ServiceClient(configContext,null);
> Calling 'cleanup()' on the ServiceClinet explicitly after the service call
> does not help..
> I will supply a small testcase.
> /hans
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]