protected synchronized OutboundEndpoint getEndpoint(MuleContext muleContext, String uri) throws MuleException { if (endpoints.get(uri) != null) { return endpoints.get(uri); } OutboundEndpoint endpoint = muleContext.getEndpointFactory().getOutboundEndpoint(uri); endpoints.put(uri, endpoint); return endpoint; }
public OutboundEndpoint load(String key) throws Exception { EndpointFactory endpointFactory = muleContext.getEndpointFactory(); EndpointBuilder endpointBuilder = endpointFactory.getEndpointBuilder(key); return endpointFactory.getOutboundEndpoint(endpointBuilder); } };
/** * {@inheritDoc}. */ @Override public MuleMessage request(String uri, long timeout) throws Exception { return request(getMuleContext().getEndpointFactory().getInboundEndpoint(uri), timeout); }
protected OutboundEndpoint getOutboundEndpoint(String uri) throws MuleException { EndpointFactory factory = muleContext.getEndpointFactory(); EndpointBuilder endpointBuilder = factory.getEndpointBuilder(uri); endpointBuilder.setExchangePattern(MessageExchangePattern.ONE_WAY); return factory.getOutboundEndpoint(endpointBuilder); } }
protected RemoteDispatcher(String endpoint, MuleContext muleContext) throws MuleException { this.muleContext = muleContext; serializer = muleContext.getObjectSerializer(); EndpointFactory endpointFactory = muleContext.getEndpointFactory(); asyncServerEndpoint = endpointFactory.getOutboundEndpoint(endpoint); EndpointBuilder endpointBuilder = endpointFactory.getEndpointBuilder(endpoint); endpointBuilder.setExchangePattern(MessageExchangePattern.REQUEST_RESPONSE); syncServerEndpoint = muleContext.getEndpointFactory().getOutboundEndpoint( endpointBuilder); wireFormat = requestWireFormat(); }
private OutboundEndpoint createOutboundEndpoint() throws MuleException { EndpointBuilder builder = muleContext.getEndpointFactory().getEndpointBuilder(serviceAddress); if (connector != null) { String protocol = new MuleEndpointURI(serviceAddress, muleContext).getScheme(); if (!connector.supportsProtocol(protocol)) { throw new IllegalStateException(String.format("Connector %s does not support protocol: %s", connector.getName(), protocol)); } builder.setConnector(connector); } return muleContext.getEndpointFactory().getOutboundEndpoint(builder); }
@Override public Object doGetObject() throws Exception { EndpointFactory ef = muleContext.getEndpointFactory(); if (ef != null) { return ef.getInboundEndpoint(this); } else { throw new ConfigurationException(MessageFactory.createStaticMessage("EndpointFactory not found in Registry")); } }
/** * Requests a synchronous receive of an event on the service * * @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.api.MuleException if the request operation fails */ public MuleMessage requestEvent(EndpointURI endpointUri, long timeout) throws MuleException { InboundEndpoint endpoint = getMuleContext().getEndpointFactory().getInboundEndpoint( endpointUri); return requestEvent(endpoint, timeout); }
protected EndpointBuilder getEndpointBuilder(AnnotatedEndpointData epData) throws MuleException { String uri = parsePlaceholderValues(epData.getAddress()); EndpointBuilder endpointBuilder = muleContext.getEndpointFactory().getEndpointBuilder(uri); endpointBuilder.setMuleContext(muleContext); return endpointBuilder; }
@Override protected String getWsdlContents(final MuleEvent event) throws Exception { String wsdlAddress = wsdlAddressProvider.get(event); String wsdlString; final MuleContext muleContext = event.getMuleContext(); final InboundEndpoint webServiceEndpoint = muleContext.getEndpointFactory().getInboundEndpoint( wsdlAddress); if (logger.isDebugEnabled()) { logger.debug("Retrieving WSDL from web service with: " + webServiceEndpoint); } final MuleMessage replyWSDL = webServiceEndpoint.request(event.getTimeout()); wsdlString = replyWSDL.getPayloadAsString(); return wsdlString; } }
@Override public Object doGetObject() throws Exception { EndpointFactory ef = muleContext.getEndpointFactory(); if (ef != null) { InboundEndpoint inboundEndpoint = ef.getInboundEndpoint(this); if (inboundEndpoint instanceof AbstractEndpoint) { AbstractEndpoint.class.cast(inboundEndpoint).setAnnotations(getAnnotations()); } return inboundEndpoint; } else { throw new ConfigurationException(MessageFactory.createStaticMessage("EndpointFactory not found in Registry")); } }
private InboundEndpoint createHttpInboundEndpoint() throws MuleException { EndpointURIEndpointBuilder inBuilder = new EndpointURIEndpointBuilder(localUrl, muleContext); inBuilder.setConnector((Connector) connectorDelegate.getConnector()); inBuilder.setExchangePattern(MessageExchangePattern.REQUEST_RESPONSE); EndpointFactory endpointFactory = muleContext.getEndpointFactory(); return endpointFactory.getInboundEndpoint(inBuilder); }
private InboundEndpoint createHttpInboundEndpoint() throws MuleException { EndpointURIEndpointBuilder inBuilder = new EndpointURIEndpointBuilder(localUrl, muleContext); inBuilder.setConnector(createConnector()); inBuilder.setExchangePattern(MessageExchangePattern.REQUEST_RESPONSE); EndpointFactory endpointFactory = muleContext.getEndpointFactory(); return endpointFactory.getInboundEndpoint(inBuilder); }
protected OutboundEndpoint getOrBuildOutboundEndpoint(MuleContext muleContext) throws MuleException { if (outboundEndpoint != null) { return outboundEndpoint; } if (outboundEndpointBuilder == null) { outboundEndpointBuilder = muleContext.getEndpointFactory().getEndpointBuilder(outboundAddress); } outboundEndpointBuilder.setExchangePattern(getOutboundMessageExchangePattern()); doConfigureOutboundEndpointBuilder(muleContext, outboundEndpointBuilder); return outboundEndpointBuilder.buildOutboundEndpoint(); }
protected InboundEndpoint getOrBuildInboundEndpoint(MuleContext muleContext) throws MuleException { if (inboundEndpoint != null) { return inboundEndpoint; } if (inboundEndpointBuilder == null) { inboundEndpointBuilder = muleContext.getEndpointFactory().getEndpointBuilder(inboundAddress); } inboundEndpointBuilder.setExchangePattern(getInboundMessageExchangePattern()); doConfigureInboundEndpointBuilder(muleContext, inboundEndpointBuilder); return inboundEndpointBuilder.buildInboundEndpoint(); }
private MuleMessage request() throws MuleException, Exception { String endpointUri = jobConfig.getEndpointRef(); MuleContext context = receiver.getEndpoint().getMuleContext(); InboundEndpoint inboundEndpoint = context.getEndpointFactory().getInboundEndpoint(endpointUri); int timeout = jobConfig.getTimeout(); return inboundEndpoint.request(timeout); } };
private static EndpointBuilder createInboundBuilder(MuleContext context, AnnotatedEndpointData epData) { try { EndpointBuilder builder = context.getEndpointFactory().getEndpointBuilder("dynamic://null"); builder.setExchangePattern(epData.getMep()); builder.setConnector(epData.getConnector()); builder.setName(epData.getName()); builder.setProperties(epData.getProperties() == null ? new HashMap() : epData.getProperties()); return builder; } catch (MuleException e) { throw new RuntimeException(e); } }
public Object doGetObject() throws Exception { // If this is a meta endpoint, then we can wrap it using the meta endpoint builder from the TransportServiceDescriptor String scheme = getEndpointBuilder().getEndpoint().getFullScheme(); TransportServiceDescriptor tsd = (TransportServiceDescriptor) muleContext.getRegistry().lookupServiceDescriptor(ServiceType.TRANSPORT, scheme, null); EndpointBuilder endpointBuilder = tsd.createEndpointBuilder(this, muleContext); OutboundEndpoint outboundEndpoint = muleContext.getEndpointFactory().getOutboundEndpoint(endpointBuilder); if (outboundEndpoint instanceof AbstractEndpoint) { AbstractEndpoint.class.cast(outboundEndpoint).setAnnotations(getAnnotations()); } return outboundEndpoint; }
public ScheduleConfigBuilder(String scheduleId, MuleContext muleContext) throws MuleException { super(); this.scheduleId = scheduleId; endpointBuilder = muleContext.getEndpointFactory().getEndpointBuilder("quartz://" + scheduleId); endpointBuilder.setMuleContext(muleContext); endpointBuilder.setName(scheduleId); connector = new QuartzConnector(muleContext); connector.setName(scheduleId); endpointBuilder.setConnector(connector); endpointBuilder.setExchangePattern(MessageExchangePattern.ONE_WAY); }
protected OutboundEndpoint buildOutboundEndpoint(String recipient) throws MuleException { EndpointBuilder endpointBuilder = getMuleContext().getEndpointFactory().getEndpointBuilder(recipient); try { endpointBuilder = (EndpointBuilder) endpointBuilder.clone(); endpointBuilder.setTransactionConfig(transactionConfig); if (synchronous != null && synchronous) { endpointBuilder.setExchangePattern(MessageExchangePattern.REQUEST_RESPONSE); } } catch (CloneNotSupportedException e) { throw new DefaultMuleException(e); } return endpointBuilder.buildOutboundEndpoint(); }