1 24 25 package org.objectweb.dream.protocol.utobcast; 26 27 import org.objectweb.dream.AbstractComponent; 28 import org.objectweb.dream.Pull; 29 import org.objectweb.dream.Push; 30 import org.objectweb.dream.message.manager.MessageManager; 31 import org.objectweb.fractal.api.NoSuchInterfaceException; 32 import org.objectweb.fractal.api.control.IllegalBindingException; 33 import org.objectweb.fractal.api.control.IllegalLifeCycleException; 34 35 40 public class BackupElectionImpl extends AbstractComponent 41 implements 42 BackupElection 43 { 44 45 49 53 public static final String PENDING_MESSAGES_OUT_ITF_NAME = "pending-messages-out"; 54 55 59 protected Pull pendingMessagesOutItf; 60 61 62 protected Push outPushItf; 63 64 65 protected ProcessMembership processMembershipItf; 66 67 68 protected SequenceNumber sequenceNumberItf; 69 70 71 protected MessageManager messageManagerItf; 72 73 77 80 public BackupElectionImpl() 81 { 82 } 83 84 88 91 public void elect() 92 { 93 95 } 96 97 101 105 public void bindFc(String clientItfName, Object serverItf) 106 throws NoSuchInterfaceException, IllegalBindingException, 107 IllegalLifeCycleException 108 { 109 super.bindFc(clientItfName, serverItf); 110 if (clientItfName.equals(PENDING_MESSAGES_OUT_ITF_NAME)) 111 { 112 pendingMessagesOutItf = (Pull) serverItf; 113 } 114 else if (clientItfName.equals(Push.OUT_PUSH_ITF_NAME)) 115 { 116 outPushItf = (Push) serverItf; 117 } 118 else if (clientItfName.equals(SequenceNumber.ITF_NAME)) 119 { 120 sequenceNumberItf = (SequenceNumber) serverItf; 121 } 122 else if (clientItfName.equals(ProcessMembership.ITF_NAME)) 123 { 124 processMembershipItf = (ProcessMembership) serverItf; 125 } 126 else if (clientItfName.equals(MessageManager.ITF_NAME)) 127 { 128 messageManagerItf = (MessageManager) serverItf; 129 } 130 } 131 132 135 public String [] listFc() 136 { 137 return new String []{PENDING_MESSAGES_OUT_ITF_NAME, SequenceNumber.ITF_NAME, 138 Push.OUT_PUSH_ITF_NAME, ProcessMembership.ITF_NAME, 139 MessageManager.ITF_NAME}; 140 } 141 142 } | Popular Tags |