fix work around classloaders for field preencoders

This commit is contained in:
Greg Wilkins 2014-08-07 09:22:22 +10:00
parent 64e49a1fe5
commit a4d4b3ab57
2 changed files with 14 additions and 1 deletions

View File

@ -52,7 +52,7 @@ public class PreEncodedHttpField extends HttpField
{ {
try try
{ {
HttpFieldPreEncoder enc = iter.next(); encoders.add(iter.next());
} }
catch(Error|RuntimeException e) catch(Error|RuntimeException e)
{ {

View File

@ -366,6 +366,19 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co
_defaultProtocol=factory.getProtocol(); _defaultProtocol=factory.getProtocol();
} }
} }
public void addIfAbsentConnectionFactory(ConnectionFactory factory)
{
synchronized (_factories)
{
if (_factories.containsKey(factory.getProtocol()))
return;
_factories.put(factory.getProtocol().toLowerCase(Locale.ENGLISH), factory);
addBean(factory);
if (_defaultProtocol==null)
_defaultProtocol=factory.getProtocol();
}
}
public ConnectionFactory removeConnectionFactory(String protocol) public ConnectionFactory removeConnectionFactory(String protocol)
{ {