Package io.temporal.common.metadata
Class POJOWorkflowInterfaceMetadata
- java.lang.Object
-
- io.temporal.common.metadata.POJOWorkflowInterfaceMetadata
-
public final class POJOWorkflowInterfaceMetadata extends java.lang.Object
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
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Class<?>
getInterfaceClass()
Java interfaceClass
that backs this workflow interface.POJOWorkflowMethodMetadata
getMethodMetadata(java.lang.reflect.Method method)
Return metadata for a method of a workflow interface.java.util.List<POJOWorkflowMethodMetadata>
getMethodsMetadata()
java.util.Optional<POJOWorkflowMethodMetadata>
getWorkflowMethod()
java.util.Optional<java.lang.String>
getWorkflowType()
Workflow type the workflow interface defines.static POJOWorkflowInterfaceMetadata
newInstance(java.lang.Class<?> anInterface)
Use this method to create a metadata for anWorkflowInterface
annotated interface.static POJOWorkflowInterfaceMetadata
newInstance(java.lang.Class<?> anInterface, boolean validateWorkflowAnnotation)
Use this method to create a metadata for anWorkflowInterface
annotated interface or some of its partial base classes that me have some workflow methods but not be a full annotatedWorkflowInterface
.static POJOWorkflowInterfaceMetadata
newInstanceSkipWorkflowAnnotationCheck(java.lang.Class<?> anInterface)
Deprecated.usenewInstance(Class, boolean)
withvalidateWorkflowAnnotation==false
.
-
-
-
Method Detail
-
newInstanceSkipWorkflowAnnotationCheck
@Deprecated public static POJOWorkflowInterfaceMetadata newInstanceSkipWorkflowAnnotationCheck(java.lang.Class<?> anInterface)
Deprecated.usenewInstance(Class, boolean)
withvalidateWorkflowAnnotation==false
.
-
newInstance
public static POJOWorkflowInterfaceMetadata newInstance(java.lang.Class<?> anInterface)
Use this method to create a metadata for anWorkflowInterface
annotated interface.Requires
anInterface
to be annotated withWorkflowInterface
- All methods of
anInterface
to be annotated withWorkflowMethod
,QueryMethod
orSignalMethod
- Parameters:
anInterface
- interface to create metadata for- Returns:
- metadata for the interface
- Throws:
java.lang.IllegalArgumentException
- ifanInterface
fails validation
-
newInstance
public static POJOWorkflowInterfaceMetadata newInstance(java.lang.Class<?> anInterface, boolean validateWorkflowAnnotation)
Use this method to create a metadata for anWorkflowInterface
annotated interface or some of its partial base classes that me have some workflow methods but not be a full annotatedWorkflowInterface
.Requires
- All methods of
anInterface
to be annotated withWorkflowMethod
,QueryMethod
orSignalMethod
- Parameters:
anInterface
- interface to create metadata forvalidateWorkflowAnnotation
- if false, allowsanInterface
to 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:
java.lang.IllegalArgumentException
- ifanInterface
fails validation
- All methods of
-
getWorkflowMethod
public java.util.Optional<POJOWorkflowMethodMetadata> getWorkflowMethod()
-
getInterfaceClass
public java.lang.Class<?> getInterfaceClass()
Java interfaceClass
that backs this workflow interface.
-
getWorkflowType
public java.util.Optional<java.lang.String> getWorkflowType()
Workflow type the workflow interface defines. It is empty for interfaces that contain only signal and query methods.
-
getMethodMetadata
public POJOWorkflowMethodMetadata getMethodMetadata(java.lang.reflect.Method method)
Return metadata for a method of a workflow interface.- Throws:
java.lang.IllegalArgumentException
- if method doesn't belong to the workflow interface.
-
getMethodsMetadata
public java.util.List<POJOWorkflowMethodMetadata> getMethodsMetadata()
-
-