[hornetq-commits] JBoss hornetq SVN: r9202 - branches/HnetQ_323_cn/docs/user-manual/zh.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu May 6 04:19:30 EDT 2010
Author: gaohoward
Date: 2010-05-06 04:19:30 -0400 (Thu, 06 May 2010)
New Revision: 9202
Modified:
branches/HnetQ_323_cn/docs/user-manual/zh/intercepting-operations.xml
Log:
done
Modified: branches/HnetQ_323_cn/docs/user-manual/zh/intercepting-operations.xml
===================================================================
--- branches/HnetQ_323_cn/docs/user-manual/zh/intercepting-operations.xml 2010-05-06 07:19:38 UTC (rev 9201)
+++ branches/HnetQ_323_cn/docs/user-manual/zh/intercepting-operations.xml 2010-05-06 08:19:30 UTC (rev 9202)
@@ -19,14 +19,13 @@
<!-- ============================================================================= -->
<chapter id="intercepting-operations">
- <title>Intercepting Operations</title>
- <para>HornetQ supports <emphasis>interceptors</emphasis> to intercept packets entering
- the server. Any supplied interceptors would be called for any packet entering
- the server, this allows custom code to be executed, e.g. for auditing packets,
- filtering or other reasons. Interceptors can change the packets they intercept.</para>
+ <title>拦截操作</title>
+ <para>HornetQ支持<emphasis>拦截器</emphasis>。拦截器可以拦截进入服务器的数据包。每进入服务器
+ 一个数据包,拦截器就被调用一次,允许一些特殊和处理,例如对包的审计、过滤等。拦截器可以对数据包
+ 进行改动。</para>
<section>
- <title>Implementing The Interceptors</title>
- <para>A interceptor must implement the <literal>Interceptor interface</literal>:</para>
+ <title>实现拦截器</title>
+ <para>拦截器必须要实现<literal>Interceptor接口</literal>:</para>
<programlisting>
package org.hornetq.api.core.interceptor;
@@ -36,41 +35,37 @@
throws HornetQException;
}
</programlisting>
- <para>The returned boolean value is important:</para>
+ <para>它的方法的返回值是很重要的:</para>
<itemizedlist>
<listitem>
- <para>if <literal>true</literal> is returned, the process continues normally</para>
+ <para>如果返回<literal>true</literal>,处理正常进行下去。</para>
</listitem>
<listitem>
- <para>if <literal>false</literal> is returned, the process is aborted, no other
- interceptors will be called and the packet will not be handled by the server at
- all.</para>
+ <para>如果返回<literal>false</literal>,则处理被中断,其它的拦截器将不会被调用,数据包将不会
+ 被服务器所处理。</para>
</listitem>
</itemizedlist>
</section>
<section>
- <title>Configuring The Interceptors</title>
- <para>The interceptors are configured in <literal>hornetq-configuration.xml</literal>:</para>
+ <title>配置拦截器</title>
+ <para>拦截器的配置在<literal>hornetq-configuration.xml</literal>文件中:</para>
<programlisting>
<remoting-interceptors>
<class-name>org.hornetq.jms.example.LoginInterceptor</class-name>
<class-name>org.hornetq.jms.example.AdditionalPropertyInterceptor</class-name>
</remoting-interceptors>
</programlisting>
- <para>The interceptors classes (and their dependencies) must be added to the server classpath
- to be properly instantiated and called.</para>
+ <para>拦截器的类(以及它们依赖的类)必须要在服务器的classpath中,否则不能被正常初始化及调用。</para>
</section>
<section>
- <title>Interceptors on the Client Side</title>
- <para>The interceptors can also be run on the client side to intercept packets
- <emphasis>sent by the server</emphasis> by adding the interceptor to the <code>ClientSessionFactory</code>
- with the <code>addInterceptor()</code> method.</para>
- <para>The interceptors classes (and their dependencies) must be added to the client classpath
- to be properly instantiated and called from the client side.</para>
+ <title>客户端拦截器</title>
+ <para>在客户端也可以有拦截器来拦截<emphasis>来自服务器</emphasis>的数据包。<code>ClientSessionFactory</code>
+ 的<code>addInterceptor()</code>方法可以用来添加拦截器。</para>
+ <para>同样拦截器的类(以及它们依赖的类)必须要在客户端的classpath中,否则它们不能被正常初始化及调用。</para>
</section>
<section>
- <title>Example</title>
- <para>See <xref linkend="examples.interceptor" /> for an example which
- shows how to use interceptors to add properties to a message on the server.</para>
+ <title>例子</title>
+ <para>参见<xref linkend="examples.interceptor" />。这个例子中展示了如何使用拦截器向发往服务器的消息中
+ 添加属性。</para>
</section>
</chapter>
More information about the hornetq-commits
mailing list