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