Package org.shiftone.jrat.core.spi

Examples of org.shiftone.jrat.core.spi.MethodHandler


    private ApplicationContext  springContext;
    private MethodHandlerFactory rootHandlerFactory;

    public MethodHandler createMethodHandler (MethodKey methodKey) throws Exception {

        MethodHandler methodHandler = rootHandlerFactory.createMethodHandler (methodKey);

        return methodHandler;
    }
View Full Code Here


    return (method.getReturnType().equals(Void.TYPE));
  }

  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

    MethodHandler methodHandler = null;
    Object result = null;
    long start = 0;
    boolean success = false;
    methodHandler = HandlerFactory.getMethodHandler(className, method);
    try {
      methodHandler.onMethodStart(target);
      start = System.currentTimeMillis();
      result = doInvoke(method, args);
      success = true;
      methodHandler.onMethodFinish(target, System.currentTimeMillis() - start, null);
      return result;
    } catch (Throwable throwable) {
      methodHandler.onMethodFinish(target, System.currentTimeMillis() - start, throwable);
      throw throwable;
    }
  }
View Full Code Here

    private static final Logger LOG = Logger.getLogger(CompositeMethodHandlerFactory.class);
    private List methodHandlerFactories = new ArrayList();
    private boolean started = false;

  public MethodHandler createMethodHandler(MethodKey methodKey) throws Exception {
        MethodHandler result;
        Set methodHandlers = new HashSet(methodHandlerFactories.size ());
        Iterator iterator = methodHandlerFactories.iterator ();

        while (iterator.hasNext ()) {

            MethodHandlerFactory factory = (MethodHandlerFactory)iterator.next ();

            MethodHandler methodHandler = factory.createMethodHandler (methodKey);
            if (methodHandler != null) {
                methodHandlers.add (methodHandler);
            }
        }
View Full Code Here

    }
  }

  public final synchronized MethodHandler getMethodHandler(MethodKey methodKey) {

    MethodHandler methodHandler = null;
    methodHandler = (MethodHandler) handlerCache.get(methodKey);
    if (methodHandler == null) {
      try {
        methodHandler = rootHandlerFactory.createMethodHandler(methodKey);
      } catch (Throwable e) {
View Full Code Here

    return methodHandler;
  }

  public final synchronized MethodHandler getMethodHandler(Method method) {

    MethodHandler methodHandler = null;
    MethodWrapper key = new MethodWrapper(method);
    methodHandler = (MethodHandler) methodCache.get(key);
    if (methodHandler == null) {
      String className = method.getDeclaringClass().getName();
      String methodName = method.getName();
View Full Code Here

    return methodHandler;
  }

  public final synchronized MethodHandler getMethodHandler(Constructor constructor) {

    MethodHandler methodHandler = null;
    methodHandler = (MethodHandler) methodCache.get(constructor);
    if (methodHandler == null) {
      String className = constructor.getDeclaringClass().getName();
      String methodName = constructor.getName();
      String signature = SignatureUtil.getSignature(constructor);
View Full Code Here

  private Context context;

  public MethodHandler createMethodHandler(MethodKey methodKey) throws Exception {

    MethodHandler methodHandler = new RateMethodHandler();

    if (true) {
      methodHandler = new BoundaryMethodHandler(context, methodHandler);
    }
View Full Code Here

   *
   * @return .
   */
  public synchronized MethodHandler createMethodHandler(MethodKey methodKey) {

    MethodHandler handler = null;
    int methodCount = output.getMethodCount();
    if (startupSucceeded == false) {
      LOG.info("startup failed, returning null handler");
    } else if (methodCount >= handlerMax) {
      LOG.info("handler max (" + handlerMax + ") exceeded, returning null handler");
View Full Code Here

TOP

Related Classes of org.shiftone.jrat.core.spi.MethodHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.