001    // SECTION-START[License Header]
002    // <editor-fold defaultstate="collapsed" desc=" Generated License ">
003    /*
004     *   Copyright (c) 2009 The JOMC Project
005     *   Copyright (c) 2005 Christian Schulte <cs@jomc.org>
006     *   All rights reserved.
007     *
008     *   Redistribution and use in source and binary forms, with or without
009     *   modification, are permitted provided that the following conditions
010     *   are met:
011     *
012     *     o Redistributions of source code must retain the above copyright
013     *       notice, this list of conditions and the following disclaimer.
014     *
015     *     o Redistributions in binary form must reproduce the above copyright
016     *       notice, this list of conditions and the following disclaimer in
017     *       the documentation and/or other materials provided with the
018     *       distribution.
019     *
020     *   THIS SOFTWARE IS PROVIDED BY THE JOMC PROJECT AND CONTRIBUTORS "AS IS"
021     *   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
022     *   THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
023     *   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JOMC PROJECT OR
024     *   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
025     *   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
026     *   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
027     *   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
028     *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
029     *   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
030     *   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
031     *
032     *   $Id: Invocation.java 1102 2009-12-07 03:01:58Z schulte2005 $
033     *
034     */
035    // </editor-fold>
036    // SECTION-END
037    package org.jomc.spi;
038    
039    import java.lang.reflect.Method;
040    import java.util.Map;
041    
042    // SECTION-START[Documentation]
043    // <editor-fold defaultstate="collapsed" desc=" Generated Documentation ">
044    /**
045     * Invocation of an object.
046     * <p>This specification declares a multiplicity of {@code One}.
047     * An application assembler is required to provide no more than one implementation of this specification (including none).
048     * Use of class {@link org.jomc.ObjectManager ObjectManager} is supported for getting that implementation.<pre>
049     * Invocation object = (Invocation) ObjectManagerFactory.getObjectManager( getClassLoader() ).getObject( Invocation.class );
050     * </pre>
051     * </p>
052     *
053     * <p>This specification does not apply to any scope. A new object is returned whenever requested.</p>
054     *
055     * @author <a href="mailto:cs@jomc.org">Christian Schulte</a> 1.0
056     * @version $Id: Invocation.java 1102 2009-12-07 03:01:58Z schulte2005 $
057     */
058    // </editor-fold>
059    // SECTION-END
060    // SECTION-START[Annotations]
061    // <editor-fold defaultstate="collapsed" desc=" Generated Annotations ">
062    @javax.annotation.Generated( value = "org.jomc.tools.JavaSources",
063                                 comments = "See http://jomc.sourceforge.net/jomc/1.0-alpha-11/jomc-tools" )
064    // </editor-fold>
065    // SECTION-END
066    public interface Invocation
067    {
068        // SECTION-START[Invocation]
069    
070        /**
071         * Gets the context of this invocation.
072         *
073         * @return The context of this invocation.
074         */
075        Map getContext();
076    
077        /**
078         * Gets the object of this invocation.
079         *
080         * @return The object of this invocation.
081         */
082        Object getObject();
083    
084        /**
085         * Gets the method of this invocation.
086         *
087         * @return The method of this invocation.
088         */
089        Method getMethod();
090    
091        /**
092         * Gets the arguments of this invocation.
093         *
094         * @return The arguments of this invocation or {@code null}.
095         */
096        Object[] getArguments();
097    
098        /**
099         * Gets the result of this invocation.
100         *
101         * @return The result of this invocation or {@code null}.
102         *
103         * @see #setResult(java.lang.Object)
104         */
105        Object getResult();
106    
107        /**
108         * Sets the result of this invocation.
109         *
110         * @param value The new result of this invocation or {@code null}.
111         *
112         * @see #getResult()
113         */
114        void setResult( Object value );
115    
116        // SECTION-END
117    }