List of usage examples for java.io NotSerializableException setStackTrace
public void setStackTrace(StackTraceElement[] stackTrace)
From source file:org.eclipse.ecf.provider.internal.org.change.ChangeClientContainer.java
public void connect(ID targetID, IConnectContext connectContext1) throws ContainerConnectException { // Set the connectTargetID in the AbstractClientContainer super class super.connect(targetID, connectContext1); // Create callables prior to registering them via registerCallables // below//w w w .j a v a2s . com List<IRemoteCallable> petitionCallables = new ArrayList<IRemoteCallable>(); // add callable for getPetitionId petitionCallables.add(new RemoteCallable.Builder("getPetitionId", "/v1/petitions/get_id") .setRequestType(new HttpGetRequestType()).build()); // add callables for other IPetitionService methods // Register callables registration = registerCallables(IPetitionService.class, petitionCallables.toArray(new IRemoteCallable[petitionCallables.size()]), null); setResponseDeserializer(new IRemoteResponseDeserializer() { @Override public Object deserializeResponse(String endpoint, IRemoteCall call, IRemoteCallable callable, @SuppressWarnings("rawtypes") Map responseHeaders, byte[] responseBody) throws NotSerializableException { try { return new JSONObject(new String(responseBody)).getInt("petition_id"); } catch (JSONException e) { NotSerializableException t = new NotSerializableException( "response from endpoint=" + endpoint + " could not be parsed"); t.setStackTrace(e.getStackTrace()); throw t; } } }); }