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

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

本文整理了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

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

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

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

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

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

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

/**
 * Factory method to create a new {@link Message} instance that is filled with the formatted
 * message with id <code>code</code> from the resource bundle <code>bundlePath</code>.
 * 
 * <b>Attention:</b> do not confuse this method with 
 * <code>createMessage(String, int, Object)</code>.
 * 
 * @param bundlePath complete path to the resource bundle for lookup
 * @param code numeric code of the message
 * @param arguments
 * @see #getBundlePath(String)
 */
protected Message createMessage(String bundlePath, int code, Object... arguments)
{
  String messageString = getString(bundlePath, code, arguments);
  return new Message(messageString, code, arguments);
}

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

public void configure(Reader configuration) throws ContainerException
{
  try {
    container.setConfiguration(configuration);
    container.start();
  } catch (Exception e) {
    throw new ContainerException(new Message(Messages.FAILED_TO_CONFIGURE_CONTAINER), e);
  }
}

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

public void initialise() throws InitialisationException, RecoverableException
{
  if (configFile == null) {
    return;
  }
  try {
    URL url = IOUtils.getResourceAsUrl(configFile, getClass());
    if (url == null) {
      throw new ConfigurationException(new Message(Messages.CANT_LOAD_X_FROM_CLASSPATH_FILE, configFile));
    }
    container.setConfiguration(url);
    container.start();
  } catch (Exception e) {
    throw new InitialisationException(new Message(Messages.FAILED_TO_CREATE_X_WITH_X,
                           "Plexus container",
                           this.configFile), this);
  }
}

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

public void initialise(Object component) throws InitialisationException
  {
    // only call this once
    if (invoked)
    {
      return;
    }
    if (component instanceof GlueInitialisable)
    {
      logger.debug("Calling Glue initialisation for component: " + component.getClass().getName());
      ((GlueInitialisable)component).initialise(service, context);
    }
    invoked = true;
    try
    {
      logger.debug("Publishing service " + servicePath + " to Glue registry.");
      Registry.publish(servicePath, service, context);
    }
    catch (RegistryException e)
    {
      throw new InitialisationException(new Message("soap", 3, component.getClass().getName()), e, this);
    }
  }
}

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

/**
 * Template method to dispose any resources associated with this receiver. There
 * is not need to dispose the connector as this is already done by the framework
 */
protected void doDispose()
{
  try
  {
    Registry.unpublish(component.getDescriptor().getName());
  }
  catch (RegistryException e)
  {
    logger.error(new Message(Messages.FAILED_TO_UNREGISTER_X_ON_ENDPOINT_X, component.getDescriptor()
      .getName(), endpoint.getEndpointURI()), e);
  }
}

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

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

相关文章

微信公众号

最新文章

更多