public String getAddress() { EndpointURI uri = getEndpointURI(); if (uri != null) { return uri.getUri().toString(); } else { return null; } }
public String getAddress() { EndpointURI uri = getEndpointURI(); if (uri != null) { return uri.getUri().toString(); } else { return null; } }
public String getAddress() { EndpointURI uri = getEndpointURI(); if (uri != null) { return uri.getUri().toString(); } else { return null; } }
private static String getEndpointDescription(InboundEndpoint endpoint) { String endpointString = endpoint.getName(); if (endpointString == null) { endpointString = endpoint.getEndpointURI().getUri().toString(); } return endpointString; }
@Override public MessageReceiver lookupReceiver(final String key) { if (key != null) { final URI keyUri = URI.create(key); for (MessageReceiver receiver : receivers.values()) { if (uriMatchesReceiver(keyUri, receiver.getEndpointURI().getUri())) { return receiver; } } return null; } else { throw new IllegalArgumentException("Receiver key must not be null"); } }
protected String getConnectEventId(ImmutableEndpoint endpoint) { return connector.getName() + ".dispatcher(" + endpoint.getEndpointURI().getUri() + ")"; }
public UdpMessageReceiver(Connector connector, FlowConstruct flowConstruct, InboundEndpoint endpoint) throws CreateException { super(connector, flowConstruct, endpoint); bufferSize = ((UdpConnector) connector).getReceiveBufferSize(); uri = endpoint.getEndpointURI().getUri(); try { if (!"null".equalsIgnoreCase(uri.getHost())) { inetAddress = InetAddress.getByName(uri.getHost()); } } catch (UnknownHostException e) { throw new CreateException(UdpMessages.failedToLocateHost(uri), e, this); } }
private void processCookies(Object cookieObject, String policy, MuleEvent event) { URI uri = this.getEndpoint().getEndpointURI().getUri(); CookieHelper.addCookiesToClient(this.client, cookieObject, policy, event, uri); }
synchronized void addConnection(final EndpointURI endpointURI) { try { String endpointKey = getKeyForEndpointUri(endpointURI); if (socketDispatchers.containsKey(endpointKey)) { socketDispatcherCount.put(endpointKey, socketDispatcherCount.get(endpointKey) + 1); } else { ServerSocket serverSocket = connector.getServerSocket(endpointURI.getUri()); HttpRequestDispatcher httpRequestDispatcher = new HttpRequestDispatcher(connector, connector.getRetryPolicyTemplate(), serverSocket, workManager); socketDispatchers.put(endpointKey, httpRequestDispatcher); socketDispatcherCount.put(endpointKey, new Integer(1)); workManager.scheduleWork(httpRequestDispatcher, WorkManager.INDEFINITE, null, connector); } } catch (Exception e) { throw new MuleRuntimeException(e); } }
public MuleEvent process(MuleEvent event) throws MuleException { // If the endpoint has a logical name, use it, otherwise use the URI. String inboundEndpoint = endpoint.getName(); if (StringUtils.isBlank(inboundEndpoint)) { // URI inboundEndpoint = endpoint.getEndpointURI().getUri().toString(); } event.getMessage().setProperty(MuleProperties.MULE_ORIGINATING_ENDPOINT_PROPERTY, inboundEndpoint, PropertyScope.INBOUND); return event; }
protected void warnIfMuleClientSendUsed(MuleMessage message) { final Object remoteSyncProperty = message.removeProperty(MuleProperties.MULE_REMOTE_SYNC_PROPERTY, PropertyScope.INBOUND); if (ObjectUtils.getBoolean(remoteSyncProperty, false) && !endpoint.getExchangePattern().hasResponse()) { logger.warn("MuleClient.send() was used but inbound endpoint " + endpoint.getEndpointURI().getUri().toString() + " is not 'request-response'. No response will be returned."); } message.removeProperty(MuleProperties.MULE_REMOTE_SYNC_PROPERTY, PropertyScope.INBOUND); }
protected void warnIfMuleClientSendUsed(MuleMessage message) { final Object remoteSyncProperty = message.removeProperty(MuleProperties.MULE_REMOTE_SYNC_PROPERTY, PropertyScope.INBOUND); if (ObjectUtils.getBoolean(remoteSyncProperty, false) && !messageReceiver.getEndpoint().getExchangePattern().hasResponse()) { logger.warn("MuleClient.send() was used but inbound endpoint " + messageReceiver.getEndpoint().getEndpointURI().getUri().toString() + " is not 'request-response'. No response will be returned."); } message.removeProperty(MuleProperties.MULE_REMOTE_SYNC_PROPERTY, PropertyScope.INBOUND); }
else if (endpointName.equals(ep.getEndpointURI().getUri().toString()))
protected HttpMethod execute(MuleEvent event, HttpMethod httpMethod) throws Exception { // TODO set connection timeout buffer etc try { URI uri = endpoint.getEndpointURI().getUri(); this.processCookies(event); this.processMuleSession(event, httpMethod); // TODO can we use the return code for better reporting? client.executeMethod(getHostConfig(uri), httpMethod); return httpMethod; } catch (IOException e) { // TODO employ dispatcher reconnection strategy at this point throw new DispatchException(event, getEndpoint(), e); } catch (Exception e) { throw new DispatchException(event, getEndpoint(), e); } }
@Override protected void doConnect() throws ConnectException { disposing.set(false); URI uri = endpoint.getEndpointURI().getUri(); try { serverSocket = ((TcpConnector) connector).getServerSocket(uri); } catch (Exception e) { throw new ConnectException(TcpMessages.failedToBindToUri(uri), e, this); } try { getWorkManager().scheduleWork(this, WorkManager.INDEFINITE, null, connector); } catch (WorkException e) { throw new ConnectException(CoreMessages.failedToScheduleWork(), e, this); } }
private static URI resolveUri(final HttpRequestContext requestContext) { URIBuilder uriBuilder = new URIBuilder(); uriBuilder.setProtocol(requestContext.getScheme()); uriBuilder.setHost(resolveTargetHost(requestContext.getRequest())); uriBuilder.setPath(requestContext.getRequest().getPath()); return uriBuilder.getEndpoint().getUri(); }
private void initialise(EndpointURI endpointUri) { this.address = endpointUri.getAddress(); if (this.endpointName == null) { this.endpointName = endpointUri.getEndpointName(); } this.connectorName = endpointUri.getConnectorName(); this.transformers = endpointUri.getTransformers(); this.responseTransformers = endpointUri.getResponseTransformers(); this.params = endpointUri.getParams(); this.uri = endpointUri.getUri(); this.resourceInfo = endpointUri.getResourceInfo(); this.userInfo = endpointUri.getUserInfo(); }
requestChainBuilder.setName("OutboundEndpoint '" + endpoint.getEndpointURI().getUri() + "' request chain"); responseChainBuilder.setName("OutboundEndpoint '" + endpoint.getEndpointURI().getUri() + "' response chain"); compositeChainBuilder.setName("OutboundEndpoint '" + endpoint.getEndpointURI().getUri() + "' composite request/response chain"); compositeChainBuilder.chain(requestChainBuilder.build(), responseChainBuilder.build()); return compositeChainBuilder.build();
requestChainBuilder.setName("InboundEndpoint '" + endpoint.getEndpointURI().getUri() + "' request chain"); responseChainBuilder.setName("InboundEndpoint '" + endpoint.getEndpointURI().getUri() + "' response chain"); compositeChainBuilder.setName("InboundEndpoint '"+ endpoint.getEndpointURI().getUri() +"' composite request/response chain"); compositeChainBuilder.chain(requestChainBuilder.build(), responseChainBuilder.build()); return compositeChainBuilder.build();
public DefaultMuleEvent(MuleMessage message, InboundEndpoint endpoint, FlowConstruct flowConstruct, MuleSession session, ReplyToHandler replyToHandler, Object replyToDestination, OutputStream outputStream) { this.id = generateEventId(message.getMuleContext()); this.flowConstruct = flowConstruct; this.session = session; setMessage(message); this.outputStream = outputStream; this.processingTime = ProcessingTime.newInstance(this); this.replyToHandler = replyToHandler; this.replyToDestination = replyToDestination; this.credentials = extractCredentials(endpoint); this.encoding = endpoint.getEncoding(); this.exchangePattern = endpoint.getExchangePattern(); this.messageSourceName = endpoint.getName(); this.messageSourceURI = endpoint.getEndpointURI().getUri(); this.timeout = endpoint.getResponseTimeout(); this.transacted = endpoint.getTransactionConfig().isTransacted(); fillProperties(endpoint); this.synchronous = resolveEventSynchronicity(); this.nonBlocking = isFlowConstructNonBlockingProcessingStrategy(); }