예제 #1
0
 public JMSBridgeService(
     final String moduleName, final String bridgeName, final JMSBridge bridge) {
   if (bridge == null) {
     throw MessagingLogger.ROOT_LOGGER.nullVar("bridge");
   }
   this.moduleName = moduleName;
   this.bridgeName = bridgeName;
   this.bridge = bridge;
 }
예제 #2
0
  private void handleReadAttribute(OperationContext context, ModelNode operation) {

    if (ignoreOperationIfServerNotActive(context, operation)) {
      return;
    }

    final AddressControl addressControl = getAddressControl(context, operation);
    if (addressControl == null) {
      PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
      throw ControllerLogger.ROOT_LOGGER.managementResourceNotFound(address);
    }

    final String name = operation.require(ModelDescriptionConstants.NAME).asString();

    try {
      if (ROLES_ATTR_NAME.equals(name)) {
        String json = addressControl.getRolesAsJSON();
        reportRoles(context, json);
      } else if (QUEUE_NAMES.equals(name)) {
        String[] queues = addressControl.getQueueNames();
        reportListOfStrings(context, queues);
      } else if (NUMBER_OF_BYTES_PER_PAGE.equals(name)) {
        long l = addressControl.getNumberOfBytesPerPage();
        context.getResult().set(l);
      } else if (NUMBER_OF_PAGES.equals(name)) {
        int i = addressControl.getNumberOfPages();
        context.getResult().set(i);
      } else if (BINDING_NAMES.equals(name)) {
        String[] bindings = addressControl.getBindingNames();
        reportListOfStrings(context, bindings);
      } else {
        // Bug
        throw MessagingLogger.ROOT_LOGGER.unsupportedAttribute(name);
      }
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      context.getFailureDescription().set(e.getLocalizedMessage());
    }

    context.stepCompleted();
  }