コード例 #1
0
  /**
   * Returns Adapter Descriptor mapped class instance based on adapter descriptor name.
   *
   * @param adapterDescriptorName Name of Adapter Descriptor.
   * @return Adapter Class Instance.
   */
  public IAdapter getAdapterInstance(String adapterDescriptorName) {
    AdapterDescriptor adapterDescriptor =
        resourceManager.getAdapterDescriptor(adapterDescriptorName);
    String mapTo = adapterDescriptor.getMapTo();

    return (IAdapter) ClassUtils.createClassInstance(mapTo);
  }
コード例 #2
0
  /**
   * Returns Handler mapped method instance based on adapter name, handler name and its handler
   * parameter types.
   *
   * @param adapterDescriptorName Name of Adapter.
   * @param handlerName Name of Handler.
   * @param handlerParameterTypes Type of Parameters.
   * @return Handler Method Instance.
   */
  public Method getHandlerInstance(
      String adapterDescriptorName, String handlerName, Class<?>... handlerParameterTypes) {

    AdapterDescriptor adapterDescriptor =
        resourceManager.getAdapterDescriptor(adapterDescriptorName);
    Handler handler = adapterDescriptor.getHandler(handlerName);

    return ClassUtils.createMethodBasedOnClassName(
        adapterDescriptor.getMapTo(), handler.getMapTo(), handlerParameterTypes);
  }