Examples of ODataErrorCallback


Examples of org.apache.olingo.odata2.api.processor.ODataErrorCallback

  }

  private ODataResponse handleWebApplicationException(final Exception exception) throws ClassNotFoundException,
      InstantiationException, IllegalAccessException, EntityProviderException {
    ODataErrorContext errorContext = createErrorContext((WebApplicationException) exception);
    ODataErrorCallback callback = getErrorHandlerCallback();
    return callback == null ?
        new ProviderFacadeImpl().writeErrorDocument(errorContext) : executeErrorCallback(errorContext, callback);
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.processor.ODataErrorCallback

   *
   */
  @Test
  public void testCallbackPathInfoAvailable() throws Exception {
    ODataContextImpl context = getMockedContext("http://localhost:80/test", "ODataServiceRoot");
    ODataErrorCallback errorCallback = new ODataErrorCallback() {
      @Override
      public ODataResponse handleError(final ODataErrorContext context) throws ODataApplicationException {
        PathInfo pathInfo = context.getPathInfo();
        assertEquals("ODataServiceRoot", pathInfo.getServiceRoot().toString());
        assertEquals("http://localhost:80/test", pathInfo.getRequestUri().toString());
View Full Code Here

Examples of org.apache.olingo.odata2.api.processor.ODataErrorCallback

    return ContentType.APPLICATION_XML;
  }

  private ODataErrorCallback getErrorHandlerCallbackFromContext(final ODataContext context)
      throws ClassNotFoundException, InstantiationException, IllegalAccessException {
    ODataErrorCallback callback = null;
    ODataServiceFactory serviceFactory = context.getServiceFactory();
    callback = serviceFactory.getCallback(ODataErrorCallback.class);
    return callback;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.processor.ODataErrorCallback

  }

  private ODataResponse handleWebApplicationException(final Exception exception) throws ClassNotFoundException,
      InstantiationException, IllegalAccessException, EntityProviderException {
    ODataErrorContext errorContext = createErrorContext((WebApplicationException) exception);
    ODataErrorCallback callback = getErrorHandlerCallback();
    return callback == null ?
        new ProviderFacadeImpl().writeErrorDocument(errorContext) : executeErrorCallback(errorContext, callback);
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.processor.ODataErrorCallback

    }
    return ContentType.APPLICATION_XML;
  }

  private ODataErrorCallback getErrorHandlerCallback() {
    ODataErrorCallback callback = null;
    final ODataServiceFactory serviceFactory =
        ODataRootLocator.createServiceFactoryFromContext(app, servletRequest, servletConfig);
    callback = serviceFactory.getCallback(ODataErrorCallback.class);
    return callback;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.processor.ODataErrorCallback

    return ContentType.APPLICATION_XML;
  }

  private ODataErrorCallback getErrorHandlerCallbackFromContext(final ODataContext context)
      throws ClassNotFoundException, InstantiationException, IllegalAccessException {
    ODataErrorCallback callback = null;
    ODataServiceFactory serviceFactory = context.getServiceFactory();
    callback = serviceFactory.getCallback(ODataErrorCallback.class);
    return callback;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.processor.ODataErrorCallback

  }

  private ODataErrorCallback getErrorHandlerCallbackFromServletConfig(final ServletConfig servletConfig,
      final HttpServletRequest servletRequest) throws InstantiationException, IllegalAccessException,
      ClassNotFoundException {
    ODataErrorCallback callback = null;
    final String factoryClassName = servletConfig.getInitParameter(ODataServiceFactory.FACTORY_LABEL);
    if (factoryClassName != null) {
      ClassLoader cl = (ClassLoader) servletRequest.getAttribute(ODataServiceFactory.FACTORY_CLASSLOADER_LABEL);
      Class<?> factoryClass;
      if (cl == null) {
View Full Code Here

Examples of org.apache.olingo.odata2.api.processor.ODataErrorCallback

   *
   */
  @Test
  public void testCallbackPathInfoAvailable() throws Exception {
    ODataContextImpl context = getMockedContext("http://localhost:80/test", "ODataServiceRoot");
    ODataErrorCallback errorCallback = new ODataErrorCallback() {
      @Override
      public ODataResponse handleError(final ODataErrorContext context) throws ODataApplicationException {
        PathInfo pathInfo = context.getPathInfo();
        assertEquals("ODataServiceRoot", pathInfo.getServiceRoot().toString());
        assertEquals("http://localhost:80/test", pathInfo.getRequestUri().toString());
View Full Code Here

Examples of org.apache.olingo.odata2.api.processor.ODataErrorCallback

  }

  private ODataResponse handleWebApplicationException(final Exception exception) throws ClassNotFoundException,
      InstantiationException, IllegalAccessException, EntityProviderException {
    ODataErrorContext errorContext = createErrorContext((WebApplicationException) exception);
    ODataErrorCallback callback = getErrorHandlerCallback();
    return callback == null ?
        new ProviderFacadeImpl().writeErrorDocument(errorContext) : executeErrorCallback(errorContext, callback);
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.processor.ODataErrorCallback

    return ContentType.APPLICATION_XML;
  }

  private ODataErrorCallback getErrorHandlerCallback() throws ClassNotFoundException, InstantiationException,
      IllegalAccessException {
    ODataErrorCallback callback = null;
    final String factoryClassName = servletConfig.getInitParameter(ODataServiceFactory.FACTORY_LABEL);
    if (factoryClassName != null) {
      ClassLoader cl = (ClassLoader) servletRequest.getAttribute(ODataServiceFactory.FACTORY_CLASSLOADER_LABEL);
      Class<?> factoryClass;
      if (cl == null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.