public boolean isRegisterable(InstanceInfo instanceInfo) {
        DataCenterInfo datacenterInfo = instanceInfo.getDataCenterInfo();
        String serverRegion = clientConfig.getRegion();
        if (AmazonInfo.class.isInstance(datacenterInfo)) {
            AmazonInfo info = AmazonInfo.class.cast(instanceInfo.getDataCenterInfo());
            String availabilityZone = info.get(MetaDataKey.availabilityZone);
            // Can be null for dev environments in non-AWS data center
            if (availabilityZone == null && US_EAST_1.equalsIgnoreCase(serverRegion)) {
                return true;
            } else if ((availabilityZone != null) && (availabilityZone.contains(serverRegion))) {
                // If in the same region as server, then consider it registerable
                return true;
            }
        }
        return true; // Everything non-amazon is registrable.
    }
public boolean isRegisterable ( InstanceInfo instanceInfo ) { DataCenterInfo datacenterInfo = instanceInfo . getDataCenterInfo ( ) ; String serverRegion = clientConfig . getRegion ( ) ; if ( AmazonInfo . class . isInstance ( datacenterInfo ) ) { AmazonInfo info = AmazonInfo . class . cast ( instanceInfo . getDataCenterInfo ( ) ) ; String availabilityZone = info . get ( MetaDataKey . availabilityZone ) ; if ( availabilityZone == null && US_EAST_1 . equalsIgnoreCase ( serverRegion ) ) { return true ; } else if ( ( availabilityZone != null ) && ( availabilityZone . contains ( serverRegion ) ) ) { return true ; } } return true ; }
Checks if an instance is registerable in this region. Instances from other regions are rejected.

@param instanceInfo  th instance info information of the instance
@return true, if it can be registered in this server, false otherwise.