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

com.mugui.base.client.net.baghandle.NetBagModule Maven / Gradle / Ivy

There is a newer version: 0.0.8
Show newest version
package com.mugui.base.client.net.baghandle;


import java.lang.reflect.InvocationTargetException;

import com.mugui.Mugui;
import com.mugui.base.base.ApplicationContext;
import com.mugui.base.client.net.base.ModelInterface;
import com.mugui.base.client.net.bean.Message;
import com.mugui.base.client.net.bean.NetBag;
import com.mugui.base.client.net.classutil.DataSave;


public class NetBagModule implements ModelInterface {

	@Override
	public void stop() {

	}

	@Override
	public void start() {

	}

	@Override
	public boolean isrun() {
		return false;
	}

	private ApplicationContext applicationContext = null;

	@Override
	public void init() {
		if (applicationContext == null)
			applicationContext = (ApplicationContext) DataSave.context;
	}

	public void init(Mugui obj) {
		init();
		object = applicationContext.getBean(obj.getClass());
	}

	Mugui object = null;

	public Message runFunc(NetBag bag)
			throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
		String func[] = bag.getFunc().split("[.]");
		try {
			return (Message) object.invokeFunction(func[func.length - 1], bag);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy