[MOBY-guts] biomoby commit
Martin Senger
senger at pub.open-bio.org
Fri Oct 28 07:58:09 UTC 2005
senger
Fri Oct 28 03:58:08 EDT 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event
In directory pub.open-bio.org:/tmp/cvs-serv12421/src/main/org/biomoby/shared/event
Modified Files:
NotificationEvent.java Notifier.java
Log Message:
moby-live/Java/src/main/org/biomoby/shared/event NotificationEvent.java,1.3,1.4 Notifier.java,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/27 04:15:23 1.3
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/NotificationEvent.java 2005/10/28 07:58:08 1.4
@@ -17,13 +17,18 @@
* registry (how many entities to read, and which one was just
* read). <p>
*
- * Each notification event points to its source (this is inherited
- * from a usual Java's EventObject). Additionally, it has its type (an
- * integer value, preferably taken from a list defined in interface
- * {@link org.biomoby.shared.event.Notifier}), a message (whose format
- * may be determined by the notification type), and optionally an
- * object with more details (again, its presence or absence may depend
- * on the notification type). <p>
+ * Each notification event points to its source - this is inherited
+ * from a usual Java EventObject. Sometimes, however, the semantics of
+ * the source may change to indicate not the event producer but the
+ * event initiator (an instance that caused that something had
+ * happened that triggered later sending an event). <p>
+ *
+ * Additionally, it has its type (an integer value, preferably taken
+ * from a list defined in interface {@link
+ * org.biomoby.shared.event.Notifier}), a message (whose format may be
+ * determined by the notification type), and optionally an object with
+ * more details (again, its presence or absence may depend on the
+ * notification type). <p>
*
* @author <A HREF="mailto:martin.senger at gmail.com">Martin Senger</A>
* @version $Id$
@@ -33,7 +38,7 @@
extends EventObject {
private int type;
- private String message;
+ private Object message;
private Object details;
/*********************************************************************
@@ -47,7 +52,7 @@
* A usual constructor, setting notification type and a message.
********************************************************************/
public NotificationEvent (Object source,
- int type, String message) {
+ int type, Object message) {
this (source);
this.type = type;
this.message = (message == null ? "" : message);
@@ -58,8 +63,7 @@
* details.
********************************************************************/
public NotificationEvent (Object source,
- int type, String message,
- Object details) {
+ int type, Object message, Object details) {
this (source, type, message);
this.details = details;
}
@@ -74,7 +78,7 @@
/*********************************************************************
* Return a message associated with this notification event.
********************************************************************/
- public String getMessage() {
+ public Object getMessage() {
return message;
}
@@ -99,8 +103,9 @@
StringBuffer buf = new StringBuffer (100);
buf.append ("[");
buf.append (typeStr);
- if (UUtils.notEmpty (message))
- buf.append (", Message=" + message);
+ if (message != null &&
+ ( message instanceof String || message instanceof Integer || message instanceof Boolean ))
+ buf.append (" " + message);
if (details != null)
buf.append (", Details=" + details.getClass().getName());
buf.append ("]");
@@ -108,34 +113,35 @@
}
static final String[] typeTexts = new String[] {
- "data-type-start",
- "data-type-count",
- "data-type-loading",
- "data-type-loaded",
- "data-type-end",
- "service-type-start",
- "service-type-count",
- "service-type-loading",
- "service-type-loaded",
- "service-type-end",
- "namespace-start",
- "namespace-count",
- "namespace-loading",
- "namespace-loaded",
- "namespace-end",
- "authority-start",
- "authority-count",
- "authority-loading",
- "authority-loaded",
- "authority-end",
- "data-type-reset",
- "service-type-reset",
- "namespace-reset",
- "authority-reset",
- "data-type-cancel",
- "service-type-cancel",
- "namespace-cancel",
- "authority-cancel"
+ "data-type-start", // [ 0]
+ "data-type-count", // [ 1]
+ "data-type-loading", // [ 2]
+ "data-type-loaded", // [ 3]
+ "data-type-end", // [ 4]
+ "service-type-start", // [ 5]
+ "service-type-count", // [ 6]
+ "service-type-loading", // [ 7]
+ "service-type-loaded", // [ 8]
+ "service-type-end", // [ 9]
+ "namespace-start", // [10]
+ "namespace-count", // [11]
+ "namespace-loading", // [12]
+ "namespace-loaded", // [13]
+ "namespace-end", // [14]
+ "authority-start", // [15]
+ "authority-count", // [16]
+ "authority-loading", // [17]
+ "authority-loaded", // [18]
+ "authority-end", // [19]
+ "data-type-reset", // [20]
+ "service-type-reset", // [21]
+ "namespace-reset", // [22]
+ "authority-reset", // [23]
+ "data-type-cancel", // [24]
+ "service-type-cancel", // [25]
+ "namespace-cancel", // [26]
+ "authority-cancel", // [27]
+ "data-type-updated" // [28]
};
}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/22 01:38:04 1.3
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/event/Notifier.java 2005/10/28 07:58:08 1.4
@@ -50,6 +50,7 @@
static final int NAMESPACES_CANCELLED = 26;
static final int AUTHORITIES_CANCELLED = 27;
+ static final int DATA_TYPES_UPDATED = 28;
static final int SIGNAL_CANCEL_DATA_TYPES = 1;
@@ -117,4 +118,9 @@
********************************************************************/
void fireEvent (int type, Object message, Object details);
+ /*********************************************************************
+ *
+ ********************************************************************/
+ void fireEvent (NotificationEvent event);
+
}
More information about the MOBY-guts
mailing list