001 /*
002 * Apache License
003 * Version 2.0, January 2004
004 * http://www.apache.org/licenses/
005 *
006 * Copyright 2008 by chenillekit.org
007 *
008 * Licensed under the Apache License, Version 2.0 (the "License");
009 * you may not use this file except in compliance with the License.
010 * You may obtain a copy of the License at
011 *
012 * http://www.apache.org/licenses/LICENSE-2.0
013 */
014
015 package org.chenillekit.image;
016
017 import java.util.Map;
018 import java.util.Properties;
019
020 import org.apache.tapestry5.ioc.ServiceBinder;
021
022 import org.chenillekit.image.services.CaptchaProducer;
023 import org.chenillekit.image.services.impl.ImageServiceImpl;
024 import org.chenillekit.image.services.impl.KaptchaProducerImpl;
025
026 /**
027 * @version $Id: ChenilleKitImageModule.java 494 2009-05-23 14:29:32Z homburgs $
028 */
029 public class ChenilleKitImageModule
030 {
031 public static void bind(ServiceBinder binder)
032 {
033 binder.bind(ImageServiceImpl.class);
034 }
035
036 public static CaptchaProducer buildKaptchaProducer(Map<String, Properties> configuration)
037 {
038 return new KaptchaProducerImpl(configuration.get(ChenilleKitImageConstants.KAPATCHA_CONFIG_KEY));
039 }
040 }