AspectJ AWS Activity 生成失败

AspectJ AWS Activity generation failing

我目前正在使用 AspectJ 为我的 AWS Activity 生成客户端实现代码。这对于工作流程和 activitys 通常都非常有效。

值得注意的是,我对 AspectJ 了解不多,因为我只将它用于此代码生成。

但是我已经达到了一个地步,我希望 return 来自 activity 的数组,这会阻止 activity class 生成其客户端实现(它也阻止了一些工作流代码的生成,但我认为这是一个副作用)。如果我把数组变成一个列表(只是为了一个测试点),一切都会重新开始工作。我在将数组传递给 activity 时没有遇到任何问题,只是 returning 它们。

澄清结构。我有一个定义 activity 的接口和一个执行实现的实现 class ...所以没什么太疯狂的。

破损:

public String[] myMethod( String a, String b, String c ) throws Exception;

作品:

public List<String> myMethod( String a, String b, String c ) throws Exception;

据我所知,我看不到任何 AspectJ 编译错误,但我只是在查看控制台。

我发现的唯一日志显示生成已完成,但它们确实报告生成的文件总数不同(正如预期的那样,因为它损坏了)。

破损:

    :B:  9:53:40 Compiler configuration for project TestProj doesn't know previous state, so assuming EVERYTHING has changed.
:B:  9:53:40 ===========================================================================================
:B:  9:53:40 Build kind = FULLBUILD
:B:  9:53:40 Project=TestProj, kind of build requested=Full AspectJ compilation
:B:  9:53:40 Timer event: 0ms: Flush included source file cache
:B:  9:53:40 Timer event: 0ms: Check delta
:B:  9:53:40 Builder: Tidied output folder(s), removed class files and derived resources
:B:  9:53:40 Timer event: 160ms: Pre compile
:B:  9:53:40 Compiler configuration for project TestProj has been read by compiler.  Resetting.
:B:  9:53:40      Configuration was [PROJECTSOURCEFILES_CHANGED, JAVAOPTIONS_CHANGED, ASPECTPATH_CHANGED, CLASSPATH_CHANGED, INPATH_CHANGED, NONSTANDARDOPTIONS_CHANGED, OUTJAR_CHANGED, PROJECTSOURCERESOURCES_CHANGED, OUTPUTDESTINATIONS_CHANGED, INJARS_CHANGED]
:B:  9:53:40 Resetting list of modified source files.  Was null
:C:  9:53:40 Preparing for build: not going to be incremental because no successful previous full build
:C:  9:53:41 Timer event: 850ms: Time to first compiled message
:C:  9:53:41 Timer event: 860ms: Time to first woven message
:C:  9:53:42 AspectJ reports build successful, build was: FULL
:C:  9:53:42 AJDE Callback: finish. Was full build: true
:B:  9:53:42 Timer event: 1560ms: Total time spent in AJDE
:B:  9:53:42 Timer event: 0ms: Refresh after build
:C:  9:53:42 Types affected during build = 166
:B:  9:53:42 Timer event: 2436ms: Total time spent in AJBuilder.build()
:B:  9:53:43 Timer event: 10ms: Update visualizer, xref, advice listeners for (separate thread): TestProj
:B:  9:53:43 Timer event: 20ms: Delete markers: TestProj (Finished deleting markers for TestProj)
:B:  9:53:43 Timer event: 570ms: Create markers: TestProj (Finished creating markers for TestProj)
:B:  9:53:43 Created 7 markers in 176 files

工作:

:B:  9:54:55 Timer event: 0ms: Delete markers: TestProj (Finished deleting markers for TestProj)
:B:  9:55:6 Compiler configuration for project TestProj doesn't know previous state, so assuming EVERYTHING has changed.
:B:  9:55:6 ===========================================================================================
:B:  9:55:6 Build kind = FULLBUILD
:B:  9:55:6 Project=TestProj, kind of build requested=Full AspectJ compilation
:B:  9:55:6 Timer event: 0ms: Flush included source file cache
:B:  9:55:6 Timer event: 0ms: Check delta
:B:  9:55:6 Builder: Tidied output folder(s), removed class files and derived resources
:B:  9:55:6 Timer event: 250ms: Pre compile
:B:  9:55:6 Compiler configuration for project TestProj has been read by compiler.  Resetting.
:B:  9:55:6      Configuration was [PROJECTSOURCEFILES_CHANGED, JAVAOPTIONS_CHANGED, ASPECTPATH_CHANGED, CLASSPATH_CHANGED, INPATH_CHANGED, NONSTANDARDOPTIONS_CHANGED, OUTJAR_CHANGED, PROJECTSOURCERESOURCES_CHANGED, OUTPUTDESTINATIONS_CHANGED, INJARS_CHANGED]
:B:  9:55:6 Resetting list of modified source files.  Was null
:C:  9:55:6 Preparing for build: not going to be incremental because no successful previous full build
:C:  9:55:7 Timer event: 970ms: Time to first compiled message
:C:  9:55:7 Timer event: 970ms: Time to first woven message
:C:  9:55:8 AspectJ reports build successful, build was: FULL
:C:  9:55:8 AJDE Callback: finish. Was full build: true
:B:  9:55:8 Timer event: 2420ms: Total time spent in AJDE
:B:  9:55:8 Timer event: 0ms: Refresh after build
:C:  9:55:10 Types affected during build = 320
:B:  9:55:10 Timer event: 3741ms: Total time spent in AJBuilder.build()
:B:  9:55:10 Timer event: 10ms: Update visualizer, xref, advice listeners for (separate thread): TestProj
:B:  9:55:10 Timer event: 30ms: Delete markers: TestProj (Finished deleting markers for TestProj)
:B:  9:55:10 Timer event: 100ms: Create markers: TestProj (Finished creating markers for TestProj)
:B:  9:55:10 Created 28 markers in 320 files

我不相信日志能告诉我任何信息,但我认为它们可能对其他人意味着什么。

我不愿意使用 List 实现,因为当 activity 将接收像 int[] 这样的基元时,我将无法将它们直接转换为 List,这对所有 activity的。

如有任何建议,我将不胜感激。

你指的是aws sdk流框架提供的@activities注解吗?在那种情况下,它与 aspectj 无关。 Swf 仅在决策逻辑中使用 aspectj。 要生成代码,请执行以下任一操作。 如果您使用的是 maven,请参阅 mavens annotation builder plugin。 如果您使用的是 eclipse,则在菜单 select Project --> JavaCompiler --> annotation Processing --> Enable Project Specific Settings 中设置要创建基于注释的文件的路径。