net.sf.jguiraffe.di.impl
Interface Invokable

All Known Implementing Classes:
ChainedInvocation, ConstructorInvocation, 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 156 2009-03-03 21:04:47Z oheger $
Author:
Oliver Heger

Method Summary
 java.util.List<Dependency> getParameterDependencies()
          Returns a list with all dependencies required for this invocation.
 java.lang.Object invoke(DependencyProvider depProvider, java.lang.Object target)
          Performs the invocation.
 

Method Detail

getParameterDependencies

java.util.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

java.lang.Object invoke(DependencyProvider depProvider,
                        java.lang.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


Copyright © 2009 The JGUIraffe Team. All Rights Reserved.