Interface Invokable

  • All Known Implementing Classes:
    ChainedInvocation, ConstructorInvocation, HelperInvocations, MethodInvocation, NullInvocation, SetPropertyInvocation

    public interface Invokable

    Definition of an interface for objects that perform some kind of method invocation.

    This interface allows handling of different invocations (e.g. constructor invocation, method invocation, etc.) in a generic way. It defines an invoke() method with a generic signature. It also demands that invokable objects must be able to return a list of dependencies they require.

    Version:
    $Id: Invokable.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Method Detail

      • getParameterDependencies

        List<Dependency> getParameterDependencies()
        Returns a list with all dependencies required for this invocation. Typically these dependencies define the parameters for the method call to be performed.
        Returns:
        a list with the dependencies required by this invocation
      • invoke

        Object invoke​(DependencyProvider depProvider,
                      Object target)
        Performs the invocation. This is the main method of an Invokable object, which actually executes a method. The passed in parameters should satisfy all requirements of an arbitrary invocation. Some of them may not be needed for a concrete invocation (e.g. a constructor invocation does not require a target object).
        Parameters:
        depProvider - the dependency provider, which can be used for resolving the parameter dependencies
        target - the target object, on which the invocation should be performed
        Returns:
        the result of the invocation