本文整理汇总了Java中org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor.setDomain方法的典型用法代码示例。如果您正苦于以下问题:Java DomainFilterInterceptor.setDomain方法的具体用法?Java DomainFilterInterceptor.setDomain怎么用?Java DomainFilterInterceptor.setDomain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor
的用法示例。
在下文中一共展示了DomainFilterInterceptor.setDomain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRandomDomain
import org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor; //导入方法依赖的package包/类
/**
* Configures a set of channels to use a random domain. Use to ensure that
* multiple instance of the test suite do not interfere when running on the
* same machine. This may happen in a CI system or when a developer is
* running tests for multiple branches in parallel.
*/
public static void addRandomDomain(ManagedChannel[] channels) {
if (channels == null) {
return;
}
byte[] domain = UUIDGenerator.randomUUID(false);
for (ManagedChannel channel : channels) {
channel.getMembershipService().setDomain(domain);
DomainFilterInterceptor filter = new DomainFilterInterceptor();
filter.setDomain(domain);
channel.addInterceptor(filter);
}
}
示例2: addInterceptors
import org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor; //导入方法依赖的package包/类
public void addInterceptors(Channel channel) {
DomainFilterInterceptor dfi = new DomainFilterInterceptor();
dfi.setOptionFlag(TribesConstants.MEMBERSHIP_MSG_OPTION);
dfi.setDomain(domain);
channel.addInterceptor(dfi);
if (log.isDebugEnabled()) {
log.debug("Added Domain Filter Interceptor");
}
}