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); } }
private void validateOnlyLastAcceptsAll() { for (int i = 0; i < exceptionListeners.size() - 1; i++) { MessagingExceptionHandlerAcceptor messagingExceptionHandlerAcceptor = exceptionListeners.get(i); if (messagingExceptionHandlerAcceptor.acceptsAll()) { throw new MuleRuntimeException(CoreMessages.createStaticMessage("Only last exception strategy inside <choice-exception-strategy> can accept any message. Maybe expression attribute is empty.")); } } }
private MuleEvent executeCallback(final Callback callback, PhaseResultNotifier phaseResultNotifier) { try { return callback.execute(); } catch (Exception callbackException) { phaseResultNotifier.phaseFailure(callbackException); throw new MuleRuntimeException(callbackException); } }
public static Operation createFromByteRepresentation(byte byteRepresentation) { for (Operation operation : values()) { if (operation.byteRepresentation == byteRepresentation) { return operation; } } throw new MuleRuntimeException(CoreMessages.createStaticMessage("Unexpected byte representation value: " + byteRepresentation)); } }
@Override public void processMatch(String matchedValue) { try { message.addOutboundAttachment(matchedValue,message.getInboundAttachment(matchedValue)); } catch (Exception e) { throw new MuleRuntimeException(e); } } });
@Override public void setObjectFactory(ObjectFactory objectFactory) { if (!(Callable.class.isAssignableFrom(objectFactory.getObjectClass()))) { throw new MuleRuntimeException(CoreMessages.objectNotOfCorrectType(objectFactory.getObjectClass(), Callable.class)); } super.setObjectFactory(objectFactory); } }
@Override public void registerListener(ServerNotificationListener l, String resourceIdentifier) throws NotificationException { ServerNotificationManager notificationManager = getNotificationManager(); if (notificationManager == null) { throw new MuleRuntimeException(CoreMessages.serverNotificationManagerNotEnabled()); } notificationManager.addListenerSubscription(l, resourceIdentifier); }
protected MuleEventContext getEventContext() { if(RequestContext.getEventContext()==null) { throw new MuleRuntimeException(CoreMessages.objectIsNull("MuleEventContext")); } else { return RequestContext.getEventContext(); } }
protected void prepareToBuildEndpoint() { // use an explicit value here to avoid caching Map<Object, Object> props = getProperties(); // this sets values used below, if they appear as properties setPropertiesFromProperties(props); if (uriBuilder == null) { throw new MuleRuntimeException(CoreMessages.objectIsNull("uriBuilder")); } uriBuilder.setMuleContext(muleContext); }