View Javadoc
1   // SECTION-START[License Header]
2   // <editor-fold defaultstate="collapsed" desc=" Generated License ">
3   /*
4    * Java Object Management and Configuration
5    * Copyright (C) Christian Schulte <cs@schulte.it>, 2005-206
6    * All rights reserved.
7    *
8    * Redistribution and use in source and binary forms, with or without
9    * modification, are permitted provided that the following conditions
10   * are met:
11   *
12   *   o Redistributions of source code must retain the above copyright
13   *     notice, this list of conditions and the following disclaimer.
14   *
15   *   o Redistributions in binary form must reproduce the above copyright
16   *     notice, this list of conditions and the following disclaimer in
17   *     the documentation and/or other materials provided with the
18   *     distribution.
19   *
20   * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22   * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23   * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
24   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25   * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30   *
31   * $JOMC: Invoker.java 5061 2015-05-31 13:20:40Z schulte $
32   *
33   */
34  // </editor-fold>
35  // SECTION-END
36  package org.jomc.spi;
37  
38  // SECTION-START[Documentation]
39  // <editor-fold defaultstate="collapsed" desc=" Generated Documentation ">
40  /**
41   * Invokes objects.
42   *
43   * <dl>
44   *   <dt><b>Identifier:</b></dt><dd>org.jomc.spi.Invoker</dd>
45   *   <dt><b>Multiplicity:</b></dt><dd>One</dd>
46   *   <dt><b>Scope:</b></dt><dd>None</dd>
47   * </dl>
48   *
49   * @author <a href="mailto:cs@schulte.it">Christian Schulte</a> 1.0
50   * @version 1.0
51   * @see org.jomc.ObjectManager#getObject(java.lang.Class) getObject(Invoker.class)
52   * @see org.jomc.ObjectManager#getObject(java.lang.Class,java.lang.String) getObject(Invoker.class, "<i>implementation name</i>")
53   * @see org.jomc.ObjectManagerFactory
54   */
55  // </editor-fold>
56  // SECTION-END
57  // SECTION-START[Annotations]
58  // <editor-fold defaultstate="collapsed" desc=" Generated Annotations ">
59  @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
60  // </editor-fold>
61  // SECTION-END
62  public interface Invoker
63  {
64      // SECTION-START[Invoker]
65  
66      /**
67       * Performs a method invocation on an object.
68       *
69       * @param invocation The invocation to perform.
70       *
71       * @return The return value of the invocation. If the declared return type of the method of the invocation is a
72       * primitive type, then the value returned by this method must be an instance of the corresponding primitive wrapper
73       * class; otherwise, it must be a type assignable to the declared return type of the method of the invocation.
74       * If the value returned by this method is {@code null} and the declared return type of the method of the invocation
75       * is primitive, then a {@code NullPointerException} will be thrown. If the value returned by this method is
76       * otherwise not compatible to the declared return type of the method of the invocation, a
77       * {@code ClassCastException} will be thrown.
78       *
79       * @throws Throwable The exception thrown from the method invocation. The exception's type must be assignable
80       * either to any of the exception types declared in the {@code throws} clause of the method of the invocation or to
81       * the unchecked exception types {@code java.lang.RuntimeException} or {@code java.lang.Error}.
82       * If a checked exception is thrown by this method that is not assignable to any of the exception types declared in
83       * the {@code throws} clause of the method of the invocation, then an {@code UndeclaredThrowableException}
84       * containing the exception that was thrown by this method will be thrown.
85       *
86       * @see java.lang.reflect.UndeclaredThrowableException
87       */
88      Object invoke( Invocation invocation ) throws Throwable;
89  
90      // SECTION-END
91  }