servicemethod.java

来自「一个java工作流引擎」· Java 代码 · 共 42 行

JAVA
42
字号
package org.jbpm.service;

import java.lang.reflect.*;
import java.util.*;
import org.jbpm.*;
import org.jbpm.util.lang.*;

public class ServiceMethod extends Enum {
  
  public static ServiceMethod START_PROCESS_INSTANCE = new ServiceMethod( "startInstance", getMethod( ExecutionService.class, "startProcessInstance", new Class[]{String.class,Long.class,Map.class,String.class} ) );
  public static ServiceMethod END_OF_STATE = new ServiceMethod( "endOfState", getMethod( ExecutionService.class, "endOfState", new Class[]{String.class, Long.class, Map.class, String.class} ) );
  public static ServiceMethod SET_VARIABLES = new ServiceMethod( "setVariables", getMethod( ExecutionService.class, "setVariables", new Class[]{String.class, Long.class, Map.class} ) );
  public static ServiceMethod DELEGATE = new ServiceMethod( "delegate", getMethod( ExecutionService.class, "delegate", new Class[]{String.class, Long.class, String.class, boolean.class} ) );
  public static ServiceMethod CANCEL_PROCESS_INSTANCE = new ServiceMethod( "cancelProcessInstance", getMethod( ExecutionService.class, "cancelProcessInstance", new Class[]{String.class,Long.class} ) );
  public static ServiceMethod CANCEL_TOKEN = new ServiceMethod( "cancelToken", getMethod( ExecutionService.class, "cancelToken", new Class[]{String.class, Long.class} ) );
  public static ServiceMethod UNDO = new ServiceMethod( "undo", getMethod( ExecutionService.class, "undo", new Class[]{String.class, Long.class, Date.class} ) );
  
  private transient Method method = null;
  
  protected ServiceMethod(String id, Method method) {
		super(id);
    this.method = method;
	}
  
  public Method getMethod() {
    return method;
  }

	public static Method getMethod( Class clazz, String methodName, Class[] parameterTypes ) {
    Method method = null;

    try {
      method = clazz.getMethod(methodName, parameterTypes);
    } catch (Exception e) {
      e.printStackTrace();
      throw new RuntimeException( "exception while initializing methods for authorization : " + e.getMessage() );
    }
    
    return method;
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?