org.mule.config.i18n.Message.<init>()方法的使用及代码示例

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

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

Message.<init>介绍

暂无

代码示例

代码示例来源: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/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. * 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. * 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-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.modules/mule-module-plexus

  1. public void initialise() throws InitialisationException, RecoverableException
  2. {
  3. if (configFile == null) {
  4. return;
  5. }
  6. try {
  7. URL url = IOUtils.getResourceAsUrl(configFile, getClass());
  8. if (url == null) {
  9. throw new ConfigurationException(new Message(Messages.CANT_LOAD_X_FROM_CLASSPATH_FILE, configFile));
  10. }
  11. container.setConfiguration(url);
  12. container.start();
  13. } catch (Exception e) {
  14. throw new InitialisationException(new Message(Messages.FAILED_TO_CREATE_X_WITH_X,
  15. "Plexus container",
  16. this.configFile), this);
  17. }
  18. }

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

  1. public void initialise(Object component) throws InitialisationException
  2. {
  3. // only call this once
  4. if (invoked)
  5. {
  6. return;
  7. }
  8. if (component instanceof GlueInitialisable)
  9. {
  10. logger.debug("Calling Glue initialisation for component: " + component.getClass().getName());
  11. ((GlueInitialisable)component).initialise(service, context);
  12. }
  13. invoked = true;
  14. try
  15. {
  16. logger.debug("Publishing service " + servicePath + " to Glue registry.");
  17. Registry.publish(servicePath, service, context);
  18. }
  19. catch (RegistryException e)
  20. {
  21. throw new InitialisationException(new Message("soap", 3, component.getClass().getName()), e, this);
  22. }
  23. }
  24. }

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

  1. /**
  2. * Template method to dispose any resources associated with this receiver. There
  3. * is not need to dispose the connector as this is already done by the framework
  4. */
  5. protected void doDispose()
  6. {
  7. try
  8. {
  9. Registry.unpublish(component.getDescriptor().getName());
  10. }
  11. catch (RegistryException e)
  12. {
  13. logger.error(new Message(Messages.FAILED_TO_UNREGISTER_X_ON_ENDPOINT_X, component.getDescriptor()
  14. .getName(), endpoint.getEndpointURI()), e);
  15. }
  16. }

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

  1. new Message("soap", 2, component.getDescriptor().getName()), this);
  2. throw new InitialisationException(new Message(Messages.CLASS_X_NOT_FOUND, e.getMessage()), e,
  3. this);
  4. throw new InitialisationException(new Message("soap", 3, component.getDescriptor().getName()), e,
  5. this);
  6. throw new InitialisationException(new Message(Messages.FAILED_TO_START_X, "Soap Server"), e, this);

相关文章