Java 类java.rmi.UnexpectedException 实例源码

项目:cloud-native-microservice-strangler-example    文件:Receiver.java   
@RabbitListener(queues = {"customer.update"})
public void updateCustomer(String message) throws InterruptedException, IOException {
    Profile profile = objectMapper.readValue(message, Profile.class);

    try {
        // Update the customer service for the profile
        UpdateCustomerResponse response =
                customerClient.updateCustomerResponse(profile);

        if (!response.isSuccess()) {
            String errorMsg =
                    String.format("Could not update customer from profile for %s",
                            profile.getUsername());
            log.error(errorMsg);
            throw new UnexpectedException(errorMsg);
        }
    } catch (Exception ex) {
        // Throw AMQP exception and redeliver the message
        throw new AmqpIllegalStateException("Customer service update failed", ex);
    }
}
项目:OpenJSharp    文件:Util.java   
/**
 * Wraps an exception thrown by an implementation
 * method.  It returns the corresponding client-side exception.
 * @param orig the exception to wrap.
 * @return the wrapped exception.
 */
public RemoteException wrapException(Throwable orig)
{
    if (orig instanceof SystemException) {
        return mapSystemException((SystemException)orig);
    }

    if (orig instanceof Error) {
        return new ServerError("Error occurred in server thread",(Error)orig);
    } else if (orig instanceof RemoteException) {
        return new ServerException("RemoteException occurred in server thread",
                                   (Exception)orig);
    } else if (orig instanceof RuntimeException) {
        throw (RuntimeException) orig;
    }

    if (orig instanceof Exception)
        return new UnexpectedException( orig.toString(), (Exception)orig );
    else
        return new UnexpectedException( orig.toString());
}
项目:OpenJSharp    文件:ExceptionHandlerImpl.java   
public Exception readException( ApplicationException ae )
{
    // Note that the exception ID is present in both ae
    // and in the input stream from ae.  The exception
    // reader must actually read the exception ID from
    // the stream.
    InputStream is = (InputStream)ae.getInputStream() ;
    String excName = ae.getId() ;
    int index = findDeclaredException( excName ) ;
    if (index < 0) {
        excName = is.read_string() ;
        Exception res = new UnexpectedException( excName ) ;
        res.initCause( ae ) ;
        return res ;
    }

    return rws[index].read( is ) ;
}
项目:openjdk-jdk10    文件:Util.java   
/**
 * Wraps an exception thrown by an implementation
 * method.  It returns the corresponding client-side exception.
 * @param orig the exception to wrap.
 * @return the wrapped exception.
 */
public RemoteException wrapException(Throwable orig)
{
    if (orig instanceof SystemException) {
        return mapSystemException((SystemException)orig);
    }

    if (orig instanceof Error) {
        return new ServerError("Error occurred in server thread",(Error)orig);
    } else if (orig instanceof RemoteException) {
        return new ServerException("RemoteException occurred in server thread",
                                   (Exception)orig);
    } else if (orig instanceof RuntimeException) {
        throw (RuntimeException) orig;
    }

    if (orig instanceof Exception)
        return new UnexpectedException( orig.toString(), (Exception)orig );
    else
        return new UnexpectedException( orig.toString());
}
项目:openjdk-jdk10    文件:ExceptionHandlerImpl.java   
public Exception readException( ApplicationException ae )
{
    // Note that the exception ID is present in both ae
    // and in the input stream from ae.  The exception
    // reader must actually read the exception ID from
    // the stream.
    InputStream is = (InputStream)ae.getInputStream() ;
    String excName = ae.getId() ;
    int index = findDeclaredException( excName ) ;
    if (index < 0) {
        excName = is.read_string() ;
        Exception res = new UnexpectedException( excName ) ;
        res.initCause( ae ) ;
        return res ;
    }

    return rws[index].read( is ) ;
}
项目:Planchester    文件:PlanchesterGUI.java   
private static void showPlanchesterGUI() {
    try {
        primaryStage = new Stage();
        primaryStage.setTitle("Planchester");
        //primaryStage.setResizable(false);
        primaryStage.setMaximized(true);

        primaryStage.setOnCloseRequest(t -> {
            closePlanchester();
        });

        scene = new Scene(FXMLLoader.load(PlanchesterGUI.class.getResource("PlanchesterFrame.fxml")));

        URL url = PlanchesterGUI.class.getResource("CSS/stylesheet.css");
        if (url == null) {
            throw new UnexpectedException("CSS Resource not found. Aborting.");
        }
        String css = url.toExternalForm();
        scene.getStylesheets().add(css);

        primaryStage.setScene(scene);
        primaryStage.getIcons().add(new Image("file:src/Presentation/Images/logoplanchester.png"));
        primaryStage.show();
    } catch (IOException exception) {
        exception.printStackTrace();
    }
}
项目:openjdk9    文件:Util.java   
/**
 * Wraps an exception thrown by an implementation
 * method.  It returns the corresponding client-side exception.
 * @param orig the exception to wrap.
 * @return the wrapped exception.
 */
public RemoteException wrapException(Throwable orig)
{
    if (orig instanceof SystemException) {
        return mapSystemException((SystemException)orig);
    }

    if (orig instanceof Error) {
        return new ServerError("Error occurred in server thread",(Error)orig);
    } else if (orig instanceof RemoteException) {
        return new ServerException("RemoteException occurred in server thread",
                                   (Exception)orig);
    } else if (orig instanceof RuntimeException) {
        throw (RuntimeException) orig;
    }

    if (orig instanceof Exception)
        return new UnexpectedException( orig.toString(), (Exception)orig );
    else
        return new UnexpectedException( orig.toString());
}
项目:openjdk9    文件:ExceptionHandlerImpl.java   
public Exception readException( ApplicationException ae )
{
    // Note that the exception ID is present in both ae
    // and in the input stream from ae.  The exception
    // reader must actually read the exception ID from
    // the stream.
    InputStream is = (InputStream)ae.getInputStream() ;
    String excName = ae.getId() ;
    int index = findDeclaredException( excName ) ;
    if (index < 0) {
        excName = is.read_string() ;
        Exception res = new UnexpectedException( excName ) ;
        res.initCause( ae ) ;
        return res ;
    }

    return rws[index].read( is ) ;
}
项目:lookaside_java-1.8.0-openjdk    文件:Util.java   
/**
 * Wraps an exception thrown by an implementation
 * method.  It returns the corresponding client-side exception.
 * @param orig the exception to wrap.
 * @return the wrapped exception.
 */
public RemoteException wrapException(Throwable orig)
{
    if (orig instanceof SystemException) {
        return mapSystemException((SystemException)orig);
    }

    if (orig instanceof Error) {
        return new ServerError("Error occurred in server thread",(Error)orig);
    } else if (orig instanceof RemoteException) {
        return new ServerException("RemoteException occurred in server thread",
                                   (Exception)orig);
    } else if (orig instanceof RuntimeException) {
        throw (RuntimeException) orig;
    }

    if (orig instanceof Exception)
        return new UnexpectedException( orig.toString(), (Exception)orig );
    else
        return new UnexpectedException( orig.toString());
}
项目:lookaside_java-1.8.0-openjdk    文件:ExceptionHandlerImpl.java   
public Exception readException( ApplicationException ae )
{
    // Note that the exception ID is present in both ae
    // and in the input stream from ae.  The exception
    // reader must actually read the exception ID from
    // the stream.
    InputStream is = (InputStream)ae.getInputStream() ;
    String excName = ae.getId() ;
    int index = findDeclaredException( excName ) ;
    if (index < 0) {
        excName = is.read_string() ;
        Exception res = new UnexpectedException( excName ) ;
        res.initCause( ae ) ;
        return res ;
    }

    return rws[index].read( is ) ;
}
项目:jdk8u_corba    文件:Util.java   
/**
 * Wraps an exception thrown by an implementation
 * method.  It returns the corresponding client-side exception.
 * @param orig the exception to wrap.
 * @return the wrapped exception.
 */
public RemoteException wrapException(Throwable orig)
{
    if (orig instanceof SystemException) {
        return mapSystemException((SystemException)orig);
    }

    if (orig instanceof Error) {
        return new ServerError("Error occurred in server thread",(Error)orig);
    } else if (orig instanceof RemoteException) {
        return new ServerException("RemoteException occurred in server thread",
                                   (Exception)orig);
    } else if (orig instanceof RuntimeException) {
        throw (RuntimeException) orig;
    }

    if (orig instanceof Exception)
        return new UnexpectedException( orig.toString(), (Exception)orig );
    else
        return new UnexpectedException( orig.toString());
}
项目:jdk8u_corba    文件:ExceptionHandlerImpl.java   
public Exception readException( ApplicationException ae )
{
    // Note that the exception ID is present in both ae
    // and in the input stream from ae.  The exception
    // reader must actually read the exception ID from
    // the stream.
    InputStream is = (InputStream)ae.getInputStream() ;
    String excName = ae.getId() ;
    int index = findDeclaredException( excName ) ;
    if (index < 0) {
        excName = is.read_string() ;
        Exception res = new UnexpectedException( excName ) ;
        res.initCause( ae ) ;
        return res ;
    }

    return rws[index].read( is ) ;
}
项目:HIndex    文件:MemStore.java   
/**
 * The passed snapshot was successfully persisted; it can be let go.
 * @param ss The snapshot to clean out.
 * @throws UnexpectedException
 * @see #snapshot()
 */
void clearSnapshot(final SortedSet<KeyValue> ss)
throws UnexpectedException {
  MemStoreLAB tmpAllocator = null;
  if (this.snapshot != ss) {
    throw new UnexpectedException("Current snapshot is " +
        this.snapshot + ", was passed " + ss);
  }
  // OK. Passed in snapshot is same as current snapshot.  If not-empty,
  // create a new snapshot and let the old one go.
  if (!ss.isEmpty()) {
    this.snapshot = new KeyValueSkipListSet(this.comparator);
    this.snapshotTimeRangeTracker = new TimeRangeTracker();
  }
  this.snapshotSize = 0;
  if (this.snapshotAllocator != null) {
    tmpAllocator = this.snapshotAllocator;
    this.snapshotAllocator = null;
  }
  if (tmpAllocator != null) {
    tmpAllocator.close();
  }
}
项目:infobip-open-jdk-8    文件:Util.java   
/**
 * Wraps an exception thrown by an implementation
 * method.  It returns the corresponding client-side exception.
 * @param orig the exception to wrap.
 * @return the wrapped exception.
 */
public RemoteException wrapException(Throwable orig)
{
    if (orig instanceof SystemException) {
        return mapSystemException((SystemException)orig);
    }

    if (orig instanceof Error) {
        return new ServerError("Error occurred in server thread",(Error)orig);
    } else if (orig instanceof RemoteException) {
        return new ServerException("RemoteException occurred in server thread",
                                   (Exception)orig);
    } else if (orig instanceof RuntimeException) {
        throw (RuntimeException) orig;
    }

    if (orig instanceof Exception)
        return new UnexpectedException( orig.toString(), (Exception)orig );
    else
        return new UnexpectedException( orig.toString());
}
项目:infobip-open-jdk-8    文件:ExceptionHandlerImpl.java   
public Exception readException( ApplicationException ae )
{
    // Note that the exception ID is present in both ae
    // and in the input stream from ae.  The exception
    // reader must actually read the exception ID from
    // the stream.
    InputStream is = (InputStream)ae.getInputStream() ;
    String excName = ae.getId() ;
    int index = findDeclaredException( excName ) ;
    if (index < 0) {
        excName = is.read_string() ;
        Exception res = new UnexpectedException( excName ) ;
        res.initCause( ae ) ;
        return res ;
    }

    return rws[index].read( is ) ;
}
项目:txtUML    文件:Exporter.java   
/**
 * Populates model with the diagrams to be exported
 * 
 * @throws ModelMapException
 * @throws ArrangeException
 * @throws UnknownDiagramTypeException
 * @throws UnexpectedEndException
 */
private void createModel() throws ModelMapException, ArrangeException, UnexpectedDiagramTypeException,
        UnexpectedEndException, UnexpectedException {

    for (Pair<String, DiagramExportationReport> report : layout.getReportsWithDiagramNames()) {
        String name = report.getFirst();
        DiagramExportationReport der = report.getSecond();

        // map connects the layout information to the EMF-UML model
        // informations
        ModelMapProvider map = new ModelMapProvider(URI.createFileURI(genFolder), der.getModelName());

        model.createDiagram(name, report.getSecond(), map);

    }

}
项目:openjdk-source-code-learn    文件:Util.java   
/**
 * Wraps an exception thrown by an implementation
 * method.  It returns the corresponding client-side exception.
 * @param orig the exception to wrap.
 * @return the wrapped exception.
 */
public RemoteException wrapException(Throwable orig)
{
    if (orig instanceof SystemException) {
        return mapSystemException((SystemException)orig);
    }

    if (orig instanceof Error) {
        return new ServerError("Error occurred in server thread",(Error)orig);
    } else if (orig instanceof RemoteException) {
        return new ServerException("RemoteException occurred in server thread",
                                   (Exception)orig);
    } else if (orig instanceof RuntimeException) {
        throw (RuntimeException) orig;
    }

    if (orig instanceof Exception)
        return new UnexpectedException( orig.toString(), (Exception)orig );
    else
        return new UnexpectedException( orig.toString());
}
项目:openjdk-source-code-learn    文件:ExceptionHandlerImpl.java   
public Exception readException( ApplicationException ae )
{
    // Note that the exception ID is present in both ae
    // and in the input stream from ae.  The exception
    // reader must actually read the exception ID from
    // the stream.
    InputStream is = (InputStream)ae.getInputStream() ;
    String excName = ae.getId() ;
    int index = findDeclaredException( excName ) ;
    if (index < 0) {
        excName = is.read_string() ;
        Exception res = new UnexpectedException( excName ) ;
        res.initCause( ae ) ;
        return res ;
    }

    return rws[index].read( is ) ;
}
项目:RStore    文件:MemStore.java   
/**
 * The passed snapshot was successfully persisted; it can be let go.
 * @param ss The snapshot to clean out.
 * @throws UnexpectedException
 * @see {@link #snapshot()}
 */
void clearSnapshot(final SortedSet<KeyValue> ss)
throws UnexpectedException {
  this.lock.writeLock().lock();
  try {
    if (this.snapshot != ss) {
      throw new UnexpectedException("Current snapshot is " +
        this.snapshot + ", was passed " + ss);
    }
    // OK. Passed in snapshot is same as current snapshot.  If not-empty,
    // create a new snapshot and let the old one go.
    if (!ss.isEmpty()) {
      this.snapshot = new KeyValueSkipListSet(this.comparator);
      this.snapshotTimeRangeTracker = new TimeRangeTracker();
    }
  } finally {
    this.lock.writeLock().unlock();
  }
}
项目:OLD-OpenJDK8    文件:Util.java   
/**
 * Wraps an exception thrown by an implementation
 * method.  It returns the corresponding client-side exception.
 * @param orig the exception to wrap.
 * @return the wrapped exception.
 */
public RemoteException wrapException(Throwable orig)
{
    if (orig instanceof SystemException) {
        return mapSystemException((SystemException)orig);
    }

    if (orig instanceof Error) {
        return new ServerError("Error occurred in server thread",(Error)orig);
    } else if (orig instanceof RemoteException) {
        return new ServerException("RemoteException occurred in server thread",
                                   (Exception)orig);
    } else if (orig instanceof RuntimeException) {
        throw (RuntimeException) orig;
    }

    if (orig instanceof Exception)
        return new UnexpectedException( orig.toString(), (Exception)orig );
    else
        return new UnexpectedException( orig.toString());
}
项目:OLD-OpenJDK8    文件:ExceptionHandlerImpl.java   
public Exception readException( ApplicationException ae )
{
    // Note that the exception ID is present in both ae
    // and in the input stream from ae.  The exception
    // reader must actually read the exception ID from
    // the stream.
    InputStream is = (InputStream)ae.getInputStream() ;
    String excName = ae.getId() ;
    int index = findDeclaredException( excName ) ;
    if (index < 0) {
        excName = is.read_string() ;
        Exception res = new UnexpectedException( excName ) ;
        res.initCause( ae ) ;
        return res ;
    }

    return rws[index].read( is ) ;
}
项目:cn1    文件:RemoteObjectInvocationHandler.java   
private Object invokeRemoteMethod(Object proxy, Method m, Object[] args)
        throws Throwable {
    try {
        return ref.invoke((Remote) proxy, m, args,
                RMIHash.getMethodHash(m));
    } catch (RuntimeException re) {
        throw re;
    } catch (Exception ex) {
        Method m1 = proxy.getClass().getMethod(m.getName(),
                m.getParameterTypes());
        Class[] declaredEx = m1.getExceptionTypes();

        for (int i = 0; i < declaredEx.length; ++i) {
            if (declaredEx[i].isAssignableFrom(ex.getClass())) {
                throw ex;
            }
        }
        // rmi.24=Unexpected exception
        throw new UnexpectedException(Messages.getString("rmi.24"), ex); //$NON-NLS-1$
    }
}
项目:varsim    文件:VCFInfo.java   
/**
 * parse comma separated value and store it
 * in proper types
 * @param id
 * @param vcfIdValue
 */
public VCFInfoElement(final String id, String vcfIdValue) throws UnexpectedException {
    this.type = getType(id);
    String[] valueArray = vcfIdValue.split(",");
    if (type == int[].class) {
        int[] nums = new int[valueArray.length];
        for (int i = 0; i < valueArray.length; i++) {
            nums[i] = Integer.parseInt(valueArray[i]);
        }
        this.value = type.cast(nums);
    } else if (type == String[].class) {
            this.value = type.cast(valueArray);
    } else {
        throw new UnexpectedException("ERROR: only Integer and String supported for INFO field (" + id + ").");
    }
}
项目:varsim    文件:VCFparserTest.java   
@Before
public void setup() throws UnexpectedException{
    parser = new VCFparser();
    parser.processLine("##fileformat=VCFv4.1");
    parser.processLine("##reference=src/test/resources/DuplicationTest/oneDuplicationTest.fa");
    parser.processLine("##INFO=<ID=SVLEN,Number=.,Type=Integer,Description=\"Length of variant\">");
    parser.processLine("##INFO=<ID=SVTYPE,Number=1,Type=String,Description=\"Type of structural variant\">");
    parser.processLine("##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">");
    parser.processLine("##ALT=<ID=DEL,Description=\"Deletion\">");
    parser.processLine("##ALT=<ID=DEL:ME:ALU,Description=\"Deletion of ALU element\">");
    parser.processLine("##ALT=<ID=DEL:ME:L1,Description=\"Deletion of L1 element\">");
    parser.processLine("##ALT=<ID=DUP,Description=\"Duplication\">");
    parser.processLine("##ALT=<ID=DUP:TANDEM,Description=\"Tandem Duplication\">");
    parser.processLine("##ALT=<ID=INS,Description=\"Insertion of novel sequence\">");
    parser.processLine("##ALT=<ID=INS:ME:ALU,Description=\"Insertion of ALU element\">");
    parser.processLine("##ALT=<ID=INS:ME:L1,Description=\"Insertion of L1 element\">");
    parser.processLine("##ALT=<ID=INV,Description=\"Inversion\">");
    parser.processLine("##ALT=<ID=CNV,Description=\"Copy number variable region\">");
    parser.processLine("##ALT=<ID=ITX,Description=\"Intra-chromosomal translocation\">");
    parser.processLine("##ALT=<ID=CTX,Description=\"Inter-chromosomal translocation\">");
    parser.processLine("#CHROM  POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  test");
}
项目:c5    文件:MemStore.java   
/**
 * The passed snapshot was successfully persisted; it can be let go.
 * @param ss The snapshot to clean out.
 * @throws UnexpectedException
 * @see #snapshot()
 */
void clearSnapshot(final SortedSet<KeyValue> ss)
throws UnexpectedException {
  MemStoreLAB tmpAllocator = null;
  if (this.snapshot != ss) {
    throw new UnexpectedException("Current snapshot is " +
        this.snapshot + ", was passed " + ss);
  }
  // OK. Passed in snapshot is same as current snapshot.  If not-empty,
  // create a new snapshot and let the old one go.
  if (!ss.isEmpty()) {
    this.snapshot = new KeyValueSkipListSet(this.comparator);
    this.snapshotTimeRangeTracker = new TimeRangeTracker();
  }
  if (this.snapshotAllocator != null) {
    tmpAllocator = this.snapshotAllocator;
    this.snapshotAllocator = null;
  }
  if (tmpAllocator != null) {
    tmpAllocator.close();
  }
}
项目:openjdk-orb    文件:Util.java   
/**
 * Wraps an exception thrown by an implementation
 * method.  It returns the corresponding client-side exception.
 * @param orig the exception to wrap.
 * @return the wrapped exception.
 */
public RemoteException wrapException(Throwable orig)
{
    if (orig instanceof SystemException) {
        return mapSystemException((SystemException)orig);
    }

    if (orig instanceof Error) {
        return new ServerError("Error occurred in server thread",(Error)orig);
    } else if (orig instanceof RemoteException) {
        return new ServerException("RemoteException occurred in server thread",
                                   (Exception)orig);
    } else if (orig instanceof RuntimeException) {
        throw (RuntimeException) orig;
    }

    if (orig instanceof Exception)
        return new UnexpectedException( orig.toString(), (Exception)orig );
    else
        return new UnexpectedException( orig.toString());
}
项目:openjdk-orb    文件:ExceptionHandlerImpl.java   
public Exception readException( ApplicationException ae )
{
    // Note that the exception ID is present in both ae
    // and in the input stream from ae.  The exception
    // reader must actually read the exception ID from
    // the stream.
    InputStream is = (InputStream)ae.getInputStream() ;
    String excName = ae.getId() ;
    int index = findDeclaredException( excName ) ;
    if (index < 0) {
        excName = is.read_string() ;
        Exception res = new UnexpectedException( excName ) ;
        res.initCause( ae ) ;
        return res ;
    }

    return rws[index].read( is ) ;
}
项目:freeVM    文件:RemoteObjectInvocationHandler.java   
private Object invokeRemoteMethod(Object proxy, Method m, Object[] args)
        throws Throwable {
    try {
        return ref.invoke((Remote) proxy, m, args,
                RMIHash.getMethodHash(m));
    } catch (RuntimeException re) {
        throw re;
    } catch (Exception ex) {
        Method m1 = proxy.getClass().getMethod(m.getName(),
                m.getParameterTypes());
        Class[] declaredEx = m1.getExceptionTypes();

        for (int i = 0; i < declaredEx.length; ++i) {
            if (declaredEx[i].isAssignableFrom(ex.getClass())) {
                throw ex;
            }
        }
        // rmi.24=Unexpected exception
        throw new UnexpectedException(Messages.getString("rmi.24"), ex); //$NON-NLS-1$
    }
}
项目:freeVM    文件:RemoteObjectInvocationHandler.java   
private Object invokeRemoteMethod(Object proxy, Method m, Object[] args)
        throws Throwable {
    try {
        return ref.invoke((Remote) proxy, m, args,
                RMIHash.getMethodHash(m));
    } catch (RuntimeException re) {
        throw re;
    } catch (Exception ex) {
        Method m1 = proxy.getClass().getMethod(m.getName(),
                m.getParameterTypes());
        Class[] declaredEx = m1.getExceptionTypes();

        for (int i = 0; i < declaredEx.length; ++i) {
            if (declaredEx[i].isAssignableFrom(ex.getClass())) {
                throw ex;
            }
        }
        // rmi.24=Unexpected exception
        throw new UnexpectedException(Messages.getString("rmi.24"), ex); //$NON-NLS-1$
    }
}
项目:aegisthus    文件:AegisthusLoadCaster.java   
private long getNumber(byte[] arg0) throws Exception {
    byte[] by = hex.decode(arg0);
    ByteBuffer bb = ByteBuffer.allocate(by.length);
    bb.put(by);
    bb.position(0);
    switch(by.length) {
    case 1:
        return (long)bb.get();
    case 2:
        return (long)bb.getShort();
    case 4:
        return (long)bb.getInt();
    case 8:
        return (long)bb.getLong();
    }
    throw new UnexpectedException("couldn't determine datatype");
}
项目:openjdk-icedtea7    文件:Util.java   
/**
 * Wraps an exception thrown by an implementation
 * method.  It returns the corresponding client-side exception.
 * @param orig the exception to wrap.
 * @return the wrapped exception.
 */
public RemoteException wrapException(Throwable orig)
{
    if (orig instanceof SystemException) {
        return mapSystemException((SystemException)orig);
    }

    if (orig instanceof Error) {
        return new ServerError("Error occurred in server thread",(Error)orig);
    } else if (orig instanceof RemoteException) {
        return new ServerException("RemoteException occurred in server thread",
                                   (Exception)orig);
    } else if (orig instanceof RuntimeException) {
        throw (RuntimeException) orig;
    }

    if (orig instanceof Exception)
        return new UnexpectedException( orig.toString(), (Exception)orig );
    else
        return new UnexpectedException( orig.toString());
}
项目:openjdk-icedtea7    文件:ExceptionHandlerImpl.java   
public Exception readException( ApplicationException ae )
{
    // Note that the exception ID is present in both ae
    // and in the input stream from ae.  The exception
    // reader must actually read the exception ID from
    // the stream.
    InputStream is = (InputStream)ae.getInputStream() ;
    String excName = ae.getId() ;
    int index = findDeclaredException( excName ) ;
    if (index < 0) {
        excName = is.read_string() ;
        Exception res = new UnexpectedException( excName ) ;
        res.initCause( ae ) ;
        return res ;
    }

    return rws[index].read( is ) ;
}
项目:HBase-Research    文件:MemStore.java   
/**
 * The passed snapshot was successfully persisted; it can be let go.
 * @param ss The snapshot to clean out.
 * @throws UnexpectedException
 * @see {@link #snapshot()}
 */
void clearSnapshot(final SortedSet<KeyValue> ss)
throws UnexpectedException {
  this.lock.writeLock().lock();
  try {
    if (this.snapshot != ss) {
      throw new UnexpectedException("Current snapshot is " +
        this.snapshot + ", was passed " + ss);
    }
    // OK. Passed in snapshot is same as current snapshot.  If not-empty,
    // create a new snapshot and let the old one go.
    if (!ss.isEmpty()) {
      this.snapshot = new KeyValueSkipListSet(this.comparator);
      this.snapshotTimeRangeTracker = new TimeRangeTracker();
    }
  } finally {
    this.lock.writeLock().unlock();
  }
}
项目:hbase-0.94.8-qod    文件:MemStore.java   
/**
 * The passed snapshot was successfully persisted; it can be let go.
 * @param ss The snapshot to clean out.
 * @throws UnexpectedException
 * @see {@link #snapshot()}
 */
void clearSnapshot(final SortedSet<KeyValue> ss)
throws UnexpectedException {
  this.lock.writeLock().lock();
  try {
    if (this.snapshot != ss) {
      throw new UnexpectedException("Current snapshot is " +
        this.snapshot + ", was passed " + ss);
    }
    // OK. Passed in snapshot is same as current snapshot.  If not-empty,
    // create a new snapshot and let the old one go.
    if (!ss.isEmpty()) {
      this.snapshot = new KeyValueSkipListSet(this.comparator);
      this.snapshotTimeRangeTracker = new TimeRangeTracker();
    }
  } finally {
    this.lock.writeLock().unlock();
  }
}
项目:hbase-0.94.8-qod    文件:MemStore.java   
/**
 * The passed snapshot was successfully persisted; it can be let go.
 * @param ss The snapshot to clean out.
 * @throws UnexpectedException
 * @see {@link #snapshot()}
 */
void clearSnapshot(final SortedSet<KeyValue> ss)
throws UnexpectedException {
  this.lock.writeLock().lock();
  try {
    if (this.snapshot != ss) {
      throw new UnexpectedException("Current snapshot is " +
        this.snapshot + ", was passed " + ss);
    }
    // OK. Passed in snapshot is same as current snapshot.  If not-empty,
    // create a new snapshot and let the old one go.
    if (!ss.isEmpty()) {
      this.snapshot = new KeyValueSkipListSet(this.comparator);
      this.snapshotTimeRangeTracker = new TimeRangeTracker();
    }
  } finally {
    this.lock.writeLock().unlock();
  }
}
项目:DominoHBase    文件:MemStore.java   
/**
 * The passed snapshot was successfully persisted; it can be let go.
 * @param ss The snapshot to clean out.
 * @throws UnexpectedException
 * @see {@link #snapshot()}
 */
void clearSnapshot(final SortedSet<KeyValue> ss)
throws UnexpectedException {
  this.lock.writeLock().lock();
  try {
    if (this.snapshot != ss) {
      throw new UnexpectedException("Current snapshot is " +
        this.snapshot + ", was passed " + ss);
    }
    // OK. Passed in snapshot is same as current snapshot.  If not-empty,
    // create a new snapshot and let the old one go.
    if (!ss.isEmpty()) {
      this.snapshot = new KeyValueSkipListSet(this.comparator);
      this.snapshotTimeRangeTracker = new TimeRangeTracker();
    }
  } finally {
    this.lock.writeLock().unlock();
  }
}
项目:hindex    文件:MemStore.java   
/**
 * The passed snapshot was successfully persisted; it can be let go.
 * @param ss The snapshot to clean out.
 * @throws UnexpectedException
 * @see {@link #snapshot()}
 */
void clearSnapshot(final SortedSet<KeyValue> ss)
throws UnexpectedException {
  this.lock.writeLock().lock();
  try {
    if (this.snapshot != ss) {
      throw new UnexpectedException("Current snapshot is " +
        this.snapshot + ", was passed " + ss);
    }
    // OK. Passed in snapshot is same as current snapshot.  If not-empty,
    // create a new snapshot and let the old one go.
    if (!ss.isEmpty()) {
      this.snapshot = new KeyValueSkipListSet(this.comparator);
      this.snapshotTimeRangeTracker = new TimeRangeTracker();
    }
  } finally {
    this.lock.writeLock().unlock();
  }
}
项目:LCIndex-HBase-0.94.16    文件:MemStore.java   
/**
 * The passed snapshot was successfully persisted; it can be let go.
 * @param ss The snapshot to clean out.
 * @throws UnexpectedException
 * @see {@link #snapshot()}
 */
void clearSnapshot(final SortedSet<KeyValue> ss)
throws UnexpectedException {
  if (this.snapshot != ss) {
    throw new UnexpectedException("Current snapshot is " +
      this.snapshot + ", was passed " + ss);
  }
  // OK. Passed in snapshot is same as current snapshot.  If not-empty,
  // create a new snapshot and let the old one go.
  if (!ss.isEmpty()) {
    this.snapshot = new KeyValueSkipListSet(this.comparator);
    this.snapshotTimeRangeTracker = new TimeRangeTracker();
  }
}
项目:LCIndex-HBase-0.94.16    文件:TestMemStore.java   
private long runSnapshot(final MemStore hmc) throws UnexpectedException {
  // Save off old state.
  int oldHistorySize = hmc.getSnapshot().size();
  hmc.snapshot();
  KeyValueSkipListSet ss = hmc.getSnapshot();
  // Make some assertions about what just happened.
  assertTrue("History size has not increased", oldHistorySize < ss.size());
  long t = memstore.timeOfOldestEdit();
  assertTrue("Time of oldest edit is not Long.MAX_VALUE", t == Long.MAX_VALUE);
  hmc.clearSnapshot(ss);
  return t;
}
项目:HIndex    文件:TestMemStore.java   
private long runSnapshot(final MemStore hmc) throws UnexpectedException {
  // Save off old state.
  int oldHistorySize = hmc.getSnapshot().size();
  hmc.snapshot();
  KeyValueSkipListSet ss = hmc.getSnapshot();
  // Make some assertions about what just happened.
  assertTrue("History size has not increased", oldHistorySize < ss.size());
  long t = memstore.timeOfOldestEdit();
  assertTrue("Time of oldest edit is not Long.MAX_VALUE", t == Long.MAX_VALUE);
  hmc.clearSnapshot(ss);
  return t;
}