Examples of UnknownException


Examples of com.google.apphosting.api.ApiProxy.UnknownException

              latencySimulator.simulateLatency(clock.getCurrentTime() - start, service, request);
            }
          }
        }
      } catch (IllegalAccessException e) {
        throw new UnknownException(packageName, methodName, e);
      } catch (InstantiationException e) {
        throw new UnknownException(packageName, methodName, e);
      } catch (NoSuchMethodException e) {
        throw new UnknownException(packageName, methodName, e);
      } catch (InvocationTargetException e) {
        if (e.getCause() instanceof RuntimeException) {
          throw (RuntimeException) e.getCause();
        }
        throw new UnknownException(packageName, methodName, e.getCause());
      } finally {
        ApiProxy.clearEnvironmentForCurrentThread();
      }
    }
View Full Code Here

Examples of com.netflix.astyanax.connectionpool.exceptions.UnknownException

                } catch (Exception e) {
                    long now = System.nanoTime();
                    latency = now - startTime;
                    ConnectionException connectionException;
                    if (!(e instanceof ConnectionException))
                        connectionException = new UnknownException(e);
                    else
                        connectionException = (ConnectionException)e;
                    connectionException.setLatency(latency);
                   
                    if (!(connectionException instanceof IsTimeoutException)) {
                        pool.addLatencySample(latency, now);
                    }
                    else {
                        pool.addLatencySample(TimeUnit.NANOSECONDS.convert(config.getSocketTimeout(), TimeUnit.MILLISECONDS), System.nanoTime());
                    }
                    lastException = connectionException;
                    throw lastException;
                }
            }

            @Override
            public void close() {
                if (isOpen) {
                    monitor.incConnectionClosed(getHost(), lastException);
                    executor.submit(new Runnable() {
                        @Override
                        public void run() {
                            final TestHostType type = TestHostType
                                    .get(getHost().getPort());
                            type.close();
                            isOpen = false;
                        }
                    });
                }
            }

            @Override
            public HostConnectionPool<TestClient> getHostConnectionPool() {
                return pool;
            }

            @Override
            public ConnectionException getLastException() {
                return lastException;
            }

            @Override
            public void open() throws ConnectionException {
                TestHostType type = TestHostType.get(getHost().getPort());
                try {
                    type.open(0);
                    isOpen = true;
                    monitor.incConnectionCreated(getHost());
                } catch (ConnectionException e) {
                    lastException = e;
                    e.setHost(getHost());
                    monitor.incConnectionCreateFailed(getHost(), e);
                    throw e;
                }
            }

            @Override
            public void openAsync(final AsyncOpenCallback<TestClient> callback) {
                final Connection<TestClient> This = this;
                executor.submit(new Runnable() {
                    @Override
                    public void run() {
                        Thread.currentThread().setName("MockConnectionFactory");
                        try {
                            open();
                            callback.success(This);
                        } catch (ConnectionException e) {
                            callback.failure(This, e);
                        } catch (Exception e) {
                            callback.failure(This, new UnknownException(
                                    "Error openning async connection", e));
                        }
                    }
                });
            }
View Full Code Here

Examples of de.zib.scalaris.UnknownException

            throw new TimeoutException(e);
        } catch (final UnknownException e) {
            System.out.println("      write(" + otpKey.stringValue() + ", "
                    + otpValue.stringValue() + ") failed with unknown: "
                    + e.getMessage());
            throw new UnknownException(e);
        }
    }
View Full Code Here

Examples of org.omg.CORBA.portable.UnknownException

                log.debug("MarshalException", e);
                throw new MARSHAL(e.toString());
            } catch (RemoteException e) {
                log.debug("RemoteException", e);
                e.printStackTrace();
                throw new UnknownException(e);
            } catch (RuntimeException e) {
                log.debug("RuntimeException", e);
                e.printStackTrace();
                RemoteException remoteException = new RemoteException(e.getClass().getName() + " thrown from " + ejbDeployment.getDeploymentId() + ": " + e.getMessage());
                throw new UnknownException(remoteException);
            } catch (Error e) {
                log.debug("Error", e);
                RemoteException remoteException = new RemoteException(e.getClass().getName() + " thrown from " + ejbDeployment.getDeploymentId() + ": " + e.getMessage());
                throw new UnknownException(remoteException);
            } catch (Throwable e) {
                log.warn("Unexpected throwable", e);
                throw new UNKNOWN("Unknown exception type " + e.getClass().getName() + ": " + e.getMessage());
            }
View Full Code Here

Examples of org.omg.CORBA.portable.UnknownException

            if (excepWriters[i].getExceptionClass().isInstance(e)) {
                excepWriters[i].write(out, e);
                return;
            }
        }
        throw new UnknownException(e);
    }
View Full Code Here

Examples of org.omg.CORBA.portable.UnknownException

            if (excepWriters[i].getExceptionClass().isInstance(e)) {
                excepWriters[i].write(out, e);
                return;
            }
        }
        throw new UnknownException(e);
    }
View Full Code Here

Examples of org.omg.CORBA.portable.UnknownException

                // the Yoko RMI support appears to be able to sort this out for us correctly.
                if (object instanceof Serializable && !object.getClass().isArray()) {
                    try {
                        object = copyObj(Thread.currentThread().getContextClassLoader(), object);
                    } catch (Exception e) {
                        throw new UnknownException(e);
                    }
                }

                if (type == Object.class || type == Serializable.class) {
                    javax.rmi.CORBA.Util.writeAny(out, object);
View Full Code Here

Examples of org.omg.CORBA.portable.UnknownException

                // the Yoko RMI support appears to be able to sort this out for us correctly.
                if (object instanceof Serializable && !object.getClass().isArray()) {
                    try {
                        object = copyObj(Thread.currentThread().getContextClassLoader(), object);
                    } catch (Exception e) {
                        throw new UnknownException(e);
                    }
                }

                if (type == Object.class || type == Serializable.class) {
                    javax.rmi.CORBA.Util.writeAny(out, object);
View Full Code Here

Examples of org.omg.CORBA.portable.UnknownException

            } catch (MarshalException e) {
                log.debug("MarshalException", e);
                throw (SystemException)new MARSHAL(e.toString()).initCause(e);
            } catch (RemoteException e) {
                log.debug("RemoteException", e);
                throw (SystemException)new UnknownException(e).initCause(e);
            } catch (RuntimeException e) {
                log.debug("RuntimeException", e);
                RemoteException remoteException = new RemoteException(e.getClass().getName() + " thrown from " + ejbDeployment.getDeploymentId() + ": " + e.getMessage(), e);
                throw new UnknownException(remoteException);
            } catch (Error e) {
                log.debug("Error", e);
                RemoteException remoteException = new RemoteException(e.getClass().getName() + " thrown from " + ejbDeployment.getDeploymentId() + ": " + e.getMessage(), e);
                throw new UnknownException(remoteException);
            } catch (Throwable e) {
                log.warn("Unexpected throwable", e);
                throw (SystemException)new UNKNOWN("Unknown exception type " + e.getClass().getName() + ": " + e.getMessage()).initCause(e);
            }
View Full Code Here

Examples of org.omg.CORBA.portable.UnknownException

      {
        throw ex;
      }
    catch (Throwable ex)
      {
        throw new UnknownException(ex);
      }
  }
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.