org.subethamail.smtp.server
Class MessageListenerAdapter

java.lang.Object
  extended by org.subethamail.smtp.server.MessageListenerAdapter
All Implemented Interfaces:
MessageHandlerFactory

public class MessageListenerAdapter
extends java.lang.Object
implements MessageHandlerFactory

MessageHandlerFactory implementation which adapts to a collection of MessageListeners. This allows us to preserve the old, convenient interface.

Author:
Jeff Schnitzer, De Oliveira Edouard <doe_wanted@yahoo.fr>

Constructor Summary
MessageListenerAdapter(java.util.Collection<MessageListener> listeners)
          Initializes this factory with the listeners.
 
Method Summary
 MessageHandler create(MessageContext ctx)
          Called for the exchange of a single message during an SMTP conversation.
 AuthenticationHandler getAuthenticationHandler()
          Holds the AuthenticationHandler instantiation logic.
 AuthenticationHandlerFactory getAuthenticationHandlerFactory()
          Returns the auth handler factory
 void setAuthenticationHandlerFactory(AuthenticationHandlerFactory authenticationHandlerFactory)
          Sets the auth handler factory.
 void setMessageHandlerImpl(java.lang.Class<? extends AbstractMessageHandler> impl)
          Sets the AbstractMessageHandler implementation to use when creating the MessageHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageListenerAdapter

public MessageListenerAdapter(java.util.Collection<MessageListener> listeners)
Initializes this factory with the listeners.

Method Detail

create

public MessageHandler create(MessageContext ctx)
Description copied from interface: MessageHandlerFactory
Called for the exchange of a single message during an SMTP conversation.

Specified by:
create in interface MessageHandlerFactory
Parameters:
ctx - provides information about the client.

setMessageHandlerImpl

public void setMessageHandlerImpl(java.lang.Class<? extends AbstractMessageHandler> impl)
Sets the AbstractMessageHandler implementation to use when creating the MessageHandler.


getAuthenticationHandlerFactory

public AuthenticationHandlerFactory getAuthenticationHandlerFactory()
Returns the auth handler factory


setAuthenticationHandlerFactory

public void setAuthenticationHandlerFactory(AuthenticationHandlerFactory authenticationHandlerFactory)
Sets the auth handler factory.


getAuthenticationHandler

public AuthenticationHandler getAuthenticationHandler()
Holds the AuthenticationHandler instantiation logic. Either try to use a user defined AuthHandlerFactory or default to the internal class DummyAuthenticationHandler which always returns true.

Returns:
a new AuthenticationHandler


Copyright © 2011 SubEthaSMTP. All Rights Reserved. Build version: UNVERSIONED