User: schaefera
Date: 01/09/19 10:55:05
Modified: src/main/org/jboss/jmx/connector/notification
JMSClientNotificationListener.java
JMSNotificationListener.java
RMINotificationListener.java
Log:
Some small fixes.
Revision Changes Path
1.2 +3 -10
jboss/src/main/org/jboss/jmx/connector/notification/JMSClientNotificationListener.java
Index: JMSClientNotificationListener.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/jmx/connector/notification/JMSClientNotificationListener.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JMSClientNotificationListener.java 2001/09/15 03:06:50 1.1
+++ JMSClientNotificationListener.java 2001/09/19 17:55:05 1.2
@@ -12,21 +12,12 @@
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;
-/*
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueReceiver;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-*/
import javax.management.Notification;
import javax.management.NotificationListener;
/**
-* Local JMX Listener to receive the message and send to the listener
+* Local JMS Listener to receive the message and send to the listener
**/
public class JMSClientNotificationListener implements MessageListener {
@@ -43,6 +34,8 @@
public void onMessage( Message pMessage ) {
try {
+ // Unpack the Notification from the Message and hand it over to the clients
+ // Notification Listener
Notification lNotification = (Notification) ( (ObjectMessage) pMessage
).getObject();
mLocalListener.handleNotification( lNotification, mHandback );
}
1.2 +3 -0
jboss/src/main/org/jboss/jmx/connector/notification/JMSNotificationListener.java
Index: JMSNotificationListener.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/jmx/connector/notification/JMSNotificationListener.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JMSNotificationListener.java 2001/09/12 01:49:07 1.1
+++ JMSNotificationListener.java 2001/09/19 17:55:05 1.2
@@ -35,6 +35,9 @@
implements NotificationListener, Serializable
{
+ // JMS Queue Session and Sender must be created on the server-side
+ // therefore they are transient and created on the first notification
+ // call
private transient QueueSender mSender;
private transient QueueSession mSession;
private String mJNDIName;
1.2 +25 -4
jboss/src/main/org/jboss/jmx/connector/notification/RMINotificationListener.java
Index: RMINotificationListener.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/jmx/connector/notification/RMINotificationListener.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RMINotificationListener.java 2001/09/12 01:49:07 1.1
+++ RMINotificationListener.java 2001/09/19 17:55:05 1.2
@@ -42,8 +42,6 @@
*
* @param pNotificationSender The Notification Sender using RMI to
* transport
- *
- * @
**/
public RMINotificationListener( RMINotificationSender pNotificationSender ) {
mRemoteSender = pNotificationSender;
@@ -59,8 +57,6 @@
*
* @param pNotification NotificationEvent
* @param pHandback Handback object
- *
- * @throws RemoteException If a Remote Exception occurred
*/
public void handleNotification(
Notification pNotification,
@@ -72,5 +68,30 @@
catch( RemoteException re ) {
re.printStackTrace();
}
+ }
+
+ /**
+ * Test if this and the given Object are equal. This is true if the given
+ * object both refer to the same local listener
+ *
+ * @param pTest Other object to test
if equal
+ *
+ * @return True if both are of
same type and
+ * refer to the
same local listener
+ **/
+ public boolean equals( Object pTest ) {
+ if( pTest instanceof RMINotificationListener ) {
+ return mRemoteSender.equals(
+ ( (RMINotificationListener) pTest).mRemoteSender
+ );
+ }
+ return false;
+ }
+
+ /**
+ * @return Hashcode of the remote
listener
+ **/
+ public int hashCode() {
+ return mRemoteSender.hashCode();
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development