WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit bbebaef

Browse files
committed
Merge pull request #37 from ModelDriven/FUML15-12
FUML15-12 fUML should include streaming
2 parents 819a8ef + af18cd1 commit bbebaef

22 files changed

+3831
-1449
lines changed

org.modeldriven.fuml/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
</attributes>
3535
</classpathentry>
3636
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
37-
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
37+
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
3838
<classpathentry kind="output" path="target/classes"/>
3939
</classpath>

org.modeldriven.fuml/log4j.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#Valid values are: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL
44
log4j.threshold=ALL
55

6-
log4j.rootLogger=ERROR, console
6+
log4j.rootLogger=ERROR, fumllog
77

88
# Set to DEBUG to see full execution trace logging.
99
# Set to INFO to see subset execution event logging.
@@ -23,10 +23,10 @@ log4j.category.org.modeldriven.fuml.meta=INFO
2323
log4j.category.org.modeldriven.fuml.io=INFO
2424

2525
# fumllog appender settings for rootLogger.
26-
log4j.appender.fumllog=org.apache.log4j.DailyRollingFileAppender
26+
log4j.appender.fumllog=org.apache.log4j.FileAppender
2727
log4j.appender.fumllog.File=fuml.log
28-
log4j.appender.fumllog.DatePattern='.'yyyy-MM-dd
29-
log4j.appender.fumllog.Append=true
28+
# log4j.appender.fumllog.DatePattern='.'yyyy-MM-dd
29+
log4j.appender.fumllog.Append=false
3030
log4j.appender.fumllog.layout=org.apache.log4j.PatternLayout
3131
log4j.appender.fumllog.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-5p [%t] %c{2} %m%n
3232

org.modeldriven.fuml/src/main/java/fuml/semantics/actions/ActionActivation.java

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -165,22 +165,10 @@ public fuml.semantics.activities.TokenList completeAction() {
165165
} // completeAction
166166

167167
public boolean isReady() {
168-
// In addition to the default condition, check that, if the action has
169-
// isLocallyReentrant=false, then the activation is not currently
170-
// firing,
171-
// and that the sources of all incoming edges (control flows) have
172-
// offers and all input pin activations are ready.
173-
// [This assumes that all edges directly incoming to the action are
174-
// control flows.]
168+
// Check that the action is ready to fire, including
169+
// that all input pin activations are ready.
175170

176-
boolean ready = super.isReady()
177-
& (((Action) this.node).isLocallyReentrant | !this.isFiring());
178-
179-
int i = 1;
180-
while (ready & i <= this.incomingEdges.size()) {
181-
ready = this.incomingEdges.getValue(i - 1).hasOffer();
182-
i = i + 1;
183-
}
171+
boolean ready = isControlReady();
184172

185173
InputPinList inputPins = ((Action) (this.node)).input;
186174
int j = 1;
@@ -191,6 +179,25 @@ public boolean isReady() {
191179

192180
return ready;
193181
} // isReady
182+
183+
public boolean isControlReady() {
184+
// In addition to the default condition for being ready, check that,
185+
// if the action has isLocallyReentrant=false, then the activation is
186+
// not currently firing, and that the sources of all incoming edges
187+
// have offers. (This assumes that all edges directly incoming to the
188+
// action are control flows.)
189+
190+
boolean ready = super.isReady()
191+
& (((Action) this.node).isLocallyReentrant | !this.isFiring());
192+
193+
int i = 1;
194+
while (ready & i <= this.incomingEdges.size()) {
195+
ready = this.incomingEdges.getValue(i - 1).hasOffer();
196+
i = i + 1;
197+
}
198+
199+
return ready;
200+
}
194201

195202
public boolean isFiring() {
196203
// Indicate whether this action activation is currently firing or not.
@@ -206,7 +213,7 @@ public void sendOffers() {
206213
Action action = (Action) (this.node);
207214

208215
// *** Send offers from all output pins concurrently. ***
209-
OutputPinList outputPins = action.output;
216+
OutputPinList outputPins = this.getOfferingOutputPins();
210217
for (Iterator i = outputPins.iterator(); i.hasNext();) {
211218
OutputPin outputPin = (OutputPin) i.next();
212219
PinActivation pinActivation = this.getPinActivation(outputPin);
@@ -221,6 +228,15 @@ public void sendOffers() {
221228
this.outgoingEdges.getValue(0).sendOffer(tokens);
222229
}
223230
} // sendOffers
231+
232+
public OutputPinList getOfferingOutputPins() {
233+
// Return the output pins of the action of this action activation from
234+
// which offers are to be sent when the action activation finishes firing.
235+
// (This is normally all the output pins of the action, but it can be
236+
// overridden in subclasses to only return a subset of the output pins.)
237+
238+
return ((Action)this.node).output;
239+
}
224240

225241
public void createNodeActivations() {
226242
// Create node activations for the input and output pins of the action

0 commit comments

Comments
 (0)