Examples of NetworkNotification


Examples of org.jboss.remoting.network.NetworkNotification

      {
         System.out.println("TestNotificationListner.handleNotification() called.");

         if ( notification instanceof NetworkNotification )
         {
            NetworkNotification networkNotification = (NetworkNotification) notification;

            if ( NetworkNotification.SERVER_ADDED.equals( networkNotification.getType() ) )
            {
               System.out.println("SERVER_ADDED notification.");
               for (int i = 0; i < networkNotification.getLocator().length; i++)
               {
                  System.out.println("ADDED: " + networkNotification.getLocator()[i]);
                  notifLog.add("ADDED: " + networkNotification.getLocator()[i]);
               }
            }
            else if ( NetworkNotification.SERVER_REMOVED.equals( networkNotification.getType() ) )
            {
               System.out.println("SERVER_REMOVED notification.");
               for (int i = 0; i < networkNotification.getLocator().length; i++)
               {
                  System.out.println("REMOVED: " + networkNotification.getLocator()[i]);
                  notifLog.add("REMOVED: " + networkNotification.getLocator()[i]);
               }
            }
            else if ( NetworkNotification.SERVER_UPDATED.equals( networkNotification.getType() ) )
            {
               System.out.println("SERVER_UPDATED notification.");
               for (int i = 0; i < networkNotification.getLocator().length; i++)
               {
                  System.out.println("UPDATED: " + networkNotification.getLocator()[i]);
                  notifLog.add("UPDATED: " + networkNotification.getLocator()[i]);
               }
            }
         }
      }
View Full Code Here

Examples of org.jboss.remoting.network.NetworkNotification

   public void handleNotification(Notification notification, Object o)
   {
      System.out.println("Received notification: " + notification);
      if(notification instanceof NetworkNotification)
      {
         NetworkNotification netNot = (NetworkNotification) notification;
         ServerInvokerMetadata[] serverMetadata = netNot.getServerInvokers();
         subSystem = serverMetadata[0].getSubSystems()[0];
      }
   }
View Full Code Here

Examples of org.jboss.remoting.network.NetworkNotification

      // check to see if network notification
      if(notification instanceof NetworkNotification)
      {
         println("GOT A NETWORK-REGISTRY NOTIFICATION: " + notification.getType());

         NetworkNotification networkNotification = (NetworkNotification) notification;

         if(NetworkNotification.SERVER_ADDED.equals(networkNotification.getType()))
         { // notification is for new servers being added
            println("New server(s) have been detected - getting locators and sending welcome messages");
            InvokerLocator[] locators = networkNotification.getLocator();
            for(int x = 0; x < locators.length; x++)
            {
               try
               {
                  // get the new found server's locator and invoke a call
                  InvokerLocator newServerLocator = locators[x];
                  makeInvocation(newServerLocator.getLocatorURI());
               }
               catch(Throwable throwable)
               {
                  throwable.printStackTrace();
               }
            }
         }
         else if(NetworkNotification.SERVER_REMOVED.equals(networkNotification.getType()))
         { // notification is for old servers that have gone down
            InvokerLocator[] locators = networkNotification.getLocator();
            for(int x = 0; x < locators.length; x++)
            {
               println("It has been detected that a server has gone down with a locator of: " + locators[x]);
            }
         }
View Full Code Here

Examples of org.jboss.remoting.network.NetworkNotification

      // check to see if network notification
      if(notification instanceof NetworkNotification)
      {
         println("GOT A NETWORK-REGISTRY NOTIFICATION: " + notification.getType());

         NetworkNotification networkNotification = (NetworkNotification) notification;

         if(NetworkNotification.SERVER_ADDED.equals(networkNotification.getType()))
         { // notification is for new servers being added
            println("New server(s) have been detected - getting locators and sending welcome messages");
            InvokerLocator[] locators = networkNotification.getLocator();
            for(int x = 0; x < locators.length; x++)
            {
               try
               {
                  // get the new found server's locator and invoke a call
                  InvokerLocator newServerLocator = locators[x];
                  makeInvocation(newServerLocator.getLocatorURI());
               }
               catch(Throwable throwable)
               {
                  throwable.printStackTrace();
               }
            }
         }
         else if(NetworkNotification.SERVER_REMOVED.equals(networkNotification.getType()))
         { // notification is for old servers that have gone down
            InvokerLocator[] locators = networkNotification.getLocator();
            for(int x = 0; x < locators.length; x++)
            {
               println("It has been detected that a server has gone down with a locator of: " + locators[x]);
            }
         }
View Full Code Here

Examples of org.jboss.remoting.network.NetworkNotification

/*     */   {
/*  90 */     if ((notification instanceof NetworkNotification))
/*     */     {
/*  92 */       println("GOT A NETWORK-REGISTRY NOTIFICATION: " + notification.getType());
/*     */
/*  94 */       NetworkNotification networkNotification = (NetworkNotification)notification;
/*     */
/*  96 */       if ("jboss.network.server.added".equals(networkNotification.getType()))
/*     */       {
/*  98 */         println("New server(s) have been detected - getting locators and sending welcome messages");
/*  99 */         InvokerLocator[] locators = networkNotification.getLocator();
/* 100 */         for (int x = 0; x < locators.length; x++)
/*     */         {
/*     */           try
/*     */           {
/* 105 */             InvokerLocator newServerLocator = locators[x];
/* 106 */             makeInvocation(newServerLocator.getLocatorURI());
/*     */           }
/*     */           catch (Throwable throwable)
/*     */           {
/* 110 */             throwable.printStackTrace();
/*     */           }
/*     */         }
/*     */       }
/* 114 */       else if ("jboss.network.server.removed".equals(networkNotification.getType()))
/*     */       {
/* 116 */         InvokerLocator[] locators = networkNotification.getLocator();
/* 117 */         for (int x = 0; x < locators.length; x++)
/*     */         {
/* 119 */           println("It has been detected that a server has gone down with a locator of: " + locators[x]);
/*     */         }
/*     */       }
View Full Code Here

Examples of org.jboss.remoting.network.NetworkNotification

/*     */   {
/*  84 */     if ((notification instanceof NetworkNotification))
/*     */     {
/*  86 */       println("GOT A NETWORK-REGISTRY NOTIFICATION: " + notification.getType());
/*     */
/*  88 */       NetworkNotification networkNotification = (NetworkNotification)notification;
/*     */
/*  90 */       if ("jboss.network.server.added".equals(networkNotification.getType()))
/*     */       {
/*  92 */         println("New server(s) have been detected - getting locators and sending welcome messages");
/*  93 */         InvokerLocator[] locators = networkNotification.getLocator();
/*  94 */         for (int x = 0; x < locators.length; x++)
/*     */         {
/*     */           try
/*     */           {
/*  99 */             InvokerLocator newServerLocator = locators[x];
/* 100 */             makeInvocation(newServerLocator.getLocatorURI());
/*     */           }
/*     */           catch (Throwable throwable)
/*     */           {
/* 104 */             throwable.printStackTrace();
/*     */           }
/*     */         }
/*     */       }
/* 108 */       else if ("jboss.network.server.removed".equals(networkNotification.getType()))
/*     */       {
/* 110 */         InvokerLocator[] locators = networkNotification.getLocator();
/* 111 */         for (int x = 0; x < locators.length; x++)
/*     */         {
/* 113 */           println("It has been detected that a server has gone down with a locator of: " + locators[x]);
/*     */         }
/*     */       }
View Full Code Here

Examples of org.jboss.remoting.network.NetworkNotification

   {
      log.info("Received notification: " + notification);
      if (notification instanceof NetworkNotification)
      {
         int tempAdded = 0;
         NetworkNotification netNot = (NetworkNotification) notification;
         if(NetworkNotification.SERVER_ADDED.equals(netNot.getType()))
         {
            InvokerLocator[] locators = netNot.getLocator();
            for (int i = 0; i < locators.length; i++)
            {
               if (locators[i].isSameEndpoint(locator1) || locators[i].isSameEndpoint(locator2))
                  tempAdded++;
            }
            if (tempAdded > 0)
            {
               numOfAdded = tempAdded;
               log.info("server added.  num of locators added = " + numOfAdded);
            }
         }
         else if(NetworkNotification.SERVER_UPDATED.equals(netNot.getType()))
         {
            int tempUpdated = 0;
            InvokerLocator[] locators = netNot.getLocator();
            for (int i = 0; i < locators.length; i++)
            {
               if (locators[i].isSameEndpoint(locator1) || locators[i].isSameEndpoint(locator2))
                  tempUpdated++;
            }
            if (tempUpdated > 0)
            {
               numOfUpdated = tempUpdated;
               log.info("server updated.  num of locators in update = " + numOfUpdated);
            }
         }
         ServerInvokerMetadata[] serverMetadata = netNot.getServerInvokers();
         log.info(netNot.getIdentity());
         log.info(serverMetadata);
         InvokerLocator[] locators = netNot.getLocator();
         if (locators != null)
         {
            for (int x = 0; x < locators.length; x++)
            {
               log.info(locators[x]);
View Full Code Here

Examples of org.jboss.remoting.network.NetworkNotification

   public void handleNotification(Notification notification, Object o)
   {
      System.out.println("Received notification: " + notification);
      if(notification instanceof NetworkNotification)
      {
         NetworkNotification netNot = (NetworkNotification) notification;
         ServerInvokerMetadata[] serverMetadata = netNot.getServerInvokers();
         for (int i = 0; i < serverMetadata.length; i++)
         {
            String[] ss = serverMetadata[i].getSubSystems();
            for (int j = 0; j < ss.length; j++)
            {
View Full Code Here

Examples of org.jboss.remoting.network.NetworkNotification

         // check to see if network notification
         if(notification instanceof NetworkNotification)
         {
            log.info("GOT A NETWORK-REGISTRY NOTIFICATION: " + notification.getType());
           
            NetworkNotification networkNotification = (NetworkNotification) notification;
           
            if(NetworkNotification.SERVER_ADDED.equals(networkNotification.getType()))
            { // notification is for new servers being added
               log.info("New server(s) have been detected - getting locators and sending welcome messages");
               InvokerLocator[] locators = networkNotification.getLocator();
               for(int x = 0; x < locators.length; x++)
               {
                  try
                  {
                     serversDetected++;
                    
                     // get the new found server's locator and invoke a call
                     InvokerLocator newServerLocator = locators[x];
                     log.info("detected: " + newServerLocator);
                     invocationSucceeded = false;
                     makeInvocation(newServerLocator.getLocatorURI());
                     invocationSucceeded = true;
                  }
                  catch(Throwable throwable)
                  {
                     throwable.printStackTrace();
                  }
               }
            }
            else if(NetworkNotification.SERVER_REMOVED.equals(networkNotification.getType()))
            { // notification is for old servers that have gone down
               InvokerLocator[] locators = networkNotification.getLocator();
               for(int x = 0; x < locators.length; x++)
               {
                  serversDetected--;
                  log.info("It has been detected that a server has gone down with a locator of: " + locators[x]);
               }
View Full Code Here

Examples of org.jboss.remoting.network.NetworkNotification

      {
         System.out.println("TestNotificationListner.handleNotification() called.");

         if ( notification instanceof NetworkNotification )
         {
            NetworkNotification networkNotification = (NetworkNotification) notification;

            if ( NetworkNotification.SERVER_ADDED.equals( networkNotification.getType() ) )
            {
               System.out.println("SERVER_ADDED notification.");
               for (int i = 0; i < networkNotification.getLocator().length; i++)
               {
                  System.out.println("ADDED: " + networkNotification.getLocator()[i]);
                  notifLog.add("ADDED: " + networkNotification.getLocator()[i]);
               }
            }
            else if ( NetworkNotification.SERVER_REMOVED.equals( networkNotification.getType() ) )
            {
               System.out.println("SERVER_REMOVED notification.");
               for (int i = 0; i < networkNotification.getLocator().length; i++)
               {
                  System.out.println("REMOVED: " + networkNotification.getLocator()[i]);
                  notifLog.add("REMOVED: " + networkNotification.getLocator()[i]);
               }
            }
            else if ( NetworkNotification.SERVER_UPDATED.equals( networkNotification.getType() ) )
            {
               System.out.println("SERVER_UPDATED notification.");
               for (int i = 0; i < networkNotification.getLocator().length; i++)
               {
                  System.out.println("UPDATED: " + networkNotification.getLocator()[i]);
                  notifLog.add("UPDATED: " + networkNotification.getLocator()[i]);
               }
            }
         }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.