1 Reply Latest reply on Mar 29, 2006 2:06 PM by Brian Stansberry

    DetachedHANamingService lifecycle is all wrong

    Adrian Brock Master

       

      
       protected void createService()
       throws Exception
       {
       boolean debug = log.isDebugEnabled();
      
       if (debug)
       log.debug("Initializing HAJNDI server on partition: " + partitionName);
      
       partition = findHAPartitionWithName(partitionName);
       // Start HAJNDI service
       theServer = new HAJNDI(partition);
       log.debug("initialize HAJNDI");
       theServer.init();
      
       // Build the Naming interface method map
       HashMap tmpMap = new HashMap(13);
       Method[] methods = Naming.class.getMethods();
       for (int m = 0; m < methods.length; m++)
       {
       Method method = methods[m];
       Long hash = new Long(MarshalledInvocation.calculateHash(method));
       tmpMap.put(hash, method);
       }
       marshalledInvocationMapping = Collections.unmodifiableMap(tmpMap);
      
       // share instance for in-vm discovery
       NamingContext.setHANamingServerForPartition(partitionName, theServer);
       }
      


      1) Why is accessing other services outside the startService()
      2) Why does it have to "find" another service rather having it injected?

      Looks like the HASingleton has the same problems.