public ClusterPolicy createClusterPolicy(String clusterMemberName) throws CreateException {
  long time1=System.currentTimeMillis();
  if (_clusterPolicies == null) {
    _clusterMemberNames=getClusterMemberNames();
    if (_clusterMemberNames != null && _clusterMemberNames.length > 0) {
      _clusterPolicies=new HashMap<String,ClusterPolicy>();
      ClusterPolicy[] tempPolicy=new ClusterPolicy[_clusterMemberNames.length];
      for (int i=0; i < _clusterMemberNames.length; i++)       tempPolicy[i]=createClusterPolicyInternal(_clusterMemberNames[i]);
      ArrayList<ReplicationPolicy> selectedReplPolicies=new ArrayList<ReplicationPolicy>(_clusterMemberNames.length);
      List<String> selectedReplGroupNames=new ArrayList<String>(_clusterMemberNames.length);
      for (int i=0; i < tempPolicy.length; i++)       if (tempPolicy[i].m_ReplicationPolicy != null && !selectedReplGroupNames.contains(tempPolicy[i].m_ReplicationPolicy.m_ReplicationGroupName)) {
        selectedReplPolicies.add(tempPolicy[i].m_ReplicationPolicy);
        selectedReplGroupNames.add(tempPolicy[i].m_ReplicationPolicy.m_ReplicationGroupName);
      }
      if (selectedReplPolicies.isEmpty())       selectedReplPolicies=null;
 else       selectedReplPolicies.trimToSize();
      for (int i=0; i < _clusterMemberNames.length; i++) {
        tempPolicy[i].m_ReplicationGroups=selectedReplPolicies;
        _clusterPolicies.put(_clusterMemberNames[i],tempPolicy[i]);
      }
    }
  }
  ClusterPolicy result=_clusterPolicies.get(clusterMemberName);
  if (result == null)   result=createClusterPolicyInternal(clusterMemberName);
  long time2=System.currentTimeMillis();
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("Creation of ClusterPolicy instance for \"" + clusterMemberName + "\" cluster member took "+ (time2 - time1)+ " msec.");
  }
  return result;
}

public ClusterPolicy createClusterPolicy ( String clusterMemberName ) throws CreateException { long time1 = System . currentTimeMillis ( ) ; if ( _clusterPolicies == null ) { _clusterMemberNames = getClusterMemberNames ( ) ; if ( _clusterMemberNames != null && _clusterMemberNames . length > 0 ) { _clusterPolicies = new HashMap < String , ClusterPolicy > ( ) ; ClusterPolicy [ ] tempPolicy = new ClusterPolicy [ _clusterMemberNames . length ] ; for ( int i = 0 ; i < _clusterMemberNames . length ; i ++ ) tempPolicy [ i ] = createClusterPolicyInternal ( _clusterMemberNames [ i ] ) ; ArrayList < ReplicationPolicy > selectedReplPolicies = new ArrayList < ReplicationPolicy > ( _clusterMemberNames . length ) ; List < String > selectedReplGroupNames = new ArrayList < String > ( _clusterMemberNames . length ) ; for ( int i = 0 ; i < tempPolicy . length ; i ++ ) if ( tempPolicy [ i ] . m_ReplicationPolicy != null && ! selectedReplGroupNames . contains ( tempPolicy [ i ] . m_ReplicationPolicy . m_ReplicationGroupName ) ) { selectedReplPolicies . add ( tempPolicy [ i ] . m_ReplicationPolicy ) ; selectedReplGroupNames . add ( tempPolicy [ i ] . m_ReplicationPolicy . m_ReplicationGroupName ) ; } if ( selectedReplPolicies . isEmpty ( ) ) selectedReplPolicies = null ; else selectedReplPolicies . trimToSize ( ) ; for ( int i = 0 ; i < _clusterMemberNames . length ; i ++ ) { tempPolicy [ i ] . m_ReplicationGroups = selectedReplPolicies ; _clusterPolicies . put ( _clusterMemberNames [ i ] , tempPolicy [ i ] ) ; } } } ClusterPolicy result = _clusterPolicies . get ( clusterMemberName ) ; if ( result == null ) result = createClusterPolicyInternal ( clusterMemberName ) ; long time2 = System . currentTimeMillis ( ) ; if ( _logger . isLoggable ( Level . FINE ) ) { _logger . fine ( "Creation of ClusterPolicy instance for \"" + clusterMemberName + "\" cluster member took " + ( time2 - time1 ) + " msec." ) ; } return result ; }
creating cluster policy object .
