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