public URI getDomain() { return info.getDomain(); }
public File getDataDirectory() { return info.getDataDir(); }
public BrokerEngine(@Reference PortAllocator portAllocator, @Reference HostInfo info) { this.portAllocator = portAllocator; tempDir = new File(info.getTempDir(), "activemq"); // sets the directory where persistent messages are written File baseDataDir = info.getDataDir(); dataDir = new File(baseDataDir, "activemq.data"); this.info = info; }
private String parseTopic(XMLStreamReader reader) { String topic = reader.getAttributeValue(null, "topic"); if (topic == null) { topic = "fabric3"; } else if ("#domain".equals(topic)) { topic = hostInfo.getDomain().getAuthority() + "." + hostInfo.getRuntimeName(); } return topic; } }
public File getTempDirectory() { return info.getTempDir(); }
@Init @SuppressWarnings({"ResultOfMethodCallIgnored"}) public void init() throws IOException { eventService.subscribe(RuntimeRecover.class, this); // turn off transactions.properties search by the transaction manager since these will be supplied directly System.setProperty(ATOMIKOS_NO_FILE, "true"); // configure mandatory value System.setProperty(FACTORY_KEY, FACTORY_VALUE); File dataDir = info.getDataDir(); File trxDir = new File(dataDir, "transactions"); if (!trxDir.exists()) { trxDir.mkdirs(); } // set the unique TM name String name = info.getRuntimeName().replace(":", "_"); // shorten to length required by Atomikos if too large if (name.getBytes().length + 16 > XID.MAXGTRIDSIZE) { name = new String(Arrays.copyOfRange(name.getBytes(), 0, XID.MAXGTRIDSIZE - 16)); } properties.setProperty(TM_NAME, name); String path = trxDir.getCanonicalPath(); properties.setProperty(OUTPUT_DIR_PROPERTY_NAME, path); properties.setProperty(LOG_BASE_DIR_PROPERTY_NAME, path); properties.setProperty(THREADED2PC, Boolean.toString(singleThreaded2PC)); properties.setProperty(ENABLE_LOGGING, Boolean.toString(enableLogging)); if (checkPointInterval != -1) { properties.setProperty(CHECKPOINT_INTERVAL, Long.toString(checkPointInterval)); } }
public String getRuntimeName() { return info.getRuntimeName(); }
public List<Composite> getDeployables(Set<Contribution> contributions) { List<Composite> deployables = new ArrayList<>(); for (Contribution contribution : contributions) { for (Resource resource : contribution.getResources()) { for (ResourceElement<?, ?> entry : resource.getResourceElements()) { if (!(entry.getValue() instanceof Composite)) { continue; } @SuppressWarnings({"unchecked"}) ResourceElement<QNameSymbol, Composite> element = (ResourceElement<QNameSymbol, Composite>) entry; QName name = element.getSymbol().getKey(); Composite composite = element.getValue(); for (Deployable deployable : contribution.getManifest().getDeployables()) { if (deployable.getName().equals(name)) { List<RuntimeMode> deployableModes = deployable.getRuntimeModes(); // only add deployables that are set to boot in the current runtime mode and where the environment matches if (deployableModes.contains(hostInfo.getRuntimeMode())) { List<String> environments = deployable.getEnvironments(); if (environments.isEmpty() || environments.contains(hostInfo.getEnvironment())) { deployables.add(composite); } } break; } } } } } return deployables; }
public void startContext(URI uri) throws GroupInitializationException { if (RuntimeMode.NODE == info.getRuntimeMode() && discoveryAgent == null) { return; } else if (RuntimeMode.NODE == info.getRuntimeMode() && !discoveryAgent.isLeader()) { // defer instantiation until this node becomes zone leader synchronized (deferredContexts) { deferredContexts.add(uri); } return; } activated = true; super.startContext(uri); }
public String getEnvironment() { return info.getEnvironment(); }
public void addBootCallback(Runnable callback) { info.addBootCallback(callback); } }
brokerName = configuredBrokerName; } else { brokerName = info.getRuntimeName().replace(":", "."); selectedPort.bind(Port.TYPE.TCP); TransportConnector connector = broker.addConnector("tcp://" + bindAddress + ":" + selectedPort.getNumber()); String group = info.getDomain().getAuthority(); connector.setDiscoveryUri(URI.create("multicast://default?group=" + group)); broker.addNetworkConnector("multicast://default?group=" + group);
public File getTempDirectory() { return info.getTempDir(); }
public String getRuntimeName() { return info.getRuntimeName(); }
public List<Composite> getDeployables(Set<Contribution> contributions) { List<Composite> deployables = new ArrayList<>(); for (Contribution contribution : contributions) { for (Resource resource : contribution.getResources()) { for (ResourceElement<?, ?> entry : resource.getResourceElements()) { if (!(entry.getValue() instanceof Composite)) { continue; } @SuppressWarnings({"unchecked"}) ResourceElement<QNameSymbol, Composite> element = (ResourceElement<QNameSymbol, Composite>) entry; QName name = element.getSymbol().getKey(); Composite composite = element.getValue(); for (Deployable deployable : contribution.getManifest().getDeployables()) { if (deployable.getName().equals(name)) { List<RuntimeMode> deployableModes = deployable.getRuntimeModes(); // only add deployables that are set to boot in the current runtime mode and where the environment matches if (deployableModes.contains(hostInfo.getRuntimeMode())) { List<String> environments = deployable.getEnvironments(); if (environments.isEmpty() || environments.contains(hostInfo.getEnvironment())) { deployables.add(composite); } } break; } } } } } return deployables; }
public void startContext(URI uri) throws GroupInitializationException { if (RuntimeMode.NODE == info.getRuntimeMode() && discoveryAgent == null) { return; } else if (RuntimeMode.NODE == info.getRuntimeMode() && !discoveryAgent.isLeader()) { // defer instantiation until this node becomes zone leader synchronized (deferredContexts) { deferredContexts.add(uri); } return; } activated = true; super.startContext(uri); }
public String getEnvironment() { return info.getEnvironment(); }
public void addBootCallback(Runnable callback) { info.addBootCallback(callback); } }
public URI getDomain() { return info.getDomain(); }
public File getDataDirectory() { return info.getDataDir(); }