/** * Depending on the session state this methods either Passes an event synchronously to the next * available Mule UMO in the pool or via the endpoint configured for the event * * @param message the event message payload to send * @param endpoint The endpoint to disptch the event through. * @return the return Message from the call or null if there was no result * @throws org.mule.umo.UMOException if the event fails to be processed by the component or the * transport for the endpoint */ public UMOMessage sendEvent(UMOMessage message, UMOEndpoint endpoint) throws UMOException { // If synchronous receive has not been explicitly set, default it to // true setRemoteSync(message, endpoint); UMOMessage result = session.sendEvent(message, endpoint); return result; }
/** * Depending on the session state this methods either Passes an event synchronously to the next * available Mule UMO in the pool or via the endpointUri configured for the event * * @param message the event message payload to send * @param endpointUri The endpointUri to disptch the event through * @return the return Message from the call or null if there was no result * @throws org.mule.umo.UMOException if the event fails to be processed by the component or the * transport for the endpointUri */ public UMOMessage sendEvent(UMOMessage message, UMOEndpointURI endpointUri) throws UMOException { UMOEndpoint endpoint = MuleEndpoint.getOrCreateEndpointForUri(endpointUri, UMOEndpoint.ENDPOINT_TYPE_SENDER); // If synchronous receive has not been explicitly set, default it to // true setRemoteSync(message, endpoint); return session.sendEvent(message, endpoint); }
public synchronized UMOMessage catchMessage( UMOMessage message, UMOSession session, boolean synchronous) throws RoutingException { UMOEvent event = RequestContext.getEvent(); try { event = new MuleEvent(message, event.getEndpoint(), session.getComponent(), event); if (synchronous) { statistics.incrementRoutedMessage(event.getEndpoint()); logger.info( "Event being routed from catch all strategy for endpoint: " + RequestContext.getEvent().getEndpoint()); return session.getComponent().sendEvent(event); } else { statistics.incrementRoutedMessage(event.getEndpoint()); session.getComponent().dispatchEvent(event); return null; } } catch (UMOException e) { throw new ComponentRoutingException( event.getMessage(), event.getEndpoint(), session.getComponent(), e); } }
protected Object invokeAction(AdminNotification action, UMOEventContext context) throws UMOException { String destComponent = null; UMOMessage result = null; String endpoint = action.getResourceIdentifier(); if (action.getResourceIdentifier().startsWith("mule:")) { destComponent = endpoint.substring(endpoint.lastIndexOf("/") + 1); } else { destComponent = endpoint; } if (destComponent != null) { UMOSession session = MuleManager.getInstance().getModel().getComponentSession(destComponent); // Need to do this otherise when the event is invoked the // transformer associated with the Mule Admin queue will be invoked, but // the // message will not be of expected type UMOEndpoint ep = new MuleEndpoint(RequestContext.getEvent().getEndpoint()); ep.setTransformer(null); UMOEvent event = new MuleEvent(action.getMessage(), ep, context.getSession(), context.isSynchronous()); RequestContext.setEvent(event); if (context.isSynchronous()) { result = session.getComponent().sendEvent(event); ByteArrayOutputStream out = new ByteArrayOutputStream(); wireFormat.write(out, result); return out.toByteArray(); } else { session.getComponent().dispatchEvent(event); return null; } } else { return handleException( result, new MuleException( new Message( Messages.COULD_NOT_DETERMINE_DESTINATION_COMPONENT_FROM_ENDPOINT_X, endpoint))); } }
/** * Requests a synchronous receive of an event on the component * * @param endpointUri the endpointUri on which the event will be received * @param timeout time in milliseconds before the request timesout * @return The requested event or null if the request times out * @throws org.mule.umo.UMOException if the request operation fails */ public UMOMessage receiveEvent(UMOEndpointURI endpointUri, long timeout) throws UMOException { UMOEndpoint endpoint = MuleEndpoint.getOrCreateEndpointForUri(endpointUri, UMOEndpoint.ENDPOINT_TYPE_SENDER); return session.receiveEvent(endpoint, timeout); }
/** * Requests a synchronous receive of an event on the component * * @param endpointName the endpoint identifing the endpointUri on ewhich the event will be * received * @param timeout time in milliseconds before the request timesout * @return The requested event or null if the request times out * @throws org.mule.umo.UMOException if the request operation fails */ public UMOMessage receiveEvent(String endpointName, long timeout) throws UMOException { return session.receiveEvent(endpointName, timeout); }
/** * Requests a synchronous receive of an event on the component * * @param endpoint the endpoint identifing the endpointUri on ewhich the event will be received * @param timeout time in milliseconds before the request timesout * @return The requested event or null if the request times out * @throws org.mule.umo.UMOException if the request operation fails */ public UMOMessage receiveEvent(UMOEndpoint endpoint, long timeout) throws UMOException { return session.receiveEvent(endpoint, timeout); }
/** * Depending on the session state this methods either Passes an event asynchronously to the next * available Mule UMO in the pool or via the endpoint configured for the event * * @param message the event message payload to send * @param endpoint The endpoint name to disptch the event through. * @throws org.mule.umo.UMOException if the event fails to be processed by the component or the * transport for the endpoint */ public void dispatchEvent(UMOMessage message, UMOEndpoint endpoint) throws UMOException { session.dispatchEvent(message, endpoint); }
/** * Depending on the session state this methods either Passes an event asynchronously to the next * available Mule UMO in the pool or via the endpoint configured for the event * * @param message the event message payload to send * @param endpointName The endpoint name to disptch the event through. This will be looked up * first on the component configuration and then on the mule manager configuration * @throws org.mule.umo.UMOException if the event fails to be processed by the component or the * transport for the endpoint */ public void dispatchEvent(UMOMessage message, String endpointName) throws UMOException { session.dispatchEvent(message, endpointName); }
/** * Depending on the session state this methods either Passes an event asynchronously to the next * available Mule UMO in the pool or via the endpointUri configured for the event * * @param message the event message payload to send * @param endpointUri the endpointUri to dispatc the event to first on the component configuration * and then on the mule manager configuration * @throws org.mule.umo.UMOException if the event fails to be processed by the component or the * transport for the endpointUri */ public void dispatchEvent(UMOMessage message, UMOEndpointURI endpointUri) throws UMOException { UMOEndpoint endpoint = MuleEndpoint.getOrCreateEndpointForUri(endpointUri, UMOEndpoint.ENDPOINT_TYPE_SENDER); session.dispatchEvent(message, endpoint); }
/** * This will dispatch an event asynchronously via the configured outbound endpoint on the * component for this session * * @param message the message to send * @throws org.mule.umo.UMOException if there is no outbound endpoint configured on the component * or the events fails during dispatch */ public void dispatchEvent(UMOMessage message) throws UMOException { session.dispatchEvent(message); }
/** * This will dispatch an event asynchronously via the configured outbound endpoint on the * component for this session * * @param message payload to dispatch * @throws org.mule.umo.UMOException if there is no outbound endpoint configured on the component * or the events fails during dispatch */ public void dispatchEvent(Object message) throws UMOException { session.dispatchEvent(new MuleMessage(message, event.getProperties())); }
/** * Depending on the session state this methods either Passes an event synchronously to the next * available Mule UMO in the pool or via the endpoint configured for the event * * @param message the event message payload to send * @param endpointName The endpoint name to disptch the event through. This will be looked up * first on the component configuration and then on the mule manager configuration * @return the return Message from the call or null if there was no result * @throws org.mule.umo.UMOException if the event fails to be processed by the component or the * transport for the endpoint */ public UMOMessage sendEvent(UMOMessage message, String endpointName) throws UMOException { UMOEndpoint endpoint = MuleManager.getInstance().lookupEndpoint(endpointName); setRemoteSync(message, endpoint); return session.sendEvent(message, endpoint); }
/** * Depending on the session state this methods either Passes an event synchronously to the next * available Mule UMO in the pool or via the endpoint configured for the event * * @param message the message payload to send * @return the return Message from the call or null if there was no result * @throws org.mule.umo.UMOException if the event fails to be processed by the component or the * transport for the endpoint */ public UMOMessage sendEvent(UMOMessage message) throws UMOException { // If synchronous receive has not been explicitly set, default it to // true setRemoteSync(message, event.getEndpoint()); return session.sendEvent(message); }