View Javadoc

1   /*
2    * $Id: DynamicEntryPointResolver.java 7976 2007-08-21 14:26:13Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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.impl.model.resolvers;
12  
13  import org.mule.umo.UMODescriptor;
14  import org.mule.umo.model.ModelException;
15  import org.mule.umo.model.UMOEntryPoint;
16  import org.mule.umo.model.UMOEntryPointResolver;
17  
18  /**
19   * <code>DynamicEntryPointResolver</code>
20   * <OL>
21   * <LI> Checks to see if the component implements the Callable lifecycle interface,
22   * then the onCall(UMOEventContext) method will be used to receive the event.
23   * <LI> If the component has a transformer configured for it, the return type for the
24   * transformer will be matched against methods on the component to see if there is a
25   * method that accepts the transformer return type. If so this event will be used.
26   * Note if there is more than one match, an exception will be thrown.
27   * <LI> If there is a method on the component that accepts an
28   * org.mule.umo.UMOEventContext . If so this event will be used. Note if there is
29   * more than one match, an exception will be thrown.
30   * <LI> The last chack determines if there are any meothds on the component that
31   * accept a java.util.Event . If so this event will be used. Note if there is more
32   * than one match, an exception will be thrown.
33   * <LI> If none of the above find a match an exception will be thrown and the
34   * component registration will fail.
35   * </OL>
36   * It allows also void methods where Mule assumes that the Payload itself of the
37   * message will be modified.
38   * 
39   */
40  public class DynamicEntryPointResolver implements UMOEntryPointResolver
41  {
42  
43      /**
44       * Default Constructor
45       */
46      public DynamicEntryPointResolver()
47      {
48          super();
49      }
50  
51      /**
52       * Determinse if a void Entrypoint can be accepted. This will always return true
53       * for this implementation
54       * 
55       * @return true
56       */
57      protected boolean isVoidOk()
58      {
59          return true;
60      }
61  
62      public UMOEntryPoint resolveEntryPoint(UMODescriptor descriptor) throws ModelException
63      {
64          return new DynamicEntryPoint();
65      }
66  }