org.apache.tuscany.sca.implementation.java.introspect
Interface JavaClassVisitor

All Known Implementing Classes:
AbstractPropertyProcessor, AllowsPassByReferenceProcessor, BaseJavaClassVisitor, ComponentNameProcessor, ConstructorProcessor, ContextProcessor, ConversationIDProcessor, ConversationProcessor, DestroyProcessor, EagerInitProcessor, HeuristicPojoProcessor, InitProcessor, JSR250PolicyProcessor, PolicyProcessor, PropertyProcessor, ReferenceProcessor, ResourceProcessor, ScopeProcessor, ServiceProcessor

public interface JavaClassVisitor

Implementations process class-level metadata, typically parsing annotations and updating the corresponding ComponentType. A processor may, for example, create a Property which is responsible for injecting a complex type on a component implementation instance when it is instantiated.

Processors will receive callbacks as the implementation class is walked while evaluating an assembly. It is the responsibility of the parser to determine whether to perform an action during the callback.


Method Summary
<T> void
visitClass(java.lang.Class<T> clazz, JavaImplementation type)
          A callback received when the component implementation class is first loaded
<T> void
visitConstructor(java.lang.reflect.Constructor<T> constructor, JavaImplementation type)
          A callback received as the component implementation's constructor used for instantiation by the runtime is evaluated.
 void visitConstructorParameter(JavaParameterImpl parameter, JavaImplementation type)
           
<T> void
visitEnd(java.lang.Class<T> clazz, JavaImplementation type)
          The final callback received when all other callbacks during evaluation of the component implementation have been issued
 void visitField(java.lang.reflect.Field field, JavaImplementation type)
          A callback received as the component implementation's public and protected fields are evaluated
 void visitMethod(java.lang.reflect.Method method, JavaImplementation type)
          A callback received as the component implementation's public and protected methods are evaluated
<T> void
visitSuperClass(java.lang.Class<T> clazz, JavaImplementation type)
          A callback received as the component implementation class hierarchy is evaluated
 

Method Detail

visitClass

<T> void visitClass(java.lang.Class<T> clazz,
                    JavaImplementation type)
                throws IntrospectionException
A callback received when the component implementation class is first loaded

Parameters:
clazz - the component implementation class
type - the incomplete component type associated with the implementation class
Throws:
IntrospectionException - if an error is encountered while processing metadata

visitSuperClass

<T> void visitSuperClass(java.lang.Class<T> clazz,
                         JavaImplementation type)
                     throws IntrospectionException
A callback received as the component implementation class hierarchy is evaluated

Parameters:
clazz - the superclass in the component implmentation's class hierarchy
type - the incomplete component type associated with the implementation class
Throws:
IntrospectionException - if an error is encountered while processing metadata

visitMethod

void visitMethod(java.lang.reflect.Method method,
                 JavaImplementation type)
                 throws IntrospectionException
A callback received as the component implementation's public and protected methods are evaluated

Parameters:
method - the current public or protected method being evaluated
type - the incomplete component type associated with the implementation class
Throws:
IntrospectionException - if an error is encountered while processing metadata

visitConstructor

<T> void visitConstructor(java.lang.reflect.Constructor<T> constructor,
                          JavaImplementation type)
                      throws IntrospectionException
A callback received as the component implementation's constructor used for instantiation by the runtime is evaluated. If an implementation contains more than one constructor, the constructor passed to the callback will be chosen according to the algorithm described in the SCA Java Client and Implementation Model Specification.

Parameters:
constructor - the constructor used for instantiating component implementation instances
type - the incomplete component type associated with the implementation class
Throws:
IntrospectionException - if an error is encountered while processing metadata

visitConstructorParameter

void visitConstructorParameter(JavaParameterImpl parameter,
                               JavaImplementation type)
                               throws IntrospectionException
Parameters:
parameter -
type -
Throws:
IntrospectionException

visitField

void visitField(java.lang.reflect.Field field,
                JavaImplementation type)
                throws IntrospectionException
A callback received as the component implementation's public and protected fields are evaluated

Parameters:
field - the current public or protected field being evaluated
type - the incomplete component type associated with the implementation class
Throws:
IntrospectionException - if an error is encountered while processing metadata

visitEnd

<T> void visitEnd(java.lang.Class<T> clazz,
                  JavaImplementation type)
              throws IntrospectionException
The final callback received when all other callbacks during evaluation of the component implementation have been issued

Parameters:
clazz - the component implementation class
type - the incomplete component type associated with the implementation class
Throws:
IntrospectionException - if an error is encountered while processing metadata