/*
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.gcloud;

/**
 * Base class for service objects.
 *
 * @param <OptionsT> the {@code ServiceOptions} subclass corresponding to the service
 */
public abstract class BaseService<OptionsT extends ServiceOptions<?, ?, OptionsT>>
    implements Service<OptionsT> {

  private final OptionsT options;

  protected BaseService(OptionsT options) {
    this.options = options;
  }

  @Override
  public OptionsT options() {
    return options;
  }
}

@@ -640,16 +640,72 @@
 cloud;%0A%0A
+import com.google.gcloud.ExceptionHandler.Interceptor;%0A%0A
 /**%0A * B
@@ -947,16 +947,900 @@
 nsT%3E %7B%0A%0A
+  public static final Interceptor EXCEPTION_HANDLER_INTERCEPTOR = new Interceptor() %7B%0A%0A    private static final long serialVersionUID = -8429573486870467828L;%0A%0A    @Override%0A    public RetryResult afterEval(Exception exception, RetryResult retryResult) %7B%0A      return Interceptor.RetryResult.CONTINUE_EVALUATION;%0A    %7D%0A%0A    @Override%0A    public RetryResult beforeEval(Exception exception) %7B%0A      if (exception instanceof BaseServiceException) %7B%0A        boolean retriable = ((BaseServiceException) exception).retryable();%0A        return retriable ? Interceptor.RetryResult.RETRY : Interceptor.RetryResult.NO_RETRY;%0A      %7D%0A      return Interceptor.RetryResult.CONTINUE_EVALUATION;%0A    %7D%0A  %7D;%0A  public static final ExceptionHandler EXCEPTION_HANDLER = ExceptionHandler.builder()%0A      .abortOn(RuntimeException.class)%0A      .interceptor(EXCEPTION_HANDLER_INTERCEPTOR)%0A      .build();%0A%0A
   privat

Move exception handler and interceptor to BaseService class