Gets the handler.

@param   <T> the generic type
@param t the t
@return the handler
193287
public <T extends Throwable> JKExceptionHandlerInfo getHandler(final T t) {
		JKExceptionHandlerInfo info = getHandler(t.getClass());
		if (info != null) {
			info.setException(t);
		}
		if (info == null && t.getCause() != null) {
			info = getHandler(t.getCause());
		}
		return info;
	}
1127757
public <T> T get(Class<T> c, String name){
        return Objects.cast(get(name),c);
    }
103516
@Override
	protected Object getHandler(String serviceName) {
		Object handler = handlerMap.get(serviceName);
		if (handler == null) {
			logger.error("Service '{}' is not registered in this multi-server", serviceName);
			throw new RuntimeException("Service '" + serviceName + "' does not exist");
		}
		return handler;
	}
1193837
public static String getStackTrace(final Throwable t)
	{
		StringWriter _writer = new StringWriter();
		PrintWriter _print = new PrintWriter(_writer);
		t.printStackTrace(_print);
		return _writer.toString();
	}
845107
public H getHandler(Object o) {
    if(o == null) {
      return null;
    }
    // note that we start at the end of the list.
    ListIterator<Pair<Class<?>, H>> iter = handlers.listIterator(handlers.size());
    while(iter.hasPrevious()) {
      Pair<Class<?>, H> pair = iter.previous();
      try {
        // if we can cast to the restriction class, use the given handler.
        pair.getFirst().cast(o);
        return pair.getSecond();
      }
      catch(ClassCastException e) {
        // do nothing, but try previous in list
      }
    }
    return null;
  }
946540
private <T> HttpResponseHandler<T> getNonNullResponseHandler(
            HttpResponseHandler<T> responseHandler) {
        if (responseHandler != null) {
            return responseHandler;
        } else {
            // Return a Dummy, No-Op handler
            return new HttpResponseHandler<T>() {

                @Override
                public T handle(HttpResponse response) throws Exception {
                    return null;
                }

                @Override
                public boolean needsConnectionLeftOpen() {
                    return false;
                }
            };
        }
    }
150991
@Override
    public <T> Handler<AsyncResult<T>> toHandler(Resolver<T> resolver) {
        return result -> {
            if (result.succeeded()) {
                resolver.resolve(result.result());
            } else {
                resolver.reject(result.cause());
            }
        };
    }
1058479
public B handler(ChannelHandler handler) {
        if (handler == null) {
            throw new NullPointerException("handler");
        }
        this.handler = handler;
        return self();
    }
942901
@SuppressWarnings("deprecation")
	public static Handler getHandler(List<Handler> handlerList, Handler actionHandler) {
		Handler result = actionHandler;
		
		for (int i=handlerList.size()-1; i>=0; i--) {
			Handler temp = handlerList.get(i);
			temp.next = result;
			temp.nextHandler = result;
			result = temp;
		}
		
		return result;
	}
636294
public InvocationHandler getInvocationHandler(Object proxy) {
        Field field = getInvocationHandlerField();
        try {
            return (InvocationHandler) field.get(proxy);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException("Object is not a proxy of correct type", e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
451679
public void getToken(GetTokenHandler handler) {
        HMSAgentLog.i("getToken:handler=" + StrUtils.objDesc(handler));
        this.handler = handler;
        retryTimes = MAX_RETRY_TIMES;
        connect();
    }
155856
ManagementRequestHandler<Void, Void> getCloseHandler() {
        return new AbstractAttachmentHandler() {
            @Override
            void handleRequest(TimedStreamEntry entry, FlushableDataOutput output) throws IOException {
                // no-op as AbstractAttachmentHandler will close the entry after calling this
            }

            @Override
            void handleMissingStream(int requestId, int index, FlushableDataOutput output) throws IOException {
                // no-op as there's nothing to do
            }
        };
    }
406116
public final TcpClient handle(BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>> handler) {
		Objects.requireNonNull(handler, "handler");
		return doOnConnected(c -> {
			if (log.isDebugEnabled()) {
				log.debug(format(c.channel(), "Handler is being applied: {}"), handler);
			}

			Mono.fromDirect(handler.apply((NettyInbound) c, (NettyOutbound) c))
			    .subscribe(c.disposeSubscriber());
		});
	}
467888
public static ExpressionHandler getHandler(Expression expression) {
        ExpressionHandler ret = null;
        Class<? extends ExpressionHandler> cls = handlers.get(expression.getClass());
        if (cls != null) {
            try {
                Constructor<? extends ExpressionHandler> con = cls.getConstructor(Expression.class);
                ret = con.newInstance(expression);
            } catch (Exception e) {
                log.log(Level.SEVERE, "Failed to instantiate handler for expression '" + expression + "'", e);
            }
        }
        return ret;
    }
1177322
public static String getMessage(Throwable t) {

        String message = t.getLocalizedMessage();
        if (message == null) {
            message = t.getMessage();
        }
        if (message == null) {
            message = t.getClass().getName();
        }
        return message;
    }
167444
public <T> HttpClientRequest.Builder<T> get(final String uri, final HttpClientResponseHandler<T> httpHandler)
    {
        return get(URI.create(uri), httpHandler);
    }
1129900
@Override
    public ReadStream<Buffer> handler(Handler<Buffer> handler) {
        if (handler == null) {
            throw new IllegalArgumentException("handler");
        }
        this.dataHandler = handler;
        doRead();
        return this;
    }