本文整理汇总了Java中org.jgroups.MembershipListener类的典型用法代码示例。如果您正苦于以下问题:Java MembershipListener类的具体用法?Java MembershipListener怎么用?Java MembershipListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MembershipListener类属于org.jgroups包,在下文中一共展示了MembershipListener类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: start
import org.jgroups.MembershipListener; //导入依赖的package包/类
@ManagedOperation
public void start() throws Exception {
hash_function=new ConsistentHashFunction<>();
addMembershipListener((MembershipListener)hash_function);
ch=new JChannel(props);
disp=new RpcDispatcher(ch, null, this, this);
RpcDispatcher.Marshaller marshaller=new CustomMarshaller();
disp.setRequestMarshaller(marshaller);
disp.setResponseMarshaller(marshaller);
disp.setMethodLookup(new MethodLookup() {
public Method findMethod(short id) {
return methods.get(id);
}
});
ch.connect(cluster_name);
local_addr=ch.getAddress();
view=ch.getView();
}
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:20,代码来源:PartitionedHashMap.java
示例2: viewAccepted
import org.jgroups.MembershipListener; //导入依赖的package包/类
public void viewAccepted(final View new_view) {
final List<Address> old_nodes=this.view != null? new ArrayList<>(this.view.getMembers()) : null;
this.view=new_view;
if(log.isDebugEnabled())
log.debug("new view: " + new_view);
if(hash_function != null)
hash_function.installNodes(new_view.getMembers());
for(MembershipListener l: membership_listeners)
l.viewAccepted(new_view);
if(old_nodes != null) {
timer.schedule(new Runnable() {
public void run() {
rebalance(old_nodes, new ArrayList<>(new_view.getMembers()));
}
}, 100, TimeUnit.MILLISECONDS);
}
}
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:22,代码来源:ReplCache.java
示例3: viewAccepted
import org.jgroups.MembershipListener; //导入依赖的package包/类
public void viewAccepted(View new_view) {
System.out.println("view = " + new_view);
this.view=new_view;
for(MembershipListener l: membership_listeners) {
l.viewAccepted(new_view);
}
if(migrate_data) {
migrateData();
}
}
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:12,代码来源:PartitionedHashMap.java
示例4: ReplicatorRpcDispatcher
import org.jgroups.MembershipListener; //导入依赖的package包/类
private ReplicatorRpcDispatcher(Channel channel, MessageListener l,
MembershipListener l2, Object serverObj, S object,
HashMap<Method, Short> methodMap, ArrayList<Method> methodList) {
super(channel, l, l2, serverObj);
this.object = object;
this.methodMap = methodMap;
this.methodList = methodList;
setMarshaller(new ContextAwareMarshaller(getClass().getClassLoader()));
}
开发者ID:kenweezy,项目名称:teiid,代码行数:10,代码来源:JGroupsObjectReplicator.java
示例5: addMembershipListener
import org.jgroups.MembershipListener; //导入依赖的package包/类
public void addMembershipListener(MembershipListener l) {
membership_listeners.add(l);
}
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:4,代码来源:PartitionedHashMap.java
示例6: removeMembershipListener
import org.jgroups.MembershipListener; //导入依赖的package包/类
public void removeMembershipListener(MembershipListener l) {
membership_listeners.remove(l);
}
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:4,代码来源:PartitionedHashMap.java
注:本文中的org.jgroups.MembershipListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论