Clover coverage report - ActiveCluster - 1.1-SNAPSHOT
Coverage timestamp: Tue May 24 2005 08:48:28 BST
file stats: LOC: 98   Methods: 11
NCLOC: 44   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
NodeImpl.java - 0% 0% 0%
coverage
 1   
 /** 
 2   
  * 
 3   
  * Copyright 2004 Protique Ltd
 4   
  * 
 5   
  * Licensed under the Apache License, Version 2.0 (the "License"); 
 6   
  * you may not use this file except in compliance with the License. 
 7   
  * You may obtain a copy of the License at 
 8   
  * 
 9   
  * http://www.apache.org/licenses/LICENSE-2.0
 10   
  * 
 11   
  * Unless required by applicable law or agreed to in writing, software
 12   
  * distributed under the License is distributed on an "AS IS" BASIS, 
 13   
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 14   
  * See the License for the specific language governing permissions and 
 15   
  * limitations under the License. 
 16   
  * 
 17   
  **/
 18   
 package org.activecluster.impl;
 19   
 
 20   
 import org.activecluster.Node;
 21   
 
 22   
 import javax.jms.Destination;
 23   
 import java.util.HashMap;
 24   
 import java.util.Map;
 25   
 
 26   
 
 27   
 /**
 28   
  * Default implementation of a remote Node
 29   
  *
 30   
  * @version $Revision: 1.1 $
 31   
  */
 32   
 public class NodeImpl implements Node {
 33   
 
 34   
     private Destination destination;
 35   
     protected Map state;
 36   
     protected boolean coordinator;
 37   
 
 38   
     /**
 39   
      * Allow a node to be copied for sending it as a message
 40   
      *
 41   
      * @param node
 42   
      */
 43  0
     public NodeImpl(Node node) {
 44  0
         this(node.getDestination(), node.getState());
 45   
     }
 46   
 
 47  0
     public NodeImpl(Destination destination) {
 48  0
         this(destination, new HashMap());
 49   
     }
 50   
 
 51  0
     public NodeImpl(Destination destination, Map state) {
 52  0
         this.destination = destination;
 53  0
         this.state = state;
 54   
     }
 55   
 
 56   
     /**
 57   
      * @return the name of the node
 58   
      */
 59  0
     public String getName() {
 60  0
         return destination.toString();
 61   
     }
 62   
 
 63  0
     public String toString() {
 64  0
         return "Node[destination: " + destination + " state: " + state + "]";
 65   
     }
 66   
 
 67  0
     public Destination getDestination() {
 68  0
         return destination;
 69   
     }
 70   
 
 71  0
     public synchronized Map getState() {
 72  0
         return new HashMap(state);
 73   
     }
 74   
 
 75   
 
 76   
     /**
 77   
      * @return true if this node has been elected as coordinator
 78   
      */
 79  0
     public boolean isCoordinator() {
 80  0
         return coordinator;
 81   
     }
 82   
 
 83  0
     public Object getZone() {
 84  0
         return state.get("zone");
 85   
     }
 86   
     
 87   
     // Implementation methods
 88   
     //-------------------------------------------------------------------------
 89   
 
 90  0
     protected synchronized void setState(Map state) {
 91  0
         this.state = state;
 92   
     }
 93   
 
 94  0
     protected void setCoordinator(boolean value) {
 95  0
         coordinator = value;
 96   
     }
 97   
 }
 98