@Override public synchronized String getVersion() { checkInitialised(); return server.getVersion().getFullVersion(); }
@Override public String getVersion() { checkStarted(); clearIO(); try { return server.getVersion().getFullVersion(); } finally { blockOnIO(); } }
private void handleReadAttribute(OperationContext context, ModelNode operation, final ActiveMQServer server) throws OperationFailedException { final String name = operation.require(ModelDescriptionConstants.NAME).asString(); if (STARTED.getName().equals(name)) { boolean started = server != null ? server.isStarted() : false; context.getResult().set(started); } else if (VERSION.getName().equals(name)) { if (server != null) { String version = server.getVersion().getFullVersion(); context.getResult().set(version); } } else if (ACTIVE.getName().equals(name)) { boolean active = server != null ? server.isActive() : false; context.getResult().set(active); } else { // Bug throw MessagingLogger.ROOT_LOGGER.unsupportedAttribute(name); } }
private void handleReadAttribute(OperationContext context, ModelNode operation, final ActiveMQServer server) throws OperationFailedException { final String name = operation.require(ModelDescriptionConstants.NAME).asString(); if (STARTED.getName().equals(name)) { boolean started = server != null ? server.isStarted() : false; context.getResult().set(started); } else if (VERSION.getName().equals(name)) { if (server != null) { String version = server.getVersion().getFullVersion(); context.getResult().set(version); } } else if (ACTIVE.getName().equals(name)) { boolean active = server != null ? server.isActive() : false; context.getResult().set(active); } else { // Bug throw MessagingLogger.ROOT_LOGGER.unsupportedAttribute(name); } }
@Test public void testManifestEntries() throws Exception { Properties props = System.getProperties(); String userDir = props.getProperty("build.lib"); UnitTestLogger.LOGGER.trace("userDir is " + userDir); // The jar must be there File file = new File("build/jars", "activemq-core.jar"); Assert.assertTrue(file.exists()); // Open the jar and load MANIFEST.MF JarFile jar = new JarFile(file); Manifest manifest = jar.getManifest(); ActiveMQServer server = ActiveMQServers.newActiveMQServer(createBasicConfig()); ConnectionMetaData meta = new ActiveMQConnectionMetaData(server.getVersion()); // Compare the value from ConnectionMetaData and MANIFEST.MF Attributes attrs = manifest.getMainAttributes(); Assert.assertEquals(meta.getProviderVersion(), attrs.getValue("ActiveMQ-Version")); }
@Test public void testGetVersion() throws Exception { cf = createSessionFactory(locator); ClientSession clientSession = cf.createSession(false, true, true); Assert.assertEquals(server.getVersion().getIncrementingVersion(), clientSession.getVersion()); clientSession.close(); }
Packet response; try { Version version = server.getVersion(); if (!version.isCompatible(request.getVersion())) { throw ActiveMQMessageBundle.BUNDLE.incompatibleClientServer(); response = new CreateSessionResponseMessage(server.getVersion().getIncrementingVersion()); } catch (ActiveMQClusterSecurityException | ActiveMQSecurityException e) { response = new ActiveMQExceptionMessage(e);
ActiveMQServerControl serverControl = createManagementControl(); Assert.assertEquals(server.getVersion().getFullVersion(), serverControl.getVersion());