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

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

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

origin: wildfly/wildfly

/**
* Returns the result of an operation invocation or an attribute value.
* <br>
* If an error occurred on the server, {@link #hasOperationSucceeded(Message)} will return {@code false}.
* and the result will be a String corresponding to the server exception.
*/
public static Object getResult(final ICoreMessage message) throws Exception {
 return getResult(message, null);
}
origin: wildfly/wildfly

/**
* Returns the result of an operation invocation or an attribute value.
* <br>
* If an error occurred on the server, {@link #hasOperationSucceeded(Message)} will return {@code false}.
* and the result will be a String corresponding to the server exception.
*/
public static Object getResult(final Message message, Class desiredType) throws Exception {
 return ManagementHelper.getResult(JMSManagementHelper.getCoreMessage(message), desiredType);
}
origin: apache/activemq-artemis

/**
* Returns the result of an operation invocation or an attribute value.
* <br>
* If an error occurred on the server, {@link #hasOperationSucceeded(Message)} will return {@code false}.
* and the result will be a String corresponding to the server exception.
*/
public static Object getResult(final ICoreMessage message) throws Exception {
 return getResult(message, null);
}
origin: org.apache.activemq/artemis-cli

@Override
public void requestSuccessful(ClientMessage reply) throws Exception {
 final String result = (String) ManagementHelper.getResult(reply, String.class);
 printStats(result);
}
origin: apache/activemq-artemis

@Override
public void requestSuccessful(ClientMessage reply) throws Exception {
 final String result = ManagementHelper.getResult(reply, String.class) + " created successfully.";
 context.out.println(result);
}
origin: apache/activemq-artemis

@Override
public void requestSuccessful(ClientMessage reply) throws Exception {
 final String result = ManagementHelper.getResult(reply, String.class) + " created successfully.";
 context.out.println(result);
}
origin: org.apache.activemq/artemis-cli

@Override
public void requestSuccessful(ClientMessage reply) throws Exception {
 final String result = ManagementHelper.getResult(reply, String.class) + " updated successfully.";
 context.out.println(result);
}
origin: apache/activemq-artemis

  @Override
  public void requestFailed(ClientMessage reply) throws Exception {
   String errMsg = (String) ManagementHelper.getResult(reply, String.class);
   context.err.println("Failed to show address " + getName(false) + ". Reason: " + errMsg);
  }
});
origin: apache/activemq-artemis

  @Override
  public void requestFailed(ClientMessage reply) throws Exception {
   String errMsg = (String) ManagementHelper.getResult(reply, String.class);
   context.err.println("Failed to create queue " + getName() + ". Reason: " + errMsg);
  }
});
origin: apache/activemq-artemis

  @Override
  public void requestFailed(ClientMessage reply) throws Exception {
   String errMsg = (String) ManagementHelper.getResult(reply, String.class);
   context.err.println("Failed to purge queue " + getName() + ". Reason: " + errMsg);
  }
});
origin: apache/activemq-artemis

/**
* Returns the result of an operation invocation or an attribute value.
* <br>
* If an error occurred on the server, {@link #hasOperationSucceeded(Message)} will return {@code false}.
* and the result will be a String corresponding to the server exception.
*/
public static Object getResult(final Message message, Class desiredType) throws Exception {
 return ManagementHelper.getResult(JMSManagementHelper.getCoreMessage(message), desiredType);
}
origin: apache/activemq-artemis

  @Override
  public void requestFailed(ClientMessage reply) throws Exception {
   String errMsg = (String) ManagementHelper.getResult(reply, String.class);
   context.err.println("Failed to create address " + getName(true) + ". Reason: " + errMsg);
  }
});
origin: apache/activemq-artemis

  @Override
  public void requestFailed(ClientMessage reply) throws Exception {
   String errMsg = (String) ManagementHelper.getResult(reply, String.class);
   context.err.println("Failed to update " + getName() + ". Reason: " + errMsg);
  }
});
origin: apache/activemq-artemis

  @Override
  public void requestFailed(ClientMessage reply) throws Exception {
   String errMsg = (String) ManagementHelper.getResult(reply, String.class);
   context.err.println("Failed to delete address " + getName(true) + ". Reason: " + errMsg);
  }
});
origin: org.apache.activemq/artemis-jms-client-all

/**
* Returns the result of an operation invocation or an attribute value.
* <br>
* If an error occurred on the server, {@link #hasOperationSucceeded(Message)} will return {@code false}.
* and the result will be a String corresponding to the server exception.
*/
public static Object getResult(final Message message, Class desiredType) throws Exception {
 return ManagementHelper.getResult(JMSManagementHelper.getCoreMessage(message), desiredType);
}
origin: apache/activemq-artemis

public byte[] getQueueIdFromName(String queueName) throws Exception {
 try {
   ClientMessage message = getQueueAttribute(queueName, "ID");
   Number idObject = (Number) ManagementHelper.getResult(message);
   ByteBuffer byteBuffer = ByteBuffer.allocate(8);
   byteBuffer.putLong(idObject.longValue());
   return byteBuffer.array();
 } catch (Exception e) {
   throw new ActiveMQException("Error occured when looking up FQQN.  Please ensure the FQQN exists.", e, ActiveMQExceptionType.ILLEGAL_STATE);
 }
}
origin: org.apache.activemq/artemis-cli

public byte[] getQueueIdFromName(String queueName) throws Exception {
 try {
   ClientMessage message = getQueueAttribute(queueName, "ID");
   Number idObject = (Number) ManagementHelper.getResult(message);
   ByteBuffer byteBuffer = ByteBuffer.allocate(8);
   byteBuffer.putLong(idObject.longValue());
   return byteBuffer.array();
 } catch (Exception e) {
   throw new ActiveMQException("Error occured when looking up FQQN.  Please ensure the FQQN exists.", e, ActiveMQExceptionType.ILLEGAL_STATE);
 }
}
origin: apache/activemq-artemis

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

@Test
public void testHandleManagementMessageWithUnknowResource() 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.putOperationInvocation(message, "Resouce.Does.Not.Exist", "toString");
 ICoreMessage reply = server.getManagementService().handleMessage(message);
 Assert.assertFalse(ManagementHelper.hasOperationSucceeded(reply));
 Assert.assertNotNull(ManagementHelper.getResult(reply));
}
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));
}
org.apache.activemq.artemis.api.core.managementManagementHelpergetResult

Javadoc

Returns the result of an operation invocation or an attribute value.
If an error occurred on the server, #hasOperationSucceeded(Message) will return false. and the result will be a String corresponding to the server exception.

Popular methods of ManagementHelper

  • 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.
  • putAttribute
    Stores a resource attribute in a message to retrieve the value from the server resource.
  • 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

  • Finding current android device location
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • onRequestPermissionsResult (Fragment)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • JTable (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • 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