Examples of Detection


Examples of org.jboss.remoting.detection.Detection

/* 281 */         ByteArrayInputStream byteInput = new ByteArrayInputStream(buf);
/* 282 */         ObjectInputStream objectInput = new ObjectInputStream(byteInput);
/* 283 */         Object obj = objectInput.readObject();
/* 284 */         if ((obj instanceof Detection))
/*     */         {
/* 286 */           Detection msg = (Detection)obj;
/* 287 */           if (this.log.isTraceEnabled())
/*     */           {
/* 289 */             this.log.trace("received detection: " + msg);
/*     */           }
/*     */
View Full Code Here

Examples of org.jboss.remoting.detection.Detection

/* 274 */       String bindName = "";
/* 275 */       NamingEnumeration enumeration = this.context.listBindings(bindName);
/* 276 */       while (enumeration.hasMore())
/*     */       {
/* 278 */         Binding binding = (Binding)enumeration.next();
/* 279 */         Detection regMsg = (Detection)binding.getObject();
/*     */
/* 281 */         if (isRemoteDetection(regMsg))
/*     */         {
/* 283 */           this.log.debug("Detected id: " + regMsg.getIdentity().getInstanceId() + ", message: " + regMsg);
/*     */
/* 285 */           if (cleanDetect)
/*     */           {
/* 287 */             if (this.log.isTraceEnabled())
/*     */             {
/* 289 */               this.log.trace("Doing clean detection.");
/*     */             }
/*     */
/* 293 */             ClassLoader cl = getClass().getClassLoader();
/* 294 */             if (!checkInvokerServer(regMsg, cl))
/*     */             {
/* 296 */               unregisterDetection(regMsg.getIdentity().getInstanceId());
/*     */             }
/*     */
/*     */           }
/*     */           else
/*     */           {
View Full Code Here

Examples of org.jboss.remoting.detection.Detection

/*     */   private boolean verifyLocalDetectionMsg(Detection regMsg) throws NamingException
/*     */   {
/* 334 */     boolean verified = false;
/*     */
/* 336 */     InvokerLocator[] locators = InvokerRegistry.getRegisteredServerLocators();
/* 337 */     Detection msg = createDetection();
/* 338 */     String sId = this.id.getInstanceId();
/* 339 */     InvokerLocator[] invokers = regMsg.getLocators();
/*     */
/* 342 */     if (sId.equals(regMsg.getIdentity().getInstanceId()))
/*     */     {
View Full Code Here

Examples of org.jboss.remoting.detection.Detection

/* 384 */     return verified;
/*     */   }
/*     */
/*     */   private void addLocalDetectionMsg() throws NamingException
/*     */   {
/* 389 */     Detection msg = createDetection();
/* 390 */     String sId = this.id.getInstanceId();
/* 391 */     registerDetectionMsg(sId, msg);
/*     */   }
View Full Code Here

Examples of org.jboss.remoting.detection.Detection

         String bindName = "";
         NamingEnumeration enumeration = context.listBindings(bindName);
         while(enumeration.hasMore())
         {
            Binding binding = (Binding) enumeration.next();
            Detection regMsg = (Detection) binding.getObject();
            // No need to detect myself here
            if(isRemoteDetection(regMsg))
            {
               log.debug("Detected id: " + regMsg.getIdentity().getInstanceId() + ", message: " + regMsg);

               if(cleanDetect)
               {
                  if(log.isTraceEnabled())
                  {
                     log.trace("Doing clean detection.");
                  }
                  // Need to actually detect if servers registered in JNDI server
                  // are actually there (since could die before unregistering)
                  ClassLoader cl = JNDIDetector.this.getClass().getClassLoader();
                  if(!checkInvokerServer(regMsg, cl))
                  {
                     unregisterDetection(regMsg.getIdentity().getInstanceId());
                  }
               }
               else
               {
                  // Let parent handle detection
View Full Code Here

Examples of org.jboss.remoting.detection.Detection

   private boolean verifyLocalDetectionMsg(Detection regMsg) throws NamingException
   {
      boolean verified = false;

      InvokerLocator[] locators = InvokerRegistry.getRegisteredServerLocators();
      Detection msg = createDetection();
      String sId = id.getInstanceId();
      InvokerLocator[] invokers = regMsg.getLocators();

      // first do sanity check to make sure even local detection msg (just in case)
      if(sId.equals(regMsg.getIdentity().getInstanceId()))
View Full Code Here

Examples of org.jboss.remoting.detection.Detection

      return verified;
   }

   private void addLocalDetectionMsg() throws NamingException
   {
      Detection msg = createDetection();
      String sId = id.getInstanceId();
      registerDetectionMsg(sId, msg);
   }
View Full Code Here

Examples of org.jboss.remoting.detection.Detection

         assertTrue(enumeration.hasMore());
         Binding binding = (Binding) enumeration.next();
         assertFalse(enumeration.hasMore());
         log.info(binding);
         assertTrue(binding.getObject() instanceof Detection);
         Detection detection = (Detection) binding.getObject();
         assertEquals(1, detection.getLocators().length);
         InvokerLocator locator = detection.getLocators()[0];
         log.info("locator: " + locator);

         // Tell server to shut down.
         os.write(5);
        
         // Tell server to restart.
         os.write(7);
         Thread.sleep(4000);

         // Get new detection message from JNDI server.
         enumeration = listBindings(context, "");
         assertTrue(enumeration.hasMore());
         binding = (Binding) enumeration.next();
         log.info(binding);
         assertFalse(enumeration.hasMore());
         assertTrue(binding.getObject() instanceof Detection);
         detection = (Detection) binding.getObject();
         assertEquals(1, detection.getLocators().length);
         InvokerLocator newLocator = detection.getLocators()[0];
         log.info("new locator: " + newLocator);
        
         // Verify that JNDIDetector has already discovered that old server is dead and
         // has registered new server.
         assertFalse(locator.equals(newLocator));
View Full Code Here

Examples of org.jboss.remoting.detection.Detection

         String bindName = "";
         NamingEnumeration enumeration = listBindings(context, bindName);
         while(enumeration.hasMore())
         {
            Binding binding = (Binding) enumeration.next();
            Detection regMsg = (Detection) binding.getObject();
            // No need to detect myself here
            if(isRemoteDetection(regMsg))
            {
               log.debug("Detected id: " + regMsg.getIdentity().getInstanceId() + ", message: " + regMsg);

               if(cleanDetect)
               {
                  if(log.isTraceEnabled())
                  {
                     log.trace("Doing clean detection.");
                  }
                  // Need to actually detect if servers registered in JNDI server
                  // are actually there (since could die before unregistering)
                  ClassLoader cl = (ClassLoader) AccessController.doPrivileged( new PrivilegedAction()
                  {
                     public Object run()
                     {
                        return JNDIDetector.class.getClassLoader();
                     }
                  });
                 
                  if(!checkInvokerServer(regMsg, cl))
                  {
                     unregisterDetection(regMsg.getIdentity().getInstanceId());
                  }
                  else
                  {
                     // Now, let parent handle detection
                     detect(regMsg);
View Full Code Here

Examples of org.jboss.remoting.detection.Detection

   private boolean verifyLocalDetectionMsg(Detection regMsg) throws NamingException
   {
      boolean verified = false;

      InvokerLocator[] locators = InvokerRegistry.getRegisteredServerLocators();
      Detection msg = createDetection();
      String sId = id.getInstanceId();
      InvokerLocator[] invokers = regMsg.getLocators();

      // first do sanity check to make sure even local detection msg (just in case)
      if(sId.equals(regMsg.getIdentity().getInstanceId()))
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.