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

org.nutz.ioc.trigger.MethodEventTrigger Maven / Gradle / Ivy

Go to download

Nutz, which is a collections of lightweight frameworks, each of them can be used independently

There is a newer version: 1.r.72
Show newest version
package org.nutz.ioc.trigger;

import java.lang.reflect.Method;

import org.nutz.ioc.IocEventTrigger;
import org.nutz.lang.Lang;

public class MethodEventTrigger implements IocEventTrigger {

    private Method method;

    public MethodEventTrigger(Method method) {
        this.method = method;
    }

    public void trigger(Object obj) {
        try {
            method.invoke(obj);
        }
        catch (Exception e) {
            throw Lang.wrapThrow(e);
        }
    }

}