protected Class getKeyType() { throw new MuleRuntimeException(CoreMessages.createStaticMessage("Transaction type: " + this.getClass().getName() + " doesn't support supports(..) method")); } }
protected ServerNotification createNotification(MuleContext context, String action) { try { return (ServerNotification)ctor.newInstance(context, action); } catch (Exception e) { throw new MuleRuntimeException(CoreMessages.failedToCreate("Notification:" + action) ,e); } } }
public void setLifecycleManager(LifecycleManager manager) { if (!(manager instanceof MuleContextLifecycleManager)) { Message msg = MessageFactory.createStaticMessage( "lifecycle manager for MuleContext must be a MuleContextLifecycleManager"); throw new MuleRuntimeException(msg); } lifecycleManager = (MuleContextLifecycleManager) manager; }
@Override public void preProcess(PropertyConfiguration config, Element element) { if (element.hasAttribute("name")) { throw new MuleRuntimeException(CoreMessages.createStaticMessage("name attribute on exception strategy is only allowed on global exception strategies")); } } };
@Override public <T> T inject(T object) { try { return initialiseObject((ConfigurableApplicationContext) applicationContext, EMPTY, object); } catch (LifecycleException e) { throw new MuleRuntimeException(e); } }
private void failIfHeaderDoesNotSupportMultipleValues(String headerName) { if (calculatedHeadersNames.contains(headerName)) { throw new MuleRuntimeException(CoreMessages.createStaticMessage("Header: " + headerName + " does not support multiple values")); } }
@Override public void preProcess(PropertyConfiguration config, Element element) { if (element.hasAttribute("name")) { throw new MuleRuntimeException(CoreMessages.createStaticMessage("name attribute on exception strategy is only allowed on global exception strategies")); } } };
@Override public void processMatch(String matchedValue) { try { message.removeOutboundAttachment(matchedValue); } catch (Exception e) { throw new MuleRuntimeException(e); } } });
@Override public MessageExchangePattern getDefaultExchangePattern() { try { return serviceDescriptor.getDefaultExchangePattern(); } catch (TransportServiceException tse) { throw new MuleRuntimeException(tse); } }
@Override public List<MessageExchangePattern> getInboundExchangePatterns() { try { return serviceDescriptor.getInboundExchangePatterns(); } catch (TransportServiceException tse) { throw new MuleRuntimeException(tse); } }
@Override public List<MessageExchangePattern> getOutboundExchangePatterns() { try { return serviceDescriptor.getOutboundExchangePatterns(); } catch (TransportServiceException tse) { throw new MuleRuntimeException(tse); } }
@Override public int size() { try { return this.objectStore.allKeys().size(); } catch (ObjectStoreException e) { throw new MuleRuntimeException(e); } }
protected synchronized void createStoreDirectory(File directory) { // To support concurrency we need to check if directory exists again inside // synchronized method if (!directory.exists() && !directory.mkdirs()) { Message message = CoreMessages.failedToCreate("object store directory " + directory.getAbsolutePath()); throw new MuleRuntimeException(message); } }
public PartitionedMessageSequence(MessageSequence<Q> seq, int groupSize) { if (groupSize <= 1) { throw new MuleRuntimeException(MessageFactory.createStaticMessage("group size must be greater than 1")); } this.delegate = seq; this.groupSize = groupSize; }
@Override public boolean isEmpty() { try { return this.objectStore.allKeys().isEmpty(); } catch (ObjectStoreException e) { throw new MuleRuntimeException(e); } }
@Override public boolean containsKey(Object key) { try { return this.objectStore.contains((Serializable) key); } catch (ObjectStoreException e) { throw new MuleRuntimeException(e); } }
@Override public void clear() { try { objectStore.clear(); } catch (ObjectStoreException e) { throw new MuleRuntimeException(e); } }
private int retrieveMaximumHeaderSectionSize() { try { return valueOf(getProperty(MAXIMUM_HEADER_SECTION_SIZE_PROPERTY_KEY, String.valueOf(DEFAULT_MAX_HTTP_PACKET_HEADER_SIZE))); } catch (NumberFormatException e) { throw new MuleRuntimeException(CoreMessages.createStaticMessage(String.format("Invalid value %s for %s configuration", getProperty(MAXIMUM_HEADER_SECTION_SIZE_PROPERTY_KEY), MAXIMUM_HEADER_SECTION_SIZE_PROPERTY_KEY)), e); } }
private int retrieveMaximumHeaderSectionSize() { try { return valueOf(getProperty(CUSTOM_MAX_HTTP_PACKET_HEADER_SIZE, String.valueOf(DEFAULT_MAX_HTTP_PACKET_HEADER_SIZE))); } catch (NumberFormatException e) { throw new MuleRuntimeException(CoreMessages.createStaticMessage(String.format("Invalid value %s for %s configuration.", getProperty(CUSTOM_MAX_HTTP_PACKET_HEADER_SIZE), CUSTOM_MAX_HTTP_PACKET_HEADER_SIZE)), e); } }
@Override public XMLGregorianCalendar toXMLCalendar() throws DatatypeConfigurationException { if (calendar instanceof GregorianCalendar) { return datatypeFactory.newXMLGregorianCalendar((GregorianCalendar) calendar); } else { throw new MuleRuntimeException( CoreMessages.createStaticMessage("org.mule.el.DateTime.toXMLCalendar() does not support non-gregorian calendars.")); } }