/** * This is called by the container after it has called refresh * * @param ejbID * the ejbID that uniquely identifies the container * @param pk * The primary key of the bean(s) that is to be refreshed */ public void notifyRefresh(long ejbID, byte[] pk) { int size = pk.length; byte[] payload = new byte[size + 8]; Logger _logger = ejbContainerUtil.getLogger(); longToBytes(ejbID, payload, 0); System.arraycopy(pk, 0, payload, 8, size); try { gms.getGroupHandle().sendMessage(GMS_READ_ONLY_COMPONENT_NAME, payload); _logger.log(Level.WARNING, "ReadOnlyBeanMessageCallBack: " + " Sent message for ejbID: " + ejbID); } catch (Exception ex) { _logger.log(Level.WARNING, "ReadOnlyBeanMessageCallBack: " + "Got exception during notifyRefresh", ex); } }
/** * Find records of not finished delegated recovery in the recovery lock file on * this path and recorded before specified timestamp, and do delegated recovery if such record exists */ String finishDelegatedRecovery(String logdir, long timestamp) { String delegatedLogDir = null; String instance = fence.getInstanceRecoveredFor(logdir, timestamp); if (_logger.isLoggable(Level.INFO)) { _logger.log(Level.INFO, "[GMSCallBack] Instance " + instance + " need to finish delegated recovering"); } if (instance != null) { DistributedStateCache dsc=gms.getGroupHandle().getDistributedStateCache(); Map<Serializable, Serializable> memberDetails = dsc.getFromCacheForPattern(MEMBER_DETAILS, instance ); delegatedLogDir = (String)memberDetails.get(TXLOGLOCATION); if (_logger.isLoggable(Level.INFO)) { _logger.log(Level.INFO, "[GMSCallBack] Tx log dir for instance " + instance + " is " + delegatedLogDir); } doRecovery(delegatedLogDir, instance, timestamp); } return delegatedLogDir; }
/** * This is called by the container after it has called refresh * * @param ejbID * the ejbID that uniquely identifies the container * @param pk * The primary key of the bean(s) that is to be refreshed */ public void notifyRefreshAll(long ejbID) { byte[] payload = new byte[8]; Logger _logger = ejbContainerUtil.getLogger(); longToBytes(ejbID, payload, 0); try { gms.getGroupHandle().sendMessage(GMS_READ_ONLY_COMPONENT_NAME, payload); } catch (Exception ex) { _logger.log(Level.WARNING, "ReadOnlyBeanMessageCallBack: " + "Got exception during notifyRefreshAll", ex); } }
try { byte[] message = new byte[] {}; gms.getGroupHandle().sendMessage(groupName, message); } catch (GMSException e) { Logger.getAnonymousLogger().severe(e.getMessage());
private synchronized void checkAndNotifyAboutCurrentAndPreviousMembers(String memberName, boolean isJoinEvent, boolean triggeredByGMS) { SortedSet<String> currentAliveAndReadyMembers = gms.getGroupHandle().getCurrentAliveAndReadyCoreView().getMembers(); AliveAndReadyView aView = gms.getGroupHandle().getPreviousAliveAndReadyCoreView(); SortedSet<String> previousAliveAndReadyMembers = new TreeSet<String>();
this.groupHandle = gms.getGroupHandle(); this.myName = myName; this.groupName = groupName;
List<String> startedGMSMembers = gms.getGroupHandle().getCurrentCoreMembers(); if (startedGMSMembers.size() == 0) { try {
List<String> startedGMSMembers = gms.getGroupHandle().getCurrentCoreMembers(); if (startedGMSMembers.size() > 0) { try {