Class adapterClass =
DiscoveryUtils.loadImplementorClass( adapterClassName, ServletContainerAdapter.class );
if ( adapterClass != null )
{
ServletContainerAdapter sa =
( ServletContainerAdapter ) tryAdapter( adapterClass, servletContext );
if ( sa != null ) return sa;
}
}
/*
ClassLoaders loaders = ClassLoaders.getAppLoaders( ServletContainerAdapter.class, AdapterManager.class, true );
DiscoverServiceNames dsn = new DiscoverServiceNames( loaders );
ResourceNameIterator i = dsn.findResourceNames( ServletContainerAdapter.class.getName() );
while ( i.hasNext() )
{
Class adapterClass = loadClass( loaders, i.nextResourceName(), ServletContainerAdapter.class );
if ( adapterClass != null )
{
ServletContainerAdapter sa =
( ServletContainerAdapter ) tryAdapter( adapterClass, servletContext );
if ( sa != null ) return sa;
}
}
*/
Class[] classes = DiscoveryUtils.getImplementorClasses( ServletContainerAdapter.class );
for ( int i = 0; i < classes.length; i++ )
{
ServletContainerAdapter sa = ( ServletContainerAdapter ) tryAdapter( classes[i], servletContext );
if ( sa != null ) return sa;
}
_log.info( "No ServletContainerAdapter specified or discovered; using " + DefaultServletContainerAdapter.class );
ServletContainerAdapter sa =
new DefaultServletContainerAdapter()
{
public boolean accept( AdapterContext context )
{
return true;
}
};
sa.setContext( new AdapterContext( servletContext ) );
return sa;
}