View Javadoc

1   /*
2    * $Id: RetrieveMessageRequesterFactory.java 19847 2010-10-06 02:19:43Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.transport.email;
12  
13  import org.mule.api.MuleException;
14  import org.mule.api.endpoint.InboundEndpoint;
15  import org.mule.api.transport.MessageRequester;
16  import org.mule.transport.AbstractMessageRequesterFactory;
17  
18  /**
19   * A source of mail receiving message dispatchers.
20   * The dispatcher can only be used to receive message (as apposed to
21   * listening for them). Trying to send or dispatch will throw an
22   * {@link UnsupportedOperationException}.
23   */
24  
25  public class RetrieveMessageRequesterFactory extends AbstractMessageRequesterFactory
26  {
27      private boolean requesterPerRequest = true;
28      /**
29       * By default client connections are closed after the request.
30       */
31      @Override
32      public boolean isCreateRequesterPerRequest()
33      {
34          return requesterPerRequest;
35      }
36  
37      @Override
38      public MessageRequester create(InboundEndpoint endpoint) throws MuleException
39      {
40          return new RetrieveMessageRequester(endpoint);
41      }
42  }