Author: richard_opalka
Date: 2007-06-24 04:31:24 -0400 (Sun, 24 Jun 2007)
New Revision: 3709
Modified:
branches/ropalka/jbossws-core/src/main/java/org/jboss/ws/extensions/rx/Sequence.java
branches/ropalka/jbossws-core/src/main/java/org/jboss/ws/extensions/rx/SequenceEvent.java
Log:
SequenceEvent changed from iface to class
Modified:
branches/ropalka/jbossws-core/src/main/java/org/jboss/ws/extensions/rx/Sequence.java
===================================================================
---
branches/ropalka/jbossws-core/src/main/java/org/jboss/ws/extensions/rx/Sequence.java 2007-06-23
23:13:52 UTC (rev 3708)
+++
branches/ropalka/jbossws-core/src/main/java/org/jboss/ws/extensions/rx/Sequence.java 2007-06-24
08:31:24 UTC (rev 3709)
@@ -29,13 +29,24 @@
{
/**
- * Sequence state constants.
+ * Sequence state constants
*/
public enum State {
NONE, CREATING, CREATED, CLOSING, CLOSED, TERMINATING
}
+ /**
+ * Returns sequence id
+ * @return sequence id
+ */
String getId();
+ /**
+ * Returns current state of the sequence
+ * @return current state of the sequence
+ */
+ Sequence.State getState();
+
// TODO: provide other sequence methods
+
}
Modified:
branches/ropalka/jbossws-core/src/main/java/org/jboss/ws/extensions/rx/SequenceEvent.java
===================================================================
---
branches/ropalka/jbossws-core/src/main/java/org/jboss/ws/extensions/rx/SequenceEvent.java 2007-06-23
23:13:52 UTC (rev 3708)
+++
branches/ropalka/jbossws-core/src/main/java/org/jboss/ws/extensions/rx/SequenceEvent.java 2007-06-24
08:31:24 UTC (rev 3709)
@@ -26,9 +26,61 @@
* @author opalka.richard(a)gmail.com
* @see org.jboss.ws.extensions.rx.SequenceListener
*/
-public interface SequenceEvent
+public class SequenceEvent
{
- Sequence.State getOldState();
- Sequence.State getNewState();
- Sequence getSequence();
+
+ protected Sequence.State oldState;
+ protected Sequence.State newState;
+ protected Sequence sequence;
+
+ /**
+ * Event constructor
+ * @param sequence this event is associated with
+ * @param oldState previous state of the sequence
+ * @param newState current state of the sequence
+ */
+ public SequenceEvent(Sequence sequence, Sequence.State oldState, Sequence.State
newState) {
+ super();
+ assert sequence != null && oldState != null && newState != null;
+ this.sequence = sequence;
+ this.oldState = oldState;
+ this.newState = newState;
+ }
+
+ /**
+ * Returns previous state of the sequence
+ * @return previous state of the sequence
+ */
+ public Sequence.State getOldState() {
+ return this.oldState;
+ }
+
+ /**
+ * Returns current state of the sequence
+ * @return current state of the sequence
+ */
+ public Sequence.State getNewState() {
+ return this.newState;
+ }
+
+ /**
+ * Returns sequence this event is associated with
+ * @return sequence this event is associated with
+ */
+ public Sequence getSequence() {
+ return this.sequence;
+ }
+
+ /*
+ * Intended for debugging purposes
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("oldState=").append(oldState)
+ .append(";newState=").append(newState)
+ .append(";sequence=").append(sequence);
+ return builder.toString();
+ }
+
}
Show replies by date