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.model.resolvers;
8   
9   import org.mule.api.MuleEventContext;
10  import org.mule.api.transformer.TransformerException;
11  import org.mule.util.ClassUtils;
12  
13  /**
14   * Allows for arguments with no parameters to be called. Regardless of the payload of the current
15   * event, this resolver will always only look for No-Arg servic methods.
16   * <p/>
17   * Note that the {@link org.mule.model.resolvers.ReflectionEntryPointResolver} supports the resolution
18   * of no-arg service methods if the event payload received is of type {@link org.mule.transport.NullPayload}.
19   *
20   * @see org.mule.model.resolvers.ReflectionEntryPointResolver
21   * @see org.mule.transport.NullPayload
22   */
23  public class NoArgumentsEntryPointResolver extends AbstractArgumentEntryPointResolver
24  {
25      @Override
26      protected Class<?>[] getMethodArgumentTypes(Object[] payload)
27      {
28          return ClassUtils.NO_ARGS_TYPE;
29      }
30  
31      @Override
32      protected Object[] getPayloadFromMessage(MuleEventContext context) throws TransformerException
33      {
34          return ClassUtils.NO_ARGS;
35      }
36  }