@Override
public UDDICustodyTransferPortType getUDDICustodyTransferService(final String endpointURL)
throws TransportException
{
final UDDICustodyTransferPortType current = uddiCustodyTransferPortTypeRef.get() ;
if (current != null)
{
return current ;
}
final String custodyTransferUrl ;
if (endpointURL == null)
{
try
{
final UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(managerName) ;
custodyTransferUrl = manager.getClientConfig().getUDDINode(nodeName).getCustodyTransferUrl() ;
}
catch (final ConfigurationException ce)
{
throw new TransportException("Could not discover custodyTransferUrl for node " + nodeName, ce) ;
}
}
else
{
custodyTransferUrl = endpointURL ;
}
final Object delegatePortType = createDelegate(custodyTransferUrl) ;
final InvocationHandler handler = new TaskHandler(delegatePortType) ;
final UDDICustodyTransferPortType uddiCustodyTransferPortType = (UDDICustodyTransferPortType) Proxy.newProxyInstance(classLoader,
new Class[] {UDDICustodyTransferPortType.class}, handler) ;
if (uddiCustodyTransferPortTypeRef.compareAndSet(null, uddiCustodyTransferPortType))
{
return uddiCustodyTransferPortType ;
}