/*
 * Copyright 2013 Erwin Müller <erwin.mueller@deventm.org>
 *
 * This file is part of sscontrol-core.
 *
 * sscontrol-core is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * sscontrol-core is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with sscontrol-core. If not, see <http://www.gnu.org/licenses/>.
 */
package com.anrisoftware.sscontrol.core.service;

import com.anrisoftware.resources.templates.maps.TemplatesDefaultMapsModule;
import com.anrisoftware.resources.templates.templates.TemplatesResourcesModule;
import com.anrisoftware.resources.templates.worker.STDefaultPropertiesModule;
import com.anrisoftware.resources.templates.worker.STWorkerModule;
import com.anrisoftware.sscontrol.workers.command.exec.ExecCommandWorkerModule;
import com.anrisoftware.sscontrol.workers.command.script.ScriptCommandWorkerModule;
import com.anrisoftware.sscontrol.workers.text.tokentemplate.TokensTemplateWorkerModule;
import com.google.inject.AbstractModule;

/**
 * Binds the workers and resources.
 * 
 * @author Erwin Mueller, erwin.mueller@deventm.org
 * @since 1.0
 */
public class ServiceModule extends AbstractModule {

	@Override
	protected void configure() {
		installWorkers();
		installResources();
	}

	private void installWorkers() {
		install(new ExecCommandWorkerModule());
		install(new ScriptCommandWorkerModule());
		install(new TokensTemplateWorkerModule());
	}

	private void installResources() {
		install(new TemplatesResourcesModule());
		install(new TemplatesDefaultMapsModule());
		install(new STWorkerModule());
		install(new STDefaultPropertiesModule());
	}

}

@@ -57,16 +57,17 @@
 .org%3E%0A *
+ 
 %0A * This
@@ -97,24 +97,25 @@
 rol-core.%0A *
+ 
 %0A * sscontro
@@ -362,24 +362,25 @@
  version.%0A *
+ 
 %0A * sscontro
@@ -444,19 +444,16 @@
  but
-%0A *
  WITHOUT
  ANY
@@ -448,16 +448,19 @@
  WITHOUT
+%0A *
  ANY WAR
@@ -525,19 +525,16 @@
 Y or
-%0A *
  FITNESS
  FOR
@@ -529,16 +529,19 @@
  FITNESS
+%0A *
  FOR A P
@@ -600,19 +600,16 @@
  License
-%0A *
  for mor
@@ -609,16 +609,19 @@
 for more
+%0A *
  details
@@ -624,16 +624,17 @@
 ails.%0A *
+ 
 %0A * You 
@@ -834,310 +834,8 @@
 e;%0A%0A
-import com.anrisoftware.resources.templates.maps.TemplatesDefaultMapsModule;%0Aimport com.anrisoftware.resources.templates.templates.TemplatesResourcesModule;%0Aimport com.anrisoftware.resources.templates.worker.STDefaultPropertiesModule;%0Aimport com.anrisoftware.resources.templates.worker.STWorkerModule;%0A
 impo
@@ -986,32 +986,108 @@
 ndWorkerModule;%0A
+import com.anrisoftware.sscontrol.workers.text.match.MatchTextWorkerModule;%0A
 import com.anris
@@ -1433,30 +1433,8 @@
 ();%0A
-%09%09installResources();%0A
 %09%7D%0A%0A
@@ -1602,213 +1602,48 @@
 );%0A%09
-%7D%0A%0A%09private void installResources() %7B%0A%09%09install(new TemplatesResourcesModule());%0A%09%09install(new TemplatesDefaultMapsModule());%0A%09%09install(new STWorkerModule());%0A%09%09install(new STDefaultPropertiesModule());%0A%09%7D%0A
+%09install(new MatchTextWorkerModule());%0A%09%7D
 %0A%7D%0A

Fix dependent modules