{
if ( schemaManager != null )
{
if ( !( container.getBinaryAttributeDetector() instanceof SchemaBinaryAttributeDetector ) )
{
container.setBinaryAttributeDetector( new SchemaBinaryAttributeDetector( schemaManager ) );
}
}
}
else
{
BinaryAttributeDetector atDetector = new DefaultConfigurableBinaryAttributeDetector();
if ( schemaManager != null )
{
atDetector = new SchemaBinaryAttributeDetector( schemaManager );
}
ldapSession.setAttribute( LdapDecoder.MESSAGE_CONTAINER_ATTR,
new LdapMessageContainer<MessageDecorator<? extends Message>>( codec, atDetector ) );
}