Class POJOWorkflowInterfaceMetadata
java.lang.Object
io.temporal.common.metadata.POJOWorkflowInterfaceMetadata
Metadata of a workflow interface.
Rules:
- A workflow implementation must implement at least one non empty interface annotated with WorkflowInterface
- An interface annotated with WorkflowInterface can extend zero or more interfaces.
- An interface annotated with WorkflowInterface defines workflow methods for all methods it inherited from interfaces which are not annotated with WorkflowInterface.
- Each method name can be defined only once across all interfaces annotated with WorkflowInterface. So if annotated interface A has method foo() and an annotated interface B extends A it cannot also declare foo() even with a different signature.
-
Method Summary
Modifier and TypeMethodDescriptionClass<?> Java interfaceClassthat backs this workflow interface.getMethodMetadata(Method method) Return metadata for a method of a workflow interface.Workflow type the workflow interface defines.newInstance(Class<?> anInterface) Use this method to create a metadata for anWorkflowInterfaceannotated interface.newInstance(Class<?> anInterface, boolean validateWorkflowAnnotation) Use this method to create a metadata for anWorkflowInterfaceannotated interface or some of its partial base classes that me have some workflow methods but not be a full annotatedWorkflowInterface.newInstanceSkipWorkflowAnnotationCheck(Class<?> anInterface) Deprecated.
-
Method Details
-
newInstanceSkipWorkflowAnnotationCheck
@Deprecated public static POJOWorkflowInterfaceMetadata newInstanceSkipWorkflowAnnotationCheck(Class<?> anInterface) Deprecated.usenewInstance(Class, boolean)withvalidateWorkflowAnnotation==false. -
newInstance
Use this method to create a metadata for anWorkflowInterfaceannotated interface.Requires
anInterfaceto be annotated withWorkflowInterface- All methods of
anInterfaceto be annotated withWorkflowMethod,QueryMethod,UpdateMethod,UpdateValidatorMethodorSignalMethod
- Parameters:
anInterface- interface to create metadata for- Returns:
- metadata for the interface
- Throws:
IllegalArgumentException- ifanInterfacefails validation
-
newInstance
public static POJOWorkflowInterfaceMetadata newInstance(Class<?> anInterface, boolean validateWorkflowAnnotation) Use this method to create a metadata for anWorkflowInterfaceannotated interface or some of its partial base classes that me have some workflow methods but not be a full annotatedWorkflowInterface.Requires
- All methods of
anInterfaceto be annotated withWorkflowMethod,QueryMethodorSignalMethod
- Parameters:
anInterface- interface to create metadata forvalidateWorkflowAnnotation- if false, allowsanInterfaceto not be annotated withWorkflowInterface. This to support invoking workflow signal and query methods through a base interface without such an annotation.- Returns:
- metadata for the interface
- Throws:
IllegalArgumentException- ifanInterfacefails validation
- All methods of
-
getWorkflowMethod
-
getInterfaceClass
Java interfaceClassthat backs this workflow interface. -
getWorkflowType
-
getMethodMetadata
Return metadata for a method of a workflow interface.- Throws:
IllegalArgumentException- if method doesn't belong to the workflow interface.
-
getMethodsMetadata
-
newInstance(Class, boolean)withvalidateWorkflowAnnotation==false.