public String toString() { String address = "not set"; if(endpoint!=null) { address = endpoint.getEndpointURI().getAddress(); } return "RemoteDispatcherAgent{" + "remote-endpoint='" + address + "'" + "}"; }
@Override protected Object getReceiverKey(FlowConstruct flowConstruct, InboundEndpoint endpoint) { EndpointURI uri = endpoint.getEndpointURI(); return uri.getAddress(); }
public String getAddress() { return endpoint.getEndpointURI().getAddress(); }
/** * Should be a 1 line description of the agent */ @Override public String getDescription() { StringBuilder buf = new StringBuilder(); buf.append(getName()).append(": "); if (endpoint != null) { buf.append("Forwarding notifications to: ").append(endpoint.getEndpointURI().getAddress()); } return buf.toString(); }
@Override protected Object getReceiverKey(FlowConstruct flowConstruct, InboundEndpoint endpoint) { //you can have multiple Multicast sockets bound to a single port, // so store listeners with the service name too return endpoint.getEndpointURI().getAddress() + "/" + flowConstruct.getName(); } }
public static Message couldNotFindStreamWithName(ImmutableEndpoint endpoint) { String address = endpoint.getEndpointURI().getAddress(); return factory.createMessage(BUNDLE_PATH, 1, address); } }
@Override protected Object getReceiverKey(FlowConstruct flowConstruct, InboundEndpoint endpoint) { return flowConstruct.getName() + "~" + endpoint.getEndpointURI().getAddress(); }
@Override protected Object getReceiverKey(FlowConstruct flowConstruct, InboundEndpoint endpoint) { return endpoint.getEndpointURI().getAddress() + "/" + flowConstruct.getName(); } }
public static String getEndpointNameFor(EndpointURI endpointUri) { String address = endpointUri.getAddress(); if (StringUtils.isBlank(address)) { // for some endpoints in TCK like test://xxx address = endpointUri.toString(); } // Make sure we include the endpoint scheme in the name address = (address.indexOf(":/") > -1 ? address : endpointUri.getScheme() + SEPARATOR + address); return ENDPOINT_PREFIX + SEPARATOR + replaceObjectNameChars(address); }
/** * Should be a 1 line description of the agent */ public String getDescription() { return getName() + ": accepting connections on " + endpoint.getEndpointURI().getAddress(); }
@Override protected Object getReceiverKey(FlowConstruct flowConstruct, InboundEndpoint endpoint) { { return defaultIfEmpty(endpoint.getName(), endpoint.getEndpointURI().getAddress()); } }
@Override protected void doConnect() throws Exception { if (!endpoint.getExchangePattern().hasResponse()) { // Ensure we can create a vm queue QueueSession queueSession = connector.getQueueSession(); Queue q = queueSession.getQueue(endpoint.getEndpointURI().getAddress()); if (logger.isDebugEnabled()) { logger.debug("Current queue depth for queue: " + endpoint.getEndpointURI().getAddress() + " is: " + q.size()); } } }
@Override protected Object getReceiverKey(FlowConstruct flowConstruct, InboundEndpoint endpoint) { if (endpoint.getFilter() != null && endpoint.getFilter() instanceof FilenameWildcardFilter) { return endpoint.getEndpointURI().getAddress() + "/" + ((FilenameWildcardFilter) endpoint.getFilter()).getPattern(); } return endpoint.getEndpointURI().getAddress(); }
/** * The method determines the key used to store the receiver against. * * @param flowConstruct the service for which the endpoint is being registered * @param endpoint the endpoint being registered for the service * @return the key to store the newly created receiver against */ protected Object getReceiverKey(FlowConstruct flowConstruct, InboundEndpoint endpoint) { return StringUtils.defaultIfEmpty(endpoint.getEndpointURI().getFilterAddress(), endpoint.getEndpointURI().getAddress()); }
@Override protected boolean hasNoMessages() { try { QueueSession qs = connector.getQueueSession(); Queue queue = qs.getQueue(endpoint.getEndpointURI().getAddress()); return queue.size() == 0; } catch (Exception e) { return false; } }
protected MuleMessage getFirstMessage() throws Exception { // The queue from which to pull events QueueSession qs = connector.getTransactionalResource(endpoint); Queue queue = qs.getQueue(endpoint.getEndpointURI().getAddress()); return getMessage(queue, connector.getQueueTimeout()); }
protected void doConnect() throws Exception { // use the default queue profile to configure this queue. connector.getQueueProfile().configureQueue( getEndpoint().getMuleContext(), endpoint.getEndpointURI().getAddress(), connector.getQueueManager()); }
protected OutboundEndpoint getRecipientEndpointFromUri(EndpointURI uri) throws MuleException { OutboundEndpoint endpoint = null; if (null != getMuleContext() && null != getMuleContext().getRegistry()) { endpoint = buildOutboundEndpoint(uri.getAddress()); } if (null != endpoint) { muleContext.getRegistry().applyLifecycle(endpoint); } return endpoint; }
@Override public MessageReceiver createReceiver(FlowConstruct flowConstruct, InboundEndpoint endpoint) throws Exception { if (!endpoint.getExchangePattern().hasResponse()) { queueProfile.configureQueue(endpoint.getMuleContext(), endpoint.getEndpointURI().getAddress(), getQueueManager()); } return serviceDescriptor.createMessageReceiver(this, flowConstruct, endpoint); }
@Override protected void doConnect() throws Exception { if (!endpoint.getExchangePattern().hasResponse()) { // use the default queue profile to configure this queue. connector.getQueueProfile().configureQueue(endpoint.getMuleContext(), endpoint.getEndpointURI().getAddress(), connector.getQueueManager()); } }