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

jp.go.nict.langrid.servicecontainer.handler.annotation.ServicesUtil Maven / Gradle / Ivy

Go to download

Service container including JSON-RPC handler for the Service Grid Server Software and java web services.

There is a newer version: 1.1.3
Show newest version
package jp.go.nict.langrid.servicecontainer.handler.annotation;

import jp.go.nict.langrid.servicecontainer.handler.loader.DefaultServiceFactoryLoader;
import jp.go.nict.langrid.servicecontainer.handler.loader.ServiceFactoryLoader;

public class ServicesUtil {
	public static ServiceFactoryLoader[] getServiceFactoryLoaders(Class clazz) {
		DefaultServiceFactoryLoader l = new DefaultServiceFactoryLoader();
		boolean added = false;
		Services ss = clazz.getAnnotation(Services.class);
		if(ss != null){
			for(Service s : ss.value()){
				l.put(s.name(), s.impl(), s.intf());
				added = true;
			}
		}
		Service s = clazz.getAnnotation(Service.class);
		if(s != null){
			l.put(s.name(), s.impl(), s.intf());
			added = true;
		}
		if(added){
			return new ServiceFactoryLoader[]{l};
		} else{
			return new ServiceFactoryLoader[]{};
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy