public TopologyMember(final TransportConfiguration a, final TransportConfiguration b) { this(new Pair<TransportConfiguration, TransportConfiguration>(a, b)); }
public TopologyMemberImpl(String nodeId, final String nodeName, final TransportConfiguration a, final TransportConfiguration b) { this.nodeId = nodeId; this.nodeName = nodeName; this.connector = new Pair<TransportConfiguration, TransportConfiguration>(a, b); uniqueEventID = System.currentTimeMillis(); }
public void loadInc(long id, int add) { if (loadList == null) { loadList = new LinkedList<Pair<Long, Integer>>(); } loadList.add(new Pair<Long, Integer>(id, add)); }
public void loadInc(long id, int add) { if (loadList == null) { loadList = new LinkedList<Pair<Long, Integer>>(); } loadList.add(new Pair<Long, Integer>(id, add)); }
@Override public synchronized void unregisterDeployer(final Deployer deployer) throws Exception { if (deployers.remove(deployer)) { String[] filenames = deployer.getConfigFileNames(); for (String filename : filenames) { Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources(filename); while (urls.hasMoreElements()) { URI url = urls.nextElement().toURI(); Pair<URI, Deployer> pair = new Pair<URI, Deployer>(url, deployer); deployed.remove(pair); } } } }
public synchronized void unregisterDeployer(final Deployer deployer) throws Exception { if (deployers.remove(deployer)) { String[] filenames = deployer.getConfigFileNames(); for (String filename : filenames) { Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources(filename); while (urls.hasMoreElements()) { URL url = urls.nextElement(); Pair<URL, Deployer> pair = new Pair<URL, Deployer>(url, deployer); deployed.remove(pair); } } } }
void addUpdateFile(final JournalFile updateFile, final int size) { if (updateFiles == null) { updateFiles = new ArrayList<Pair<JournalFile, Integer>>(); } updateFiles.add(new Pair<JournalFile, Integer>(updateFile, size)); updateFile.incPosCount(); updateFile.addSize(size); }
void addUpdateFile(final JournalFile updateFile, final int size) { if (updateFiles == null) { updateFiles = new ArrayList<Pair<JournalFile, Integer>>(); } updateFiles.add(new Pair<JournalFile, Integer>(updateFile, size)); updateFile.incPosCount(); updateFile.addSize(size); }
public void deleteJNDI(PersistedType type, String name) throws Exception { Pair<PersistedType, String> key = new Pair<PersistedType, String>(type, name); PersistedJNDI currentJNDI = mapJNDI.remove(key); if (currentJNDI != null) { jmsJournal.appendDeleteRecord(currentJNDI.getId(), true); } }
void addUpdateFile(final JournalFile updateFile, final int size) { if (updateFiles == null) { updateFiles = new ArrayList<Pair<JournalFile, Integer>>(); } updateFiles.add(new Pair<JournalFile, Integer>(updateFile, size)); updateFile.incPosCount(); updateFile.addSize(size); }
public void deleteDestination(final PersistedType type, final String name) throws Exception { PersistedDestination destination = destinations.remove(new Pair<PersistedType, String>(type, name)); if(destination != null) { jmsJournal.appendDeleteRecord(destination.getId(), false); } deleteJNDI(type, name); }
@Override public void nodeUP(TopologyMember topologyMember, boolean last) { try { lock.lock(); Pair<TransportConfiguration, TransportConfiguration> connector = new Pair<TransportConfiguration, TransportConfiguration>(topologyMember.getLive(), topologyMember.getBackup()); if (server.checkLiveIsNotColocated(topologyMember.getNodeId())) { untriedConnectors.put(topologyMember.getNodeId(), connector); condition.signal(); } } finally { lock.unlock(); } }
@Override public void nodeUP(TopologyMember topologyMember, boolean last) { try { lock.lock(); if (nodeGroupName.equals(topologyMember.getBackupGroupName()) && topologyMember.getLive() != null) { liveConfiguration = new Pair<TransportConfiguration, TransportConfiguration>(topologyMember.getLive(), topologyMember.getBackup()); nodeID = topologyMember.getNodeId(); condition.signal(); } } finally { lock.unlock(); } }
public static List<Pair<TransportConfiguration, TransportConfiguration>> decodeConfigs(HornetQBuffer buffer) { int size = buffer.readInt(); List<Pair<TransportConfiguration, TransportConfiguration>> configs = new ArrayList<Pair<TransportConfiguration, TransportConfiguration>>(size); for (int i = 0; i < size; i++) { TransportConfiguration live = decode(buffer); boolean hasBackup = buffer.readBoolean(); TransportConfiguration backup = null; if (hasBackup) { backup = decode(buffer); } configs.add(new Pair<TransportConfiguration, TransportConfiguration>(live, backup)); } return configs; }
public void storeDestination(final PersistedDestination destination) throws Exception { deleteDestination(destination.getType(), destination.getName()); long id = idGenerator.generateID(); destination.setId(id); jmsJournal.appendAddRecord(id, DESTINATION_RECORD, destination, true); destinations.put(new Pair<PersistedType, String>(destination.getType(), destination.getName()), destination); }
public void addJNDI(PersistedType type, String name, String ... address) throws Exception { Pair<PersistedType, String> key = new Pair<PersistedType, String>(type, name); long tx = idGenerator.generateID(); PersistedJNDI currentJNDI = mapJNDI.get(key); if (currentJNDI != null) { jmsJournal.appendDeleteRecordTransactional(tx, currentJNDI.getId()); } else { currentJNDI = new PersistedJNDI(type, name); } mapJNDI.put(key, currentJNDI); for (String adItem : address) { currentJNDI.addJNDI(adItem); } long newId = idGenerator.generateID(); currentJNDI.setId(newId); jmsJournal.appendAddRecordTransactional(tx, newId, JNDI_RECORD, currentJNDI); jmsJournal.appendCommitRecord(tx, true); }
public void nodeUP(long eventUID, String nodeID, Pair<TransportConfiguration, TransportConfiguration> connectorPair, boolean last) { // There is a case where the backup announce itself, // we need to ignore a case where getA is null if (connectorPair.getA() != null) { HornetQRecoveryRegistry.getInstance().nodeUp(nodeID, new Pair<TransportConfiguration, TransportConfiguration>(connectorPair.getA(), connectorPair.getB()), config.getUsername(), config.getPassword()); } }
public void run() { String nodeId = server.getNodeID().toString(); Pair<TransportConfiguration, TransportConfiguration> emptyConfig = new Pair<TransportConfiguration, TransportConfiguration>(null, null); if (channel0.supports(PacketImpl.CLUSTER_TOPOLOGY_V2)) { channel0.send(new ClusterTopologyChangeMessage_V2(System.currentTimeMillis(), nodeId, server.getConfiguration().getName(), emptyConfig, true)); } else { channel0.send(new ClusterTopologyChangeMessage(nodeId, emptyConfig, true)); } } });
/** * The redistribution can't process the route right away as we may be dealing with a large message which will need to be processed on a different thread */ public Pair<RoutingContext, ServerMessage> redistribute(final ServerMessage message, final Queue originatingQueue, final Transaction tx) throws Exception { // We have to copy the message and store it separately, otherwise we may lose remote bindings in case of restart before the message // arrived the target node // as described on https://issues.jboss.org/browse/JBPAPP-6130 ServerMessage copyRedistribute = message.copy(storageManager.generateUniqueID()); Bindings bindings = addressManager.getBindingsForRoutingAddress(message.getAddress()); if (bindings != null) { RoutingContext context = new RoutingContextImpl(tx); boolean routed = bindings.redistribute(copyRedistribute, originatingQueue, context); if (routed) { return new Pair<RoutingContext, ServerMessage> (context, copyRedistribute); } } return null; }