Skip to main content
summaryrefslogtreecommitdiffstats
blob: d31bc1a0af877a584c6d9066185e1e5b7802a743 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*******************************************************************************
 * Copyright (c) 2013 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.jaxrs.client.internal;

import org.eclipse.osee.jaxrs.client.OseeClientConfig;
import org.eclipse.osee.jaxrs.client.OseeHttpProxyAddress;
import org.eclipse.osee.jaxrs.client.OseeServerAddress;
import org.eclipse.osee.jaxrs.client.WebClientProvider;
import com.google.inject.AbstractModule;

/**
 * @author Roberto E. Escobar
 */
public class StandaloneModule extends AbstractModule {

   private final OseeClientConfig config;

   public StandaloneModule(OseeClientConfig config) {
      this.config = config;
   }

   @Override
   protected void configure() {
      bindConstant().annotatedWith(OseeServerAddress.class).to(config.getServerAddress());
      bindConstant().annotatedWith(OseeHttpProxyAddress.class).to(config.getProxyAddress());

      bind(WebClientProvider.class).to(StandadloneWebClientProvider.class);
   }
}

Back to the top