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

jp.go.nict.langrid.servicecontainer.handler.ServiceContextUtil 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;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import jp.go.nict.langrid.commons.ws.ServiceContext;

public class ServiceContextUtil {
	public static void setCurrentServiceContextForAbstractService(ServiceContext context){
		if(setCurrentContextMethod == null) return;
		try {
			setCurrentContextMethod.invoke(null, context);
		} catch (IllegalArgumentException e) {
		} catch (IllegalAccessException e) {
		} catch (InvocationTargetException e) {
		}
	}

	private static Method setCurrentContextMethod;
	private static Class abstractServiceClass;
	static{
		try {
			abstractServiceClass = Class.forName("jp.go.nict.langrid.wrapper.ws_1_2.AbstractService");
			setCurrentContextMethod = abstractServiceClass.getMethod("setCurrentServiceContext", ServiceContext.class);
		} catch (ClassNotFoundException e) {
		} catch (NoSuchMethodException e) {
		} catch (SecurityException e) {
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy