Examples of ClientException


Examples of de.iritgo.aktera.clients.ClientException

          }
          catch (IOException e)
          {
            e.printStackTrace();
            log.error("Exception during file read/write:", e);
            throw new ClientException("Exception during file read/write", e);
          }
          finally
          {
            // Flush all streams, and close input streams
            try
            {
              data.close();
            }
            catch (IOException e1)
            {
              e1.printStackTrace();
            }

            try
            {
              buffOut.flush();
            }
            catch (IOException e2)
            {
              e2.printStackTrace();
            }

            // Do NOT close the Output stream here, as the
            // underlying output stream is/should be closed later.
          }
        }
        else
        {
          outputs.add(reAsBean);
        }
      }
      else if (re instanceof Command)
      {
        commands.add(reAsBean);
      }
    }

    wreq.setAttribute("inputs", inputs);
    wreq.setAttribute("outputs", outputs);
    wreq.setAttribute("commands", commands);

    int inputCount = 0;
    DynaProperty[] dps = new DynaProperty[inputs.size()];
    ResponseElementDynaBean oneInput = null;

    for (Iterator ii = inputs.iterator(); ii.hasNext();)
    {
      oneInput = (ResponseElementDynaBean) ii.next();

      Object defValue = oneInput.get("defaultValue");
      DynaProperty dp = null;

      if (defValue != null)
      {
        dp = new DynaProperty((String) oneInput.get("name"), oneInput.get("defaultValue").getClass());
      }
      else
      {
        try
        {
          dp = new DynaProperty((String) oneInput.get("name"), Class.forName("java.lang.String"));
        }
        catch (ClassNotFoundException e)
        {
          throw new ClientException("Cannot create String dynaproperty", e);
        }
      }

      dps[inputCount++] = dp;
    }

    BasicDynaClass bd;

    try
    {
      bd = new BasicDynaClass(modelName, Class.forName("org.apache.commons.beanutils.BasicDynaBean"), dps);

      BasicDynaBean newForm = (BasicDynaBean) bd.newInstance();

      // Now populate the newForm's properties
      for (Iterator i2 = inputs.iterator(); i2.hasNext();)
      {
        oneInput = (ResponseElementDynaBean) i2.next();
        newForm.set((String) oneInput.get("name"), oneInput.get("defaultValue"));
      }

      wreq.setAttribute("default", newForm);
    }
    catch (ClassNotFoundException e)
    {
      throw new ClientException(e);
    }
    catch (IllegalAccessException e)
    {
      throw new ClientException(e);
    }
    catch (InstantiationException e)
    {
      throw new ClientException(e);
    }
  }
View Full Code Here

Examples of eu.admire.clienttoolkit.core.ClientException

                JAXBContext.newInstance(Errors.class).createUnmarshaller();
            return (Errors)unmarshaller.unmarshal(new StringReader(value));
        }
        catch (JAXBException e)
        {
            throw new ClientException(
                    "A problem occured when parsing server errors", e);
        }
    }
View Full Code Here

Examples of javax.ws.rs.client.ClientException

            || actualEx instanceof IOException
                && outMessage.getExchange().get("client.redirect.exception") != null) {
            if (actualEx instanceof ClientException) {
                throw ex;
            } else if (actualEx != null) {
                throw new ClientException(actualEx);
            } else if (!outMessage.getExchange().isOneWay() || cfg.isResponseExpectedForOneway()) {
                waitForResponseCode(outMessage.getExchange());
            }
        }
    }
View Full Code Here

Examples of javax.ws.rs.client.ClientException

                return;
            }
        }
       
        if (getResponseCode(exchange) == null) {
            throw new ClientException("Response timeout");
        }
    }
View Full Code Here

Examples of javax.ws.rs.client.ClientException

            new org.apache.cxf.common.i18n.Message(name,
                                                   BUNDLE,
                                                   cls,
                                                   JAXRSUtils.mediaTypeToString(ct));
        LOG.severe(errorMsg.toString());
        throw new ClientException(errorMsg.toString(), cause);
    }
View Full Code Here

Examples of javax.ws.rs.client.ClientException

            }
        } catch (Exception ex) {
            Throwable t = ex instanceof WebApplicationException
                ? (WebApplicationException)ex
                : ex instanceof ClientException
                ? (ClientException)ex : new ClientException(ex);
            cb.handleException(message, t);
            return;
        }
        if (r == null) {
            try {
View Full Code Here

Examples of javax.ws.rs.client.ClientException

            }
        } catch (Exception ex) {
            throw ex instanceof WebApplicationException
                ? (WebApplicationException)ex
                : ex instanceof ClientException
                ? new ClientException(ex) : new RuntimeException(ex);
        }
       
        Response response = null;
        Object entity = null;
        try {
View Full Code Here

Examples of javax.ws.rs.client.ClientException

            getState().setResponse(r);
           
            return r;
        } catch (Throwable ex) {
            throw (ex instanceof ClientException) ? (ClientException)ex
                                                  : new ClientException(ex);
        } finally {
            ProviderFactory.getInstance(outMessage).clearThreadLocalProxies();
        }
    }
View Full Code Here

Examples of javax.ws.rs.client.ClientException

            new org.apache.cxf.common.i18n.Message(name,
                                                   BUNDLE,
                                                   m.getDeclaringClass().getName(),
                                                   m.getName());
        LOG.severe(errorMsg.toString());
        throw new ClientException(errorMsg.toString());
    }
View Full Code Here

Examples of javax.ws.rs.client.ClientException

   
    @Override
    public boolean cancel(boolean mayInterruptIfRunning) {
        boolean result = super.cancel(mayInterruptIfRunning);
        if (result && handler != null) {
            handler.failed(new ClientException(new CancellationException()));
        }
        return result;
    }
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.