如果允许日志记录和异常处理类有多个实例则会更好。
It would have been better to allow multiple instances of logging and exception-handling classes.
例如,可以在回调基类中实现错误处理方法,让所有回调都可以使用它,从而确保以一致的方式处理所有远程服务异常。
For example, an error handling method can be implemented in a callback base class so that it can be used by all callbacks to ensure all remote service exceptions will be handled consistently.
处理该问题的另一种方法是:只要泛型类的运行时实例化没有包括所需构造函数,就抛出异常。
Another way of handling this problem would be to throw an exception whenever a run-time instantiation of the generic class does not include a needed constructor.
由于异常通常难以快速处理,所以加载额外的类的附加开销可能使操作延迟超出重要阈值。
Because exceptions are rarely quick to process, the additional overhead of loading extra classes may push operation latency above a critical threshold.
本文还包括有关JMS 1.1中的统一域类、异常处理、传输绑定和其他最佳实践等信息。
Also included with this article are additional sections on the unified domain classes in JMS 1.1, exception handling, transport bindings, and other best practices.
这意味着,如果在处理参数时执行验证,可以通过抛出异常预防类被终结。
This means that if you do your validation while processing the parameters, you can - by throwing an exception - prevent your class from being finalized.
假定对应用程序中的所有类有统一的异常处理。
Let's say that you wanted consistent exception handling for all of the classes in your application.
已检查异常继承自exception类并用于处理可恢复性出错诸如业务出错场景。
Checked exceptions inherit from exception class and are used to handle recoverable errors such as business error scenarios.
在Tiger之前,ThreadGroup类提供了一种处理未捕获异常的方法: ThreadGroup的uncaughtException()方法。
Prior to Tiger, the ThreadGroup class provided one way to handle uncaught exceptions: the uncaughtException() method of ThreadGroup.
清单3展示了action类是如何处理异常的。
使用MessageDigest类对字节数组进行哈希,处理相关异常,如清单12所示。
Use the MessageDigest class to hash the byte array, dealing with the appropriate exceptions, as shown in Listing 12 below.
处理程序使用了一个支持类LoggingWindow ,该类将异常显示在屏幕上。
The handler uses a support class LoggingWindow, which puts the exception up on the screen.
在这个类中,定义服务器操作完成时客户机页面如何处理数据(或异常)。
In this class, you define what the client page does with the data (or the exception) when the server is done.
这个异常属性指明了当发生这个异常时被调用来处理这个异常的类。
The handler attribute specifies the class which is asked to handle this exception when it occurs.
对于SAX和DOM工厂类,一个异常处理已请求的但不受支持的特性,另一个异常处理实例化错误。
As with the SAX and DOM factory classes, one exception handles requested — but unsupported — features, and another exception handles instantiation errors.
在DAO实现类中如何处理异常?
How will exceptions be handled within the DAO implementation class?
未检查异常作为运行时exception类是理想的异常侯选处理不可恢复性出错,如资源不可用或者空指针。
Unchecked exceptions which are descendents of RuntimeException class are the ideal candidate exceptions handle non-recoverable errors such as resource non-availability or some null Pointers.
为了使抵押计算器具有友好的用户界面,我将在最初的MortgageCalculator类中加入异常(处理)。
To make the Mortgage Calculator user-friendly, I put an exception in the original MortgageCalculator class.
AspectJ中典型的joinpoint包括方法调用、对类成员的访问以及异常处理程序块的执行。
Typical join points in AspectJ include method calls, access to class members, and the execution of exception handler blocks.
传统的异常处理过程在每个action类中保存异常信息,而最佳实践4则在处理异常时避免冗余代码。
While conventional exception handling procedures save exception information in every Action class, best practice 4 aims to avoid redundant code while handling exceptions.
处理这些异常的重担落在方法的消费者mailutilities类身上,稍后我们将介绍这个类。
The onus of handling these exceptions is left up to the consumer of the method, the MailUtilities class, which we cover shortly.
所有自定义JMS数据绑定都具有一个称为AbstractJMSDataBindingImpl的公共超类,这个类实现了一些公共的功能,比如,进行异常处理的方法。
All the custom JMS data bindings have a common super class, called AbstractJMSDataBindingImpl, which implements some common functionality; for example, methods for exception handling.
在本系列的第1部分中,第一步是导入ApachePOI以及异常和文件处理类(参见参考资料中到第1部分的链接)。
In Part 1 of this series, your first step is to import Apache POI along with exception and file-handling classes (see Resources for the link to Part 1).
例如,清单3在ZipMap类中创建了一个函数,通过给定的ZIP代码查找城市名称(为了简便起见,省略了错误和异常处理)。
For example, Listing 3 creates a function in the ZipMap class that looks up the name of a city given its ZIP code (error and exception-handling code are ommitted for brevity).
sqlwarning类继承自sqlexception类;但是SQL警告不如SQL异常那么严重,所以更好的方法是分别处理它们。
The SQLWarning class inherits from the SQLException class; however, a SQL warning is less severe than an SQL exception, so it's better to handle them separately.
原始类接口的方法实现被用来执行该类自身的失败方法的异常处理。
The method implementations of the original class interface are used to perform the exception handling for the failed methods in the class itself.
在公共模块中实现了系统通用的日志管理,异常处理,常用类库方法等。
The public module implements a generic system log management, exception handling, common library methods.
除这些类之外,此命名空间中还包含多个必需的类,用于处理工作流事件队列和工作流运行时引擎引发的异常。
In addition to these classes, several classes having to do with workflow event queues and with exceptions thrown by the workflow runtime engine are contained in this namespace.
除这些类之外,此命名空间中还包含多个必需的类,用于处理工作流事件队列和工作流运行时引擎引发的异常。
In addition to these classes, several classes having to do with workflow event queues and with exceptions thrown by the workflow runtime engine are contained in this namespace.
应用推荐