@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface ActivityInterface
Workflow.newActivityStub(Class)
methods.
Each method of the interface annotated with ActivityInterface
including inherited
from interfaces is a separate activity. By default the name of an activity type is "short
interface name"_"method name".
Example:
public interface A {
a();
}
@ActivityInterface
public interface B extends A {
b();
}
@ActivityInterface
public interface C extends B {
c();
}
public class CImpl implements C {
public void a() {}
public void b() {}
public void c() {}
}
When CImpl
instance is registered with the Worker
the
following activities are registered:
a()
is registered as "B_a" because interface A
lacks
ActivityInterface annotation. The workflow code can call activities through stubs to B
and C
interfaces. A call to crate stub to A
interface will fail
as A
is not annotated with ActivityInterface.Modifier and Type | Optional Element and Description |
---|---|
java.lang.String |
namePrefix
Prefix to prepend to method names to generate activity types.
|
public abstract java.lang.String namePrefix
Be careful about names that contain special characters. These names can be used as metric tags. And systems like prometheus ignore metrics which have tags with unsupported characters.