Tabnine Logo
ManagementHelper.putAttribute
Code IndexAdd Tabnine to your IDE (free)

How to use
putAttribute
method
in
org.apache.activemq.artemis.api.core.management.ManagementHelper

Best Java code snippets using org.apache.activemq.artemis.api.core.management.ManagementHelper.putAttribute (Showing top 15 results out of 315)

origin: wildfly/wildfly

/**
* Stores a resource attribute in a JMS message to retrieve the value from the server resource.
*
* @param message      JMS message
* @param resourceName the name of the resource
* @param attribute    the name of the attribute
* @throws JMSException if an exception occurs while putting the information in the message
* @see org.apache.activemq.artemis.api.core.management.ResourceNames
*/
public static void putAttribute(final Message message,
                final String resourceName,
                final String attribute) throws JMSException {
 ManagementHelper.putAttribute(JMSManagementHelper.getCoreMessage(message), resourceName, attribute);
}
origin: apache/activemq-artemis

/**
* Stores a resource attribute in a JMS message to retrieve the value from the server resource.
*
* @param message      JMS message
* @param resourceName the name of the resource
* @param attribute    the name of the attribute
* @throws JMSException if an exception occurs while putting the information in the message
* @see org.apache.activemq.artemis.api.core.management.ResourceNames
*/
public static void putAttribute(final Message message,
                final String resourceName,
                final String attribute) throws JMSException {
 ManagementHelper.putAttribute(JMSManagementHelper.getCoreMessage(message), resourceName, attribute);
}
origin: org.apache.activemq/artemis-jms-client-all

/**
* Stores a resource attribute in a JMS message to retrieve the value from the server resource.
*
* @param message      JMS message
* @param resourceName the name of the resource
* @param attribute    the name of the attribute
* @throws JMSException if an exception occurs while putting the information in the message
* @see org.apache.activemq.artemis.api.core.management.ResourceNames
*/
public static void putAttribute(final Message message,
                final String resourceName,
                final String attribute) throws JMSException {
 ManagementHelper.putAttribute(JMSManagementHelper.getCoreMessage(message), resourceName, attribute);
}
origin: apache/activemq-artemis

/**
* Stores a resource attribute in a JMS message to retrieve the value from the server resource.
*
* @param message      JMS message
* @param resourceName the name of the resource
* @param attribute    the name of the attribute
* @throws JMSException if an exception occurs while putting the information in the message
* @see org.apache.activemq.artemis.api.core.management.ResourceNames
*/
public static void putAttribute(final Message message,
                final String resourceName,
                final String attribute) throws JMSException {
 ManagementHelper.putAttribute(JMSManagementHelper.getCoreMessage(message), resourceName, attribute);
}
origin: org.jboss.eap/wildfly-client-all

/**
* Stores a resource attribute in a JMS message to retrieve the value from the server resource.
*
* @param message      JMS message
* @param resourceName the name of the resource
* @param attribute    the name of the attribute
* @throws JMSException if an exception occurs while putting the information in the message
* @see org.apache.activemq.artemis.api.core.management.ResourceNames
*/
public static void putAttribute(final Message message,
                final String resourceName,
                final String attribute) throws JMSException {
 ManagementHelper.putAttribute(JMSManagementHelper.getCoreMessage(message), resourceName, attribute);
}
origin: apache/activemq-artemis

private Integer getQueueID(ClientSession session, SimpleString queueName) throws Exception {
 Integer queueID = -1;
 Object result;
 try (ClientRequestor requestor = new ClientRequestor(session, "activemq.management")) {
   ClientMessage managementMessage = session.createMessage(false);
   ManagementHelper.putAttribute(managementMessage, ResourceNames.QUEUE + queueName, "ID");
   session.start();
   logger.debug("Requesting ID for: " + queueName);
   ClientMessage reply = requestor.request(managementMessage);
   result = ManagementHelper.getResult(reply);
 }
 if (result != null && result instanceof Number) {
   queueID = ((Number) result).intValue();
 }
 return queueID;
}
origin: org.apache.activemq/artemis-cli

ManagementHelper.putAttribute(managementMessage, ResourceNames.QUEUE + queue, "ID");
managementSession.start();
if (logger.isDebugEnabled()) {
origin: apache/activemq-artemis

ManagementHelper.putAttribute(managementMessage, ResourceNames.QUEUE + queue, "ID");
managementSession.start();
if (logger.isDebugEnabled()) {
origin: apache/activemq-artemis

public Object retrieveAttributeValue(final String attributeName, final Class desiredType) {
 try (ClientSessionFactory sessionFactory = locator.createSessionFactory();
    ClientSession session = getSession(sessionFactory);
    ClientRequestor requestor = getClientRequestor(session)) {
   ClientMessage m = session.createMessage(false);
   ManagementHelper.putAttribute(m, resourceName, attributeName);
   ClientMessage reply;
   reply = requestor.request(m);
   Object result = ManagementHelper.getResult(reply, desiredType);
   return result;
 } catch (Exception e) {
   throw new IllegalStateException(e);
 }
}
origin: apache/activemq-artemis

protected ClientMessage getQueueAttribute(String queueName, String attribute) throws Exception {
 try (ServerLocator serverLocator = ActiveMQClient.createServerLocator(brokerURL)) {
   try (ClientSessionFactory sf = serverLocator.createSessionFactory()) {
    ClientSession managementSession;
    if (user != null || password != null) {
      managementSession = sf.createSession(user, password, false, true, true, false, 0);
    } else {
      managementSession = sf.createSession(false, true, true);
    }
    managementSession.start();
    try (ClientRequestor requestor = new ClientRequestor(managementSession, "activemq.management")) {
      ClientMessage managementMessage = managementSession.createMessage(false);
      ManagementHelper.putAttribute(managementMessage, ResourceNames.QUEUE + queueName, attribute);
      managementSession.start();
      ClientMessage reply = requestor.request(managementMessage);
      return reply;
    } finally {
      managementSession.stop();
    }
   }
 }
}
origin: org.apache.activemq/artemis-cli

protected ClientMessage getQueueAttribute(String queueName, String attribute) throws Exception {
 try (ServerLocator serverLocator = ActiveMQClient.createServerLocator(brokerURL)) {
   try (ClientSessionFactory sf = serverLocator.createSessionFactory()) {
    ClientSession managementSession;
    if (user != null || password != null) {
      managementSession = sf.createSession(user, password, false, true, true, false, 0);
    } else {
      managementSession = sf.createSession(false, true, true);
    }
    managementSession.start();
    try (ClientRequestor requestor = new ClientRequestor(managementSession, "activemq.management")) {
      ClientMessage managementMessage = managementSession.createMessage(false);
      ManagementHelper.putAttribute(managementMessage, ResourceNames.QUEUE + queueName, attribute);
      managementSession.start();
      ClientMessage reply = requestor.request(managementMessage);
      return reply;
    } finally {
      managementSession.stop();
    }
   }
 }
}
origin: apache/activemq-artemis

ManagementHelper.putAttribute(mngmntMessage, ResourceNames.BROKER, "started");
ClientMessage reply = requestor.request(mngmntMessage, 500);
if (expectSuccess) {
origin: apache/activemq-artemis

@Test
public void testHandleManagementMessageWithUnknownAttribute() throws Exception {
 Configuration config = createBasicConfig().setJMXManagementEnabled(false);
 ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 server.start();
 // invoke attribute and operation on the server
 ICoreMessage message = new CoreMessage(1, 100);
 ManagementHelper.putAttribute(message, ResourceNames.BROKER, "started");
 ICoreMessage reply = server.getManagementService().handleMessage(message);
 Assert.assertTrue(ManagementHelper.hasOperationSucceeded(reply));
 Assert.assertTrue((Boolean) ManagementHelper.getResult(reply));
}
origin: apache/activemq-artemis

@Test
public void testHandleManagementMessageWithKnownAttribute() throws Exception {
 Configuration config = createBasicConfig().setJMXManagementEnabled(false);
 ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, false));
 server.start();
 // invoke attribute and operation on the server
 ICoreMessage message = new CoreMessage(1, 100);
 ManagementHelper.putAttribute(message, ResourceNames.BROKER, "attribute.Does.Not.Exist");
 ICoreMessage reply = server.getManagementService().handleMessage(message);
 Assert.assertFalse(ManagementHelper.hasOperationSucceeded(reply));
 Assert.assertNotNull(ManagementHelper.getResult(reply));
}
origin: apache/activemq-artemis

ManagementHelper.putAttribute(message, "queue." + address.toString(), "messageCount");
org.apache.activemq.artemis.api.core.managementManagementHelperputAttribute

Javadoc

Stores a resource attribute in a message to retrieve the value from the server resource.

Popular methods of ManagementHelper

  • getResult
    Returns the result of an operation invocation or an attribute value. If an error occurred on the ser
  • putOperationInvocation
    Stores an operation invocation in a message to invoke the corresponding operation the value from the
  • hasOperationSucceeded
    Returns whether the invocation of the management operation on the server resource succeeded.
  • getResults
    Returns the result of an operation invocation or an attribute value. If an error occurred on the ser
  • isOperationResult
    Returns whether the JMS message corresponds to the result of a management operation invocation.
  • isAttributesResult
    Returns whether the JMS message corresponds to the result of a management attribute value.
  • retrieveOperationParameters
    Used by ActiveMQ Artemis management service.
  • storeResult
    Used by ActiveMQ Artemis management service.

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • putExtra (Intent)
  • getResourceAsStream (ClassLoader)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Collectors (java.util.stream)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now