Revision: 76b1a98c4e94
Author:   [email protected] <[email protected]>
Date:     Wed Jun 19 06:50:19 2013
Log:      fixed M3UA HB task getting cancelled

http://code.google.com/p/jss7/source/detail?r=76b1a98c4e94

Modified:
/m3ua/impl/src/main/java/org/mobicents/protocols/ss7/m3ua/impl/AspFactoryImpl.java /m3ua/impl/src/main/java/org/mobicents/protocols/ss7/m3ua/impl/HeartBeatTimer.java /m3ua/impl/src/main/java/org/mobicents/protocols/ss7/m3ua/impl/scheduler/M3UATask.java

=======================================
--- /m3ua/impl/src/main/java/org/mobicents/protocols/ss7/m3ua/impl/AspFactoryImpl.java Mon May 20 13:09:00 2013 +++ /m3ua/impl/src/main/java/org/mobicents/protocols/ss7/m3ua/impl/AspFactoryImpl.java Wed Jun 19 06:50:19 2013
@@ -185,7 +185,7 @@
         if (this.association == null)
             return;

-        if (this.isHeartBeatEnabled) {
+        if (this.isHeartBeatEnabled()) {
             this.heartBeatTimer.cancel();
         }

@@ -537,7 +537,7 @@

     private void handleCommDown() {

-        if (this.isHeartBeatEnabled) {
+        if (this.isHeartBeatEnabled()) {
             this.heartBeatTimer.cancel();
         }

@@ -586,7 +586,8 @@

     private void handleCommUp() {

-        if (this.isHeartBeatEnabled) {
+        if (this.isHeartBeatEnabled()) {
+            this.heartBeatTimer.start();
             this.heartBeatTimer.reset();
this.m3UAManagementImpl.m3uaScheduler.execute(this.heartBeatTimer);
         }
@@ -663,8 +664,8 @@

     @Override
     public void onCommunicationRestart(Association association) {
-        // TODO Auto-generated method stub
-
+ logger.warn(String.format("Communication channel restart for AspFactroy=%s Association=%s", this.name,
+                association.getName()));
     }

     @Override
@@ -708,7 +709,7 @@
         if (association.getIpChannelType() == IpChannelType.SCTP) {
             // TODO where is streamNumber stored?
             m3UAMessage = this.messageFactory.createSctpMessage(m3uadata);
-            if (this.isHeartBeatEnabled) {
+            if (this.isHeartBeatEnabled()) {
                 this.heartBeatTimer.reset();
             }
             this.read(m3UAMessage);
@@ -719,7 +720,7 @@
                 if (m3UAMessage == null)
                     break;

-                if (this.isHeartBeatEnabled) {
+                if (this.isHeartBeatEnabled()) {
                     this.heartBeatTimer.reset();
                 }
                 this.read(m3UAMessage);
@@ -741,7 +742,7 @@

     public void show(StringBuffer sb) {
sb.append(M3UAOAMMessages.SHOW_ASP_NAME).append(this.name).append(M3UAOAMMessages.SHOW_ASPID)
-                
.append(this.aspid.getAspId()).append(M3UAOAMMessages.SHOW_HEARTBEAT_ENABLED).append(this.isHeartBeatEnabled)
+                
.append(this.aspid.getAspId()).append(M3UAOAMMessages.SHOW_HEARTBEAT_ENABLED).append(this.isHeartBeatEnabled())
                 
.append(M3UAOAMMessages.SHOW_SCTP_ASSOC).append(this.associationName).append(M3UAOAMMessages.SHOW_STARTED)
                 .append(this.started);

=======================================
--- /m3ua/impl/src/main/java/org/mobicents/protocols/ss7/m3ua/impl/HeartBeatTimer.java Mon May 20 13:09:00 2013 +++ /m3ua/impl/src/main/java/org/mobicents/protocols/ss7/m3ua/impl/HeartBeatTimer.java Wed Jun 19 06:50:19 2013
@@ -38,8 +38,8 @@

     private static final Heartbeat HEART_BEAT = new HeartbeatImpl();

-    private long lastM3UAMessageTime = 0L;
-    private int heartBeatAckMissed = 0;
+    private volatile long lastM3UAMessageTime = 0L;
+    private volatile int heartBeatAckMissed = 0;

     private AspFactoryImpl aspFactoryImpl = null;

@@ -70,7 +70,9 @@
         }

         if (this.heartBeatAckMissed > HEART_BEAT_ACK_MISSED_ALLOWED) {
-
+            logger.warn(String
+ .format("HEART_BEAT ACK missed %d is greater than configured %d for AspFactory %s. Underlying Association will be stopped and started again", + this.heartBeatAckMissed, HEART_BEAT_ACK_MISSED_ALLOWED, this.aspFactoryImpl.getName()));
             try {
this.aspFactoryImpl.transportManagement.stopAssociation(this.aspFactoryImpl.associationName);
             } catch (Exception e) {
@@ -89,5 +91,4 @@
             this.cancel();
         }
     }
-
 }
=======================================
--- /m3ua/impl/src/main/java/org/mobicents/protocols/ss7/m3ua/impl/scheduler/M3UATask.java Fri Jun 14 07:42:36 2013 +++ /m3ua/impl/src/main/java/org/mobicents/protocols/ss7/m3ua/impl/scheduler/M3UATask.java Wed Jun 19 06:50:19 2013
@@ -55,4 +55,8 @@
         // scheduler.tasks[index] = null;
         // }
     }
+
+    public void start(){
+        this.canceled = false;
+    }
 }

--

--- You received this message because you are subscribed to the Google Groups "mobicents-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to