You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by sr...@apache.org on 2018/06/01 16:03:43 UTC
[1/2] storm git commit: STORM-3086: Add documentation for invoking
static factory methods from Flux
Repository: storm
Updated Branches:
refs/heads/master f7ab952b2 -> 41f977a9e
STORM-3086: Add documentation for invoking static factory methods from Flux
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/d016cbec
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/d016cbec
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/d016cbec
Branch: refs/heads/master
Commit: d016cbec758f93cd1e6e7aa0f228a1f8bdea5e5d
Parents: 64af629
Author: Stig Rohde Døssing <sr...@apache.org>
Authored: Mon May 28 23:03:27 2018 +0200
Committer: Stig Rohde Døssing <sr...@apache.org>
Committed: Mon May 28 23:03:27 2018 +0200
----------------------------------------------------------------------
docs/flux.md | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/d016cbec/docs/flux.md
----------------------------------------------------------------------
diff --git a/docs/flux.md b/docs/flux.md
index 886f55d..b1b359a 100644
--- a/docs/flux.md
+++ b/docs/flux.md
@@ -342,6 +342,41 @@ components:
className: "org.apache.storm.kafka.StringScheme"
```
+### Static factory methods
+It is also possible to use static factory methods from Flux. Given the following Java code:
+
+```java
+public class TestBolt extends BaseBasicBolt {
+ public static TestBolt newInstance(Duration triggerTime) {
+ return new TestBolt(triggerTime);
+ }
+}
+```
+
+```java
+public class Duration {
+ public static Duration ofSeconds(long seconds) {
+ return new Duration(seconds);
+ }
+}
+```
+
+it is possible to use the factory methods as follows:
+
+```yaml
+components:
+ - id: "time"
+ className: "java.time.Duration"
+ factory: "ofSeconds"
+
+bolts:
+ - id: "testBolt"
+ className: "org.apache.storm.flux.test.TestBolt"
+ factory: "newInstance"
+ factoryArgs:
+ - ref: "time"
+```
+
### Contructor Arguments, References, Properties and Configuration Methods
####Constructor Arguments
[2/2] storm git commit: Merge branch 'STORM-3086' of
https://github.com/srdo/storm into asfgit-master
Posted by sr...@apache.org.
Merge branch 'STORM-3086' of https://github.com/srdo/storm into asfgit-master
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/41f977a9
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/41f977a9
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/41f977a9
Branch: refs/heads/master
Commit: 41f977a9e1e10a53633fabd77b30852c052dba3f
Parents: f7ab952 d016cbe
Author: Stig Rohde Døssing <sr...@apache.org>
Authored: Fri Jun 1 18:03:24 2018 +0200
Committer: Stig Rohde Døssing <sr...@apache.org>
Committed: Fri Jun 1 18:03:24 2018 +0200
----------------------------------------------------------------------
docs/flux.md | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
----------------------------------------------------------------------