Examples of MessageSource


Examples of com.github.fge.msgsimple.source.MessageSource

         * Complement the validation message bundle with a dedicated message
         * for our keyword validator
         */
        final String key = "missingDivisors";
        final String value = "integer value is not a multiple of all divisors";
        final MessageSource source = MapMessageSource.newBuilder()
            .put(key, value).build();
        final MessageBundle bundle
            = MessageBundles.getBundle(JsonSchemaValidationBundle.class)
            .thaw().appendSource(source).freeze();

View Full Code Here

Examples of org.apache.qpid.server.message.MessageSource

                            destination = null;
                        }
                    }
                    else
                    {
                        MessageSource queue = getVirtualHost().getMessageSource(addr);
                        if(queue != null)
                        {
                            destination = new MessageSourceDestination(queue);
                        }
                        else
View Full Code Here

Examples of org.apache.qpid.server.message.MessageSource

    }

    @Override
    public MessageSource getMessageSource(final String name)
    {
        MessageSource systemSource = _systemNodeSources.get(name);
        return systemSource == null ? getQueue(name) : systemSource;
    }
View Full Code Here

Examples of org.apache.qpid.server.message.MessageSource

            else
            {
                String queueName = method.getQueue();
                VirtualHost vhost = getVirtualHost(session);

                final MessageSource queue = vhost.getMessageSource(queueName);

                if(queue == null)
                {
                    exception(session,method,ExecutionErrorCode.NOT_FOUND, "Queue: " + queueName + " not found");
                }
                else if(!queue.verifySessionAccess((ServerSession)session))
                {
                    exception(session,method,ExecutionErrorCode.RESOURCE_LOCKED, "Exclusive Queue: " + queueName + " owned exclusively by another session");
                }
                else
                {

                    FlowCreditManager_0_10 creditManager = new WindowCreditManager(0L,0L);

                    FilterManager filterManager = null;
                    try
                    {
                        filterManager = FilterManagerFactory.createManager(method.getArguments());
                    }
                    catch (AMQInvalidArgumentException amqe)
                    {
                        exception(session, method, ExecutionErrorCode.ILLEGAL_ARGUMENT, "Exception Creating FilterManager");
                        return;
                    }

                    ConsumerTarget_0_10 target = new ConsumerTarget_0_10((ServerSession)session, destination,
                                                                                 method.getAcceptMode(),
                                                                                 method.getAcquireMode(),
                                                                                 MessageFlowMode.WINDOW,
                                                                                 creditManager,
                                                                                 method.getArguments()
                    );

                    ((ServerSession)session).register(destination, target);
                    try
                    {
                        EnumSet<ConsumerImpl.Option> options = EnumSet.noneOf(ConsumerImpl.Option.class);
                        if(method.getAcquireMode() == MessageAcquireMode.PRE_ACQUIRED)
                        {
                            options.add(ConsumerImpl.Option.ACQUIRES);
                        }
                        if(method.getAcquireMode() != MessageAcquireMode.NOT_ACQUIRED || method.getAcceptMode() == MessageAcceptMode.EXPLICIT)
                        {
                            options.add(ConsumerImpl.Option.SEES_REQUEUES);
                        }
                        if(method.getExclusive())
                        {
                            options.add(ConsumerImpl.Option.EXCLUSIVE);
                        }
                        ((ServerSession)session).register(
                                queue.addConsumer(target,
                                                  filterManager,
                                                  MessageTransferMessage.class,
                                                  destination,
                                                  options));
                    }
View Full Code Here

Examples of org.mule.api.source.MessageSource

    {
        if (flowConstruct != null)
        {
            if (flowConstruct instanceof Service)
            {
                MessageSource source = ((Service) flowConstruct).getMessageSource();

                if (source instanceof InboundEndpoint)
                {
                    return ((InboundEndpoint) source).getEndpointURI().toString();
                }
                else if (source instanceof ServiceCompositeMessageSource)
                {
                    List<InboundEndpoint> endpoints = ((ServiceCompositeMessageSource) muleService.getMessageSource()).getEndpoints();

                    if (endpoints.size() > 0)
                    {
                        return endpoints.get(0).getEndpointURI().toString();
                    }
                }
            }
            else if (flowConstruct instanceof Pipeline)
            {
                MessageSource source = ((Pipeline) flowConstruct).getMessageSource();

                if (source instanceof InboundEndpoint)
                {
                    return ((InboundEndpoint) source).getEndpointURI().toString();
                }
View Full Code Here

Examples of org.springframework.context.MessageSource

  @Override
  protected MessageFormat resolveCode(String code, Locale locale) {
    String codePart = code;
    MessageFormat res = super.resolveCode(codePart, locale);
    if (res == null) {
      MessageSource parent = getParentMessageSource();
      if (parent instanceof EnhancedResourceBundleMessageSource) {
        res = ((EnhancedResourceBundleMessageSource) parent).baseResolveCode(
            code, locale);
      }
    }
    int dotIndex = codePart.indexOf(DOT);

    while (resolveNested && res == null && dotIndex > 0) {
      codePart = codePart.substring(dotIndex + 1);
      res = super.resolveCode(codePart, locale);
      if (res == null) {
        MessageSource parent = getParentMessageSource();
        if (parent instanceof EnhancedResourceBundleMessageSource) {
          res = ((EnhancedResourceBundleMessageSource) parent).baseResolveCode(
              code, locale);
        }
      }
View Full Code Here

Examples of org.springframework.context.MessageSource

  @Override
  protected String resolveCodeWithoutArguments(String code, Locale locale) {
    String codePart = code;
    String res = super.resolveCodeWithoutArguments(codePart, locale);
    if (res == null) {
      MessageSource parent = getParentMessageSource();
      if (parent instanceof EnhancedResourceBundleMessageSource) {
        res = ((EnhancedResourceBundleMessageSource) parent)
            .baseResolveCodeWithoutArguments(code, locale);
      }
    }
    int dotIndex = codePart.indexOf(DOT);

    while (resolveNested && res == null && dotIndex > 0) {
      codePart = codePart.substring(dotIndex + 1);
      res = super.resolveCodeWithoutArguments(codePart, locale);
      if (res == null) {
        MessageSource parent = getParentMessageSource();
        if (parent instanceof EnhancedResourceBundleMessageSource) {
          res = ((EnhancedResourceBundleMessageSource) parent)
              .baseResolveCodeWithoutArguments(code, locale);
        }
      }
View Full Code Here

Examples of org.springframework.context.MessageSource

        return methodTextField;
    }

    @Test
    public void testTranslate() {
        MessageSource messageSource = mock(MessageSource.class);
        when(messageSource.getMessage("privateLabel.caption", null, "", Locale.ENGLISH)).thenReturn("Private Label Caption");
        when(messageSource.getMessage("publicLabel.caption", null, "", Locale.ENGLISH)).thenReturn("Public Label Caption");
        when(messageSource.getMessage("textField.caption", null, "", Locale.ENGLISH)).thenReturn("Text Field Caption");
        when(messageSource.getMessage("textField.description", null, "", Locale.ENGLISH)).thenReturn("Text Field Description");
        when(messageSource.getMessage("methodLabel.caption", null, "", Locale.ENGLISH)).thenReturn("Method Label Caption");
        when(messageSource.getMessage("methodTextField.caption", null, "", Locale.ENGLISH)).thenReturn("Method Text Field Caption");
        when(messageSource.getMessage("methodTextField.description", null, "", Locale.ENGLISH)).thenReturn("Method Text Field Description");

        new Translator(this).translate(Locale.ENGLISH, messageSource);

        assertEquals("Private Label Caption", privateLabel.getCaption());
        assertEquals("Public Label Caption", publicLabel.getCaption());
View Full Code Here

Examples of org.springframework.context.MessageSource

        ValidatorResources resources = getValidatorResources();

        Form form = resources.getForm(locale, formName);
        if (form != null) {
            if ("true".equalsIgnoreCase(dynamicJavascript)) {
                MessageSource messages = getMessageSource();

                List lActions = new ArrayList();
                List lActionMethods = new ArrayList();

                // Get List of actions for this Form
View Full Code Here

Examples of org.springframework.context.MessageSource

  public IconProgressStatusBarItem(){
  }

  public AbstractButton createCancelButton(){
    IconSource iconSource = (IconSource)ApplicationServicesLocator.services().getService(IconSource.class);
    MessageSource messageSource = (MessageSource)ApplicationServicesLocator.services().getService(MessageSource.class);
    AbstractAction action = new AbstractAction(null, iconSource.getIcon(CANCEL_ICON)){
      public void actionPerformed(ActionEvent event) {
        CancelCallback callback = getCancelCallback();
        if(callback != null){
          callback.cancelPerformed();
        }
      }
    };
    AbstractButton button = new JideButton(action);
    button.setToolTipText(messageSource.getMessage(CANCEL_TOOLTIP, new Object[]{}, Locale.getDefault()));
    return button;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.