org.mule.config.i18n.Message类的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(298)

本文整理了Java中org.mule.config.i18n.Message类的一些代码示例,展示了Message类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message类的具体详情如下:
包路径:org.mule.config.i18n.Message
类名称:Message

Message介绍

暂无

代码示例

代码示例来源:origin: org.mule/mule-core

  1. @Override
  2. protected String generateMessage(Message message)
  3. {
  4. return message.getMessage();
  5. }

代码示例来源:origin: org.mule/mule-core

  1. public KeyedPoolMessageDispatcherFactoryAdapter(MessageDispatcherFactory factory)
  2. {
  3. super();
  4. if (factory == null)
  5. {
  6. throw new IllegalArgumentException(CoreMessages.objectIsNull("factory").toString());
  7. }
  8. this.factory = factory;
  9. }

代码示例来源:origin: org.mule/mule-core

  1. /**
  2. * Factory method to create a {@link Message} instance that is not read from a resource bundle.
  3. *
  4. * @param message Message's message text
  5. * @return a Messsage instance that has an error code of -1 and no arguments.
  6. */
  7. public static Message createStaticMessage(String message)
  8. {
  9. return new Message(message, STATIC_ERROR_CODE, EMPTY_ARGS);
  10. }

代码示例来源:origin: org.mule.modules/mule-module-launcher

  1. /**
  2. * Will shut down the server displaying the cause and time of the shutdown
  3. *
  4. * @param e the exception that caused the shutdown
  5. */
  6. public void shutdown(Throwable e) throws MuleException
  7. {
  8. Message msg = CoreMessages.fatalErrorWhileRunning();
  9. MuleException muleException = ExceptionHelper.getRootMuleException(e);
  10. if (muleException != null)
  11. {
  12. logger.fatal(muleException.getDetailedMessage());
  13. }
  14. else
  15. {
  16. logger.fatal(msg.toString() + " " + e.getMessage(), e);
  17. }
  18. List<String> msgs = new ArrayList<String>();
  19. msgs.add(msg.getMessage());
  20. Throwable root = ExceptionHelper.getRootException(e);
  21. msgs.add(root.getMessage() + " (" + root.getClass().getName() + ")");
  22. msgs.add(" ");
  23. msgs.add(CoreMessages.fatalErrorInShutdown().getMessage());
  24. String shutdownMessage = StringMessageUtils.getBoilerPlate(msgs, '*', 80);
  25. logger.fatal(shutdownMessage);
  26. unregisterShutdownHook();
  27. doShutdown();
  28. System.exit(1);
  29. }

代码示例来源:origin: org.mule/mule-core

  1. public int getMessageCode()
  2. {
  3. return (i18nMessage == null ? 0 : i18nMessage.getCode());
  4. }

代码示例来源:origin: org.mule/mule-core

  1. logger.fatal(msg.toString() + " " + e.getMessage(), e);
  2. msgs.add(msg.getMessage());
  3. Throwable root = ExceptionHelper.getRootException(e);
  4. msgs.add(root.getMessage() + " (" + root.getClass().getName() + ")");
  5. msgs.add(" ");
  6. msgs.add(CoreMessages.fatalErrorInShutdown().getMessage());
  7. String shutdownMessage = StringMessageUtils.getBoilerPlate(msgs, '*', 80);
  8. logger.fatal(shutdownMessage);

代码示例来源:origin: org.mule/mule-core

  1. public String toString()
  2. {
  3. return this.getMessage();
  4. }
  5. }

代码示例来源:origin: org.mule/mule-core

  1. public KeyedPoolMessageRequesterFactoryAdapter(MessageRequesterFactory factory)
  2. {
  3. super();
  4. if (factory == null)
  5. {
  6. throw new IllegalArgumentException(CoreMessages.objectIsNull("factory").toString());
  7. }
  8. this.factory = factory;
  9. }

代码示例来源:origin: org.mule.transports/mule-transport-quartz

  1. if (tempJob == null)
  2. throw new JobExecutionException(QuartzMessages.invalidPayloadType().getMessage());
  3. throw new JobExecutionException(QuartzMessages.invalidJobObject().getMessage());
  4. throw new JobExecutionException(QuartzMessages.invalidJobObject().toString());

代码示例来源:origin: org.mule/mule-core

  1. /**
  2. * Factory method to create a {@link Message} instance that is not read from a resource bundle.
  3. *
  4. * @param message Static message text that may contain format specifiers
  5. * @param arguments Arguments referenced by the format specifiers in the message string.
  6. * @return a Messsage instance that has an error code of -1 and no arguments.
  7. */
  8. public static Message createStaticMessage(String message, Object... arguments)
  9. {
  10. return new Message(String.format(message, arguments), STATIC_ERROR_CODE, EMPTY_ARGS);
  11. }

代码示例来源:origin: org.mule/mule-core

  1. /**
  2. * @param message the exception message
  3. */
  4. public MuleRuntimeException(Message message)
  5. {
  6. super(message.getMessage());
  7. }

代码示例来源:origin: org.mule.transports/mule-transport-http

  1. public void setCookieSpec(String cookieSpec)
  2. {
  3. if (!(COOKIE_SPEC_NETSCAPE.equalsIgnoreCase(cookieSpec) || COOKIE_SPEC_RFC2109.equalsIgnoreCase(cookieSpec)))
  4. {
  5. throw new IllegalArgumentException(
  6. CoreMessages.propertyHasInvalidValue("cookieSpec", cookieSpec).toString());
  7. }
  8. this.cookieSpec = cookieSpec;
  9. }

代码示例来源:origin: org.mule/mule-core

  1. /**
  2. * Factory method to create a new {@link Message} instance that is filled with the formatted
  3. * message with id <code>code</code> from the resource bundle <code>bundlePath</code>.
  4. *
  5. * @param bundlePath complete path to the resource bundle for lookup
  6. * @param code numeric code of the message
  7. */
  8. protected Message createMessage(String bundlePath, int code)
  9. {
  10. String messageString = getString(bundlePath, code, null);
  11. return new Message(messageString, code, EMPTY_ARGS);
  12. }

代码示例来源:origin: org.mule/mule-core

  1. /**
  2. * @param message the exception message
  3. * @param cause the exception that triggered this exception
  4. */
  5. public MuleRuntimeException(Message message, Throwable cause)
  6. {
  7. super(message.getMessage(), cause);
  8. }

代码示例来源:origin: org.mule/mule-core

  1. /**
  2. * An optional error message can be set if the invocation state is not {@link org.mule.api.model.InvocationResult.State#SUCCESSFUL}
  3. *
  4. * @param message the error message
  5. */
  6. public void setErrorMessage(String message)
  7. {
  8. if (state == State.SUCCESSFUL)
  9. {
  10. throw new IllegalStateException(CoreMessages.invocationSuccessfulCantSetError().toString());
  11. }
  12. errorMessage = message;
  13. }

代码示例来源:origin: org.mule/mule-core

  1. /**
  2. * Factory method to create a new {@link Message} instance that is filled with the formatted
  3. * message with id <code>code</code> from the resource bundle <code>bundlePath</code>.
  4. *
  5. * <b>Attention:</b> do not confuse this method with
  6. * <code>createMessage(String, int, Object)</code>.
  7. *
  8. * @param bundlePath complete path to the resource bundle for lookup
  9. * @param code numeric code of the message
  10. * @param arguments
  11. * @see #getBundlePath(String)
  12. */
  13. protected Message createMessage(String bundlePath, int code, Object... arguments)
  14. {
  15. String messageString = getString(bundlePath, code, arguments);
  16. return new Message(messageString, code, arguments);
  17. }

代码示例来源:origin: org.mule.modules/mule-module-validation

  1. @Override
  2. protected String generateMessage(Message message)
  3. {
  4. return message.getMessage();
  5. }
  6. }

代码示例来源:origin: org.mule/mule-core

  1. @Override
  2. public void setName(String newName)
  3. {
  4. if (newName == null)
  5. {
  6. throw new IllegalArgumentException(CoreMessages.objectIsNull("Connector name").toString());
  7. }
  8. if (logger.isDebugEnabled())
  9. {
  10. logger.debug("Set Connector name to: " + newName);
  11. }
  12. name = newName;
  13. }

代码示例来源:origin: org.mule.modules/mule-module-plexus

  1. public void configure(Reader configuration) throws ContainerException
  2. {
  3. try {
  4. container.setConfiguration(configuration);
  5. container.start();
  6. } catch (Exception e) {
  7. throw new ContainerException(new Message(Messages.FAILED_TO_CONFIGURE_CONTAINER), e);
  8. }
  9. }

代码示例来源:origin: org.mule/mule-core

  1. public String getMessage()
  2. {
  3. return message + (nextMessage != null ? ". " + nextMessage.getMessage() : "");
  4. }

相关文章