geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject cvs commit: incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/remotenode RemoteNodeManagerImpl.java RemoteNodeManager.java
Date Sat, 17 Jul 2004 03:49:29 GMT
gdamour     2004/07/16 20:49:29

  Modified:    sandbox/messaging/src/java/org/apache/geronimo/messaging/remotenode
                        RemoteNodeManagerImpl.java RemoteNodeManager.java
  Log:
  Better exception handling.
  
  Revision  Changes    Path
  1.7       +13 -3     incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/remotenode/RemoteNodeManagerImpl.java
  
  Index: RemoteNodeManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/remotenode/RemoteNodeManagerImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RemoteNodeManagerImpl.java	8 Jul 2004 05:13:29 -0000	1.6
  +++ RemoteNodeManagerImpl.java	17 Jul 2004 03:49:29 -0000	1.7
  @@ -89,6 +89,7 @@
       }
   
       public void start() throws NodeException {
  +        log.info("Starting RemoteNodeManager for node {" + nodeInfo + "}");
           try {
               server = factory.factoryServer(nodeInfo, ioContext);
               server.setRemoteNodeManager(this);
  @@ -102,6 +103,7 @@
       }
       
       public void stop() throws NodeException {
  +        log.info("Stopping RemoteNodeManager for node {" + nodeInfo + "}");
           remoteNodeMonitor.stop();
           synchronized(remoteNodes) {
               for (Iterator iter = remoteNodes.values().iterator(); iter.hasNext();) {
  @@ -152,6 +154,9 @@
                   } catch (NodeException e) {
                       log.error("Can not apply topology change", e);
                       break;
  +                } catch (CommunicationException e) {
  +                    log.error("Can not apply topology change", e);
  +                    break;
                   }
               }
               iter.remove();
  @@ -165,10 +170,12 @@
                   try {
                       leaveRemoteNode(node);
                   } catch (NodeException e) {
  -                    log.error("Error roll-backing topology change", e);
  +                    log.error("Error rolling-back topology change", e);
  +                } catch (CommunicationException e) {
  +                    log.error("Error rolling-back topology change", e);
                   }
               }
  -            return;
  +            throw new CommunicationException("Can not apply topology.");
           }
   
           // Schedules the deletion of the old neighbours.
  @@ -218,6 +225,7 @@
               if ( null != remoteNode ) {
                   return remoteNode;
               }
  +            log.debug("Joining node {" + aNodeInfo + "}");
               remoteNode = factory.factoryRemoteNode(aNodeInfo, ioContext);
               RemoteNodeConnection connection;
               try {
  @@ -244,6 +252,7 @@
       }
   
       public void registerRemoteNode(RemoteNode aRemoteNode) {
  +        log.info("Node {" + aRemoteNode.getNodeInfo() + "} has joined.");
           synchronized(remoteNodes) {
               remoteNodes.put(aRemoteNode.getNodeInfo(), aRemoteNode);
           }
  @@ -252,6 +261,7 @@
       }
   
       public void unregisterRemoteNode(RemoteNode aRemoteNode) {
  +        log.info("Node {" + aRemoteNode.getNodeInfo() + "} has left.");
           synchronized(remoteNodes) {
               remoteNodes.remove(aRemoteNode.getNodeInfo());
           }
  
  
  
  1.3       +3 -1      incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/remotenode/RemoteNodeManager.java
  
  Index: RemoteNodeManager.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/remotenode/RemoteNodeManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RemoteNodeManager.java	10 Jun 2004 23:12:25 -0000	1.2
  +++ RemoteNodeManager.java	17 Jul 2004 03:49:29 -0000	1.3
  @@ -90,6 +90,8 @@
        * @param aNodeInfo Remote node.
        * @return RemoteNode.
        * @throws NodeException
  +     * @exception CommunicationException Indicates that the specified node
  +     * can not be joined. 
        */
       public RemoteNode findOrJoinRemoteNode(NodeInfo aNodeInfo)
           throws NodeException;
  
  
  

Mime
View raw message