/** * Create or update a profile for a remote counterpart. * @param profile * the profile, referenced by this advisor after this method returns. */ public boolean putProfile(Profile profile) { return putProfile(profile, false); }
/** * Create or update a profile for a remote counterpart. * @param profile * the profile, referenced by this advisor after this method returns. */ public boolean putProfile(Profile profile) { return putProfile(profile, false); }
@Override public void process(DistributionMessage msg) { try { if (msg instanceof ProfilesReplyMessage) { ProfilesReplyMessage reply = (ProfilesReplyMessage)msg; if (reply.profiles != null) { for (int i=0; i < reply.profiles.length; i++) { // @todo Add putProfiles to DistributionAdvisor to do this // with one call atomically? UpdateAttributesProcessor.this.advisee. getDistributionAdvisor().putProfile(reply.profiles[i]); } } } else if (msg instanceof ProfileReplyMessage) { ProfileReplyMessage reply = (ProfileReplyMessage)msg; if (reply.profile != null) { UpdateAttributesProcessor.this.advisee. getDistributionAdvisor().putProfile(reply.profile); } } } finally { super.process(msg); } } }
@Override public void process(DistributionMessage msg) { try { if (msg instanceof ProfilesReplyMessage) { ProfilesReplyMessage reply = (ProfilesReplyMessage)msg; if (reply.profiles != null) { for (int i=0; i < reply.profiles.length; i++) { // @todo Add putProfiles to DistributionAdvisor to do this // with one call atomically? UpdateAttributesProcessor.this.advisee. getDistributionAdvisor().putProfile(reply.profiles[i]); } } } // msg can be a ReplyMessage in case of unexpected exceptions else if (msg instanceof ProfileReplyMessage) { ProfileReplyMessage reply = (ProfileReplyMessage)msg; if (reply.profile != null) { UpdateAttributesProcessor.this.advisee. getDistributionAdvisor().putProfile(reply.profile); } } } finally { super.process(msg); } } }
/** * Attempts to process this message with the specified * {@link DistributionAdvisee}. Also if exchange profiles then add the * profile from {@link DistributionAdvisee} to reply. * * @param advisee * the CacheDistributionAdvisee to apply this profile to * @param removeProfile * true to remove profile else add profile * @param exchangeProfiles * true to add the profile to reply */ protected final void handleDistributionAdvisee(DistributionAdvisee advisee, boolean removeProfile, boolean exchangeProfiles, final List<Profile> replyProfiles) { final DistributionAdvisor da; if (advisee != null && (da = advisee.getDistributionAdvisor()) != null) { if (removeProfile) { da.removeProfile(this, false); } else { da.putProfile(this); } if (exchangeProfiles) { // assume non-null replyProfiles when exchangeProfiles is true replyProfiles.add(advisee.getProfile()); } } }
/** * Attempts to process this message with the specified * {@link DistributionAdvisee}. Also if exchange profiles then add the * profile from {@link DistributionAdvisee} to reply. * * @param advisee * the CacheDistributionAdvisee to apply this profile to * @param removeProfile * true to remove profile else add profile * @param exchangeProfiles * true to add the profile to reply */ protected final void handleDistributionAdvisee(DistributionAdvisee advisee, boolean removeProfile, boolean exchangeProfiles, final List<Profile> replyProfiles) { final DistributionAdvisor da; if (advisee != null && (da = advisee.getDistributionAdvisor()) != null) { if (removeProfile) { da.removeProfile(this, false); } else { da.putProfile(this); } if (exchangeProfiles) { // assume non-null replyProfiles when exchangeProfiles is true replyProfiles.add(advisee.getProfile()); } } }
advisor.putProfile(profile); profileList.add(profile);
/** * Tell everyone else who we are and find out who they are. */ @Override public final void handshake() { super.handshake(); // also inform local SQLFabric advisor if any final GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); final DistributionAdvisee sqlfAdvisee; final DistributionAdvisor sqlfAdvisor; GridProfile profile = (GridProfile) createProfile(); if (cache != null && (sqlfAdvisee = cache.getSqlfAdvisee()) != null && (sqlfAdvisor = sqlfAdvisee.getDistributionAdvisor()) != null) { sqlfAdvisor.putProfile(profile); } }
/** * Tell everyone else who we are and find out who they are. */ @Override public final void handshake() { super.handshake(); // also inform local GemFireXD advisor if any final GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); final DistributionAdvisee gfxdAdvisee; final DistributionAdvisor gfxdAdvisor; GridProfile profile = (GridProfile) createProfile(); if (cache != null && (gfxdAdvisee = cache.getGfxdAdvisee()) != null && (gfxdAdvisor = gfxdAdvisee.getDistributionAdvisor()) != null) { gfxdAdvisor.putProfile(profile); } }
cda.getDistributionAdvisor().putProfile(this.profile);
cda.getDistributionAdvisor().putProfile(this.profile);