View Javadoc

1   /*
2    * Copyright (C) 2013 Room Work eXperience
3    *
4    * This program is free software: you can redistribute it and/or modify
5    * it under the terms of the GNU General Public License as published by
6    * the Free Software Foundation, either version 3 of the License, or
7    * (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16   */
17  package net.rwx.maven.asciidoc.services.modules;
18  
19  import com.google.inject.AbstractModule;
20  import com.google.inject.Singleton;
21  import net.rwx.maven.asciidoc.backends.BackendService;
22  import net.rwx.maven.asciidoc.backends.impl.BackendServiceImpl;
23  import net.rwx.maven.asciidoc.services.AsciidocService;
24  import net.rwx.maven.asciidoc.services.FopService;
25  import net.rwx.maven.asciidoc.services.ServiceOrchestrator;
26  import net.rwx.maven.asciidoc.services.TransformationService;
27  import net.rwx.maven.asciidoc.services.impl.AsciidocServiceImpl;
28  import net.rwx.maven.asciidoc.services.impl.FopServiceImpl;
29  import net.rwx.maven.asciidoc.services.impl.ServiceOrchestratorImpl;
30  import net.rwx.maven.asciidoc.services.impl.TransformationServiceImpl;
31  
32  /**
33   * Configuration for dependency injection.
34   * 
35   * @author Arnaud Fonce <arnaud.fonce@r-w-x.net>
36   */
37  public class AsciidocModule extends AbstractModule {
38  
39      @Override
40      protected void configure() {
41          bind(ServiceOrchestrator.class).to(ServiceOrchestratorImpl.class).in(Singleton.class);
42          bind(AsciidocService.class).to(AsciidocServiceImpl.class).in(Singleton.class);
43          bind(TransformationService.class).to(TransformationServiceImpl.class).in(Singleton.class);
44          bind(FopService.class).to(FopServiceImpl.class).in(Singleton.class);
45          bind(BackendService.class).to(BackendServiceImpl.class).in(Singleton.class);
46      }
47      
48  }