引用队列是垃圾收集器向应用程序返回关于对象生命周期的信息的主要方法。
Reference queues are the garbage collector's primary means of feeding back information to the application about object lifecycle.
弱引用有两个构造函数:一个只取referent作为参数,另一个还取引用队列作为参数。
Weak references have two constructors: one takes only the referent as an argument and the other also takes a reference queue.
引用队列,在检测到适当的可访问性变化后,通过垃圾收集器将已注册的引用对象加入。
Reference queues, to which registered reference objects are appended by the garbage collector after the appropriate reachability changes are detected.
如果有一种方法可以在弱引用的referent被垃圾收集时发出通知就好了,这就是引用队列的作用。
It would be nice if there was a way to be notified when the referent of a weak reference is garbage collected, and that is what reference queues are for.
正如弱引用一样,软引用也可创建为具有一个相关的引用队列,引用在被垃圾收集器清除时进入队列。
Just as with weak references, a soft reference can be created with an associated reference queue, and the reference is enqueued when it is cleared by the garbage collector.
引用队列对于软引用来说,没有对弱引用那么有用,但是它们可以用于发出管理警报,说明应用程序开始缺少内存。
Reference queues are not as useful with soft references as with weak references, but they could be used to raise a management alert that the application is starting to run low on memory.
当检测到相应的可达性发生改变后,垃圾回收器就会将注册有此队列的引用对象添加到这个引用队列中。
Reference queues, to which registered reference objects are appended by the garbage collector after the appropriate reachability changes are detected.
这个补丁通过把已缓存的引用从一个序列号转换为指向队列中最高的包(过去已经选择性应答)的指针从而对此情况加以优化。
The patch optimizes this case by converting the cached reference from a sequence number to a pointer to the highest packet in the queue that has been SACKed in the past.
这两个名称,一个用于连接工厂,一个用于实际队列,在客户端应用程序部署描述符中利用资源引用它们被束缚起来。
Both names, one for the connection factory and one for the actual queue, are bound using resource references in the client application deployment descriptor.
为了允许mdb发送响应,包含该MDB的EJB模块的部署描述符必须定义对连接工厂和应答队列的资源引用。
To allow the MDB to send the response, the deployment descriptor for the EJB module containing the MDB must define resource references for the connection factory and reply queue.
由于引用被连接到一个包含JMS绑定的SCA导入,因此消息被SCA基础设施写入到底层jms队列,如清单4所示。
Since the reference is wired to an SCA import with a JMS binding, the message is written to the underlying JMS queue by the SCA infrastructure, as shown in Listing 4.
每当引用一个队列管理器类型时,您必须在对应的WMQFTE属性文件中配置ssl,以便相关类型的WMQFTE实体能够连接到它的队列管理器。
In each case where a queue manager type is referenced, you must configure SSL in the corresponding WMQFTE properties file to enable that type of WMQFTE entity to connect to its queue manager.
MDB的部署描述符包含对JMS激活规范(它与我们前面创建的 JMS队列依次联合)的引用,如图7 所示。
The deployment descriptor for the MDB contains a reference to the JMS activation spec (which in turn is associated with the JMS queue we created earlier), as shown in Figure 7.
最后,每个virtqueue对象引用virtqueue_ops对象,后者定义处理hypervisor的驱动程序的底层队列操作。
Finally, each virtqueue object references the virtqueue_ops object, which defines the underlying queue operations for dealing with the hypervisor driver.
您将在web . xml中定义对连接工厂和队列的名称引用,如清单10所示。
You define the name reference to the connection factory and queue in web.xml, as shown in listing 10.
为此,我们必须将示例应用程序的每个模块中的资源环境项引用映射到不同的jms队列。
To do this, we must map the resource environment entry reference in each module of the sample application to a different JMS queue. To do this.
客户端部署描述符,在一个称为application-client.xml的文件中,包含对用于上述代码中JMS连接工厂和队列中JNDI名称的引用。
The client deployment descriptor, in a file called application-client.xml, contains references to the JNDI names of the JMS connection factory and queue that are used in the above code.
请注意该方法如何用do -while循环来处理队列中可能存在的弱引用。
Notice how this method accounts for possible weak references in the queue with the do-while loop.
队列目标引用的定义位于JMSDestinations选项卡下面。
The definition of the queue destination references is under the JMS Destinations TAB.
表4显示消息队列框架引用实现包中所包含的类的描述。
The description of the classes contained in the message queue framework reference implementation package is shown in Table 4.
提供的样本jms客户机应用程序要求定义一个Queue对象,该对象引用目标队列管理器上一个已经存在的队列。
The supplied sample JMS Client application expects a queue object to be defined, which references an existing queue on the target queue manager.
两个名称(一个用于连接工厂,另一个用于实际队列)都使用客户机应用程序部署描述符中的资源引用进行绑定。
Both names (one for the connection factory and one for the actual queue) are bound using resource references in the client application deployment descriptor.
此处输入的队列管理器名称是一个虚拟队列管理器名称,WebSphere MQ使用这个名称来引用此消息传递引擎。
The queue manager name entered here is the virtual queue manager name by which WebSphere MQ knows this messaging engine.
如果已经分配了最低数量的对象,则对象的弱引用被放置到队列中。
If the minimum number of objects is already allocated, then a weak reference to the object is enqueued.
消息队列框架分为两部分:消息队列框架接口包和消息队列框架引用实现包,如图7 所示。
The message queue framework is divided into two parts: a message queue framework interface package and a message queue framework reference implementation package, as shown in Figure 7.
从队列中删除下一个引用对象,阻塞直到有一个可用。
Removes the next reference object in this queue, blocking until one becomes available.
从队列中删除下一个引用对象,阻塞直到有一个可用或给定超时期满。
Removes the next reference object in this queue, blocking until either one becomes available or the given timeout period expires.
包含该Servlet的Web模块的部署描述符必须定义对连接工厂和请求队列及响应队列的资源引用。
The deployment descriptor for the Web module containing the servlet must define resource references for the connection factory and both the request and reply queues.
同样,队列的远程定义不能被称为是真实的WebSpheremq队列名称,这是由于该引用不存在于网关队列管理器中。
Also, the remote definition of the queue can not be called the real WebSphere MQ queue name as that reference does not exist on the gateway queue manager.
同样,队列的远程定义不能被称为是真实的WebSpheremq队列名称,这是由于该引用不存在于网关队列管理器中。
Also, the remote definition of the queue can not be called the real WebSphere MQ queue name as that reference does not exist on the gateway queue manager.
应用推荐