@Override protected String generateMessage(Message message) { return message.getMessage(); }
public KeyedPoolMessageDispatcherFactoryAdapter(MessageDispatcherFactory factory) { super(); if (factory == null) { throw new IllegalArgumentException(CoreMessages.objectIsNull("factory").toString()); } this.factory = factory; }
/** * 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); }
/** * Will shut down the server displaying the cause and time of the shutdown * * @param e the exception that caused the shutdown */ public void shutdown(Throwable e) throws MuleException { Message msg = CoreMessages.fatalErrorWhileRunning(); MuleException muleException = ExceptionHelper.getRootMuleException(e); if (muleException != null) { logger.fatal(muleException.getDetailedMessage()); } else { logger.fatal(msg.toString() + " " + e.getMessage(), e); } List<String> msgs = new ArrayList<String>(); msgs.add(msg.getMessage()); Throwable root = ExceptionHelper.getRootException(e); msgs.add(root.getMessage() + " (" + root.getClass().getName() + ")"); msgs.add(" "); msgs.add(CoreMessages.fatalErrorInShutdown().getMessage()); String shutdownMessage = StringMessageUtils.getBoilerPlate(msgs, '*', 80); logger.fatal(shutdownMessage); unregisterShutdownHook(); doShutdown(); System.exit(1); }
public int getMessageCode() { return (i18nMessage == null ? 0 : i18nMessage.getCode()); }
logger.fatal(msg.toString() + " " + e.getMessage(), e); msgs.add(msg.getMessage()); Throwable root = ExceptionHelper.getRootException(e); msgs.add(root.getMessage() + " (" + root.getClass().getName() + ")"); msgs.add(" "); msgs.add(CoreMessages.fatalErrorInShutdown().getMessage()); String shutdownMessage = StringMessageUtils.getBoilerPlate(msgs, '*', 80); logger.fatal(shutdownMessage);
public String toString() { return this.getMessage(); } }
public KeyedPoolMessageRequesterFactoryAdapter(MessageRequesterFactory factory) { super(); if (factory == null) { throw new IllegalArgumentException(CoreMessages.objectIsNull("factory").toString()); } this.factory = factory; }
if (tempJob == null) throw new JobExecutionException(QuartzMessages.invalidPayloadType().getMessage()); throw new JobExecutionException(QuartzMessages.invalidJobObject().getMessage()); throw new JobExecutionException(QuartzMessages.invalidJobObject().toString());
/** * 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); }
/** * @param message the exception message */ public MuleRuntimeException(Message message) { super(message.getMessage()); }
public void setCookieSpec(String cookieSpec) { if (!(COOKIE_SPEC_NETSCAPE.equalsIgnoreCase(cookieSpec) || COOKIE_SPEC_RFC2109.equalsIgnoreCase(cookieSpec))) { throw new IllegalArgumentException( CoreMessages.propertyHasInvalidValue("cookieSpec", cookieSpec).toString()); } this.cookieSpec = cookieSpec; }
/** * 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); }
/** * @param message the exception message * @param cause the exception that triggered this exception */ public MuleRuntimeException(Message message, Throwable cause) { super(message.getMessage(), cause); }
/** * An optional error message can be set if the invocation state is not {@link org.mule.api.model.InvocationResult.State#SUCCESSFUL} * * @param message the error message */ public void setErrorMessage(String message) { if (state == State.SUCCESSFUL) { throw new IllegalStateException(CoreMessages.invocationSuccessfulCantSetError().toString()); } errorMessage = message; }
/** * 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); }
@Override protected String generateMessage(Message message) { return message.getMessage(); } }
@Override public void setName(String newName) { if (newName == null) { throw new IllegalArgumentException(CoreMessages.objectIsNull("Connector name").toString()); } if (logger.isDebugEnabled()) { logger.debug("Set Connector name to: " + newName); } name = newName; }
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); } }
public String getMessage() { return message + (nextMessage != null ? ". " + nextMessage.getMessage() : ""); }