All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.anosite.cms.translation.TranslationServiceFactory Maven / Gradle / Ivy

There is a newer version: 4.1.2
Show newest version
package net.anotheria.anosite.cms.translation;

import net.anotheria.anoprise.metafactory.ServiceFactory;
import net.anotheria.asg.service.ASGService;
import net.anotheria.moskito.core.dynamic.MoskitoInvokationProxy;
import net.anotheria.moskito.core.predefined.ServiceStatsCallHandler;
import net.anotheria.moskito.core.predefined.ServiceStatsFactory;

import java.util.concurrent.atomic.AtomicInteger;

public class TranslationServiceFactory implements ServiceFactory {

    private static AtomicInteger instanceCounter = new AtomicInteger(0);
    private static IASGTranslationService defaultInstance = createASActionService();

    public IASGTranslationService create() {
        return createASActionService();
    }

    public static IASGTranslationService createASActionService() {
        MoskitoInvokationProxy proxy = new MoskitoInvokationProxy(
                createInstance(),
                new ServiceStatsCallHandler(),
                new ServiceStatsFactory(),
                "IASGTranslationService-" + instanceCounter.incrementAndGet(),
                "service",
                "asg-fed",
                IASGTranslationService.class, ASGService.class
        );
        return (IASGTranslationService) proxy.createProxy();
    }

    private static IASGTranslationService createInstance() {
        return IASGTranslationTranslationServiceImpl.getInstance();
    }

    static IASGTranslationService getDefaultInstance() {
        return defaultInstance;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy