public EndpointURIEndpointBuilder(ImmutableEndpoint source) { this(source.getEndpointURI()); setName(source.getName()); setEncoding(source.getEncoding()); setConnector(source.getConnector()); setProperties(source.getProperties()); setTransactionConfig(source.getTransactionConfig()); setDeleteUnacceptedMessages(source.isDeleteUnacceptedMessages()); setInitialState(source.getInitialState()); setResponseTimeout(source.getResponseTimeout()); setRetryPolicyTemplate(source.getRetryPolicyTemplate()); setExchangePattern(source.getExchangePattern()); setMuleContext(source.getMuleContext()); setMessageProcessors(source.getMessageProcessors().isEmpty() ? Collections.<MessageProcessor>emptyList() : source.getMessageProcessors()); setResponseMessageProcessors(source.getResponseMessageProcessors().isEmpty() ? Collections.<MessageProcessor>emptyList() : source.getResponseMessageProcessors()); setDisableTransportTransformer(source.isDisableTransportTransformer()); setMimeType(source.getMimeType()); setRedeliveryPolicy(source.getRedeliveryPolicy()); } }
private SchedulerFactory<Runnable> getSchedulerFactory() { return (SchedulerFactory<Runnable>) endpoint.getProperty(SCHEDULER_FACTORY_PROPERTY_NAME); }
public XmppMultiUserChatConversation(ImmutableEndpoint endpoint) { super(endpoint); connector = endpoint.getConnector(); Object nickValue = endpoint.getProperty(XmppConnector.XMPP_NICKNAME); if (nickValue != null) { nickname = nickValue.toString(); } else { nickname = UUID.getUUID(); } }
protected String getHolderKey(ImmutableEndpoint endpoint) { return endpoint.getProtocol() + ":" + endpoint.getEndpointURI().getHost() + ":" + endpoint.getEndpointURI().getPort(); }
protected ExecutionTemplate<MuleEvent> createExecutionTemplate() { return TransactionalErrorHandlingExecutionTemplate.createMainExecutionTemplate(endpoint.getMuleContext(), endpoint.getTransactionConfig(), flowConstruct.getExceptionListener()); }
public EndpointMessageNotification(MuleMessage resource, ImmutableEndpoint endpoint, FlowConstruct flowConstruct, int action) { super(resource, endpoint.getEndpointURI().toString(), flowConstruct, action); this.immutableEndpoint = endpoint; }
return createMuleMessage(result, endpoint.getEncoding()); + endpoint.getEndpointURI());
@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()); } }
client.getParams().setAuthenticationPreemptive(true); if (endpoint.getEndpointURI().getUserInfo() != null && endpoint.getProperty(HttpConstants.HEADER_AUTHORIZATION) == null) header.append(new String(Base64.encodeBase64(endpoint.getEndpointURI().getUserInfo().getBytes( endpoint.getEncoding())))); httpMethod.addRequestHeader(HttpConstants.HEADER_AUTHORIZATION, header.toString());
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); }
JobConfig jobConfig = (JobConfig) endpoint.getProperty(QuartzConnector.PROPERTY_JOB_CONFIG); if (jobConfig == null) jobDataMap.put(QUARTZ_RECEIVER_PROPERTY, this.getReceiverKey()); jobDataMap.put(QUARTZ_CONNECTOR_PROPERTY, this.connector.getName()); jobDataMap.putAll(endpoint.getProperties()); String cronExpression = (String)endpoint.getProperty(QuartzConnector.PROPERTY_CRON_EXPRESSION); String timeZone = (String)endpoint.getProperty(QuartzConnector.PROPERTY_CRON_TIME_ZONE); String repeatInterval = (String)endpoint.getProperty(QuartzConnector.PROPERTY_REPEAT_INTERVAL); String repeatCount = (String)endpoint.getProperty(QuartzConnector.PROPERTY_REPEAT_COUNT); String startDelay = (String)endpoint.getProperty(QuartzConnector.PROPERTY_START_DELAY); String groupName = jobConfig.getGroupName(); String jobGroupName = jobConfig.getJobGroupName(); jobBuilder.withIdentity(endpoint.getEndpointURI().getAddress(), groupName); .withIdentity(endpoint.getEndpointURI().getAddress(), groupName) .forJob(endpoint.getEndpointURI().getAddress(), jobGroupName); .inTimeZone(((QuartzConnector) this.getConnector()).resolveTimeZone(timeZone, endpoint.getEndpointURI().getAddress()))); logger.warn("A quartz Job with name: " + endpoint.getEndpointURI().getAddress() + " has already been registered. Cannot register again");
public TcpSocketKey(ImmutableEndpoint endpoint) { if (!(endpoint.getConnector() instanceof TcpConnector)) { throw new IllegalArgumentException("Sockets must be keyed via a TCP endpoint"); } this.endpoint = endpoint; address = new InetSocketAddress( endpoint.getEndpointURI().getHost(), endpoint.getEndpointURI().getPort()); if (getConnector().isFailOnUnresolvedHost() && address.isUnresolved()) { throw new IllegalArgumentException("Unable to resolve address: " + address.getHostName()); } }
String methodName = MapUtils.getString(endpoint.getEndpointURI().getParams(), MuleProperties.MULE_METHOD_PROPERTY, null); if (null == methodName) methodName = (String) endpoint.getProperty(MuleProperties.MULE_METHOD_PROPERTY); List<Object> args = (List<Object>) endpoint.getProperty(RmiConnector.PROPERTY_SERVICE_METHOD_PARAMS_LIST); Class[] argTypes = new Class[]{}; if (args == null) argTypes = connector.getArgTypes(endpoint.getProperty(RmiConnector.PROPERTY_SERVICE_METHOD_PARAM_TYPES), RequestContext.getEvent()); methodArguments = new Object[args.size()]; methodArguments = args.toArray(methodArguments);
private void init() { if (endpoint == null) { throw new IllegalArgumentException(CoreMessages.objectIsNull("Endpoint").getMessage()); } if (receiver == null && endpoint instanceof InboundEndpoint) { throw new IllegalArgumentException( "Recevier is null for Endpoint MBean but the endpoint itself is a receiving endpoint"); } name = new ObjectNameHelper(endpoint.getMuleContext()).getEndpointName(endpoint.getEndpointURI()); }
public MuleEvent routeMessage(Object payload) throws MuleException { MuleMessage messageToRoute = createMuleMessage(payload, endpoint.getEncoding()); return routeMessage(messageToRoute); } }
@Override protected void initializeMessageFactory() throws InitialisationException { HttpMuleMessageFactory factory; try { factory = (HttpMuleMessageFactory) super.createMuleMessageFactory(); boolean enableCookies = MapUtils.getBooleanValue(endpoint.getProperties(), HttpConnector.HTTP_ENABLE_COOKIES_PROPERTY, ((HttpConnector) connector).isEnableCookies()); factory.setEnableCookies(enableCookies); String cookieSpec = MapUtils.getString(endpoint.getProperties(), HttpConnector.HTTP_COOKIE_SPEC_PROPERTY, ((HttpConnector) connector).getCookieSpec()); factory.setCookieSpec(cookieSpec); factory.setExchangePattern(endpoint.getExchangePattern()); muleMessageFactory = factory; } catch (CreateException ce) { Message message = MessageFactory.createStaticMessage(ce.getMessage()); throw new InitialisationException(message, ce, this); } }
try MuleMessage message = createMuleMessage(packet, endpoint.getEncoding()); final SocketAddress clientAddress = socket.getRemoteSocketAddress(); if (clientAddress != null) returnMessage = !getEndpoint().getExchangePattern().hasResponse() || event == null ? null : event.getMessage(); if (endpoint.getExchangePattern().hasResponse() && returnMessage != null)
/** * Getter for property 'replyToHandler'. * * @return Value for property 'replyToHandler'. */ public ReplyToHandler getReplyToHandler(ImmutableEndpoint endpoint) { return new DefaultReplyToHandler(endpoint.getMuleContext()); }
public void passivateObject(Object key, Object object) throws Exception { ImmutableEndpoint ep = (ImmutableEndpoint)key; boolean keepSocketOpen = MapUtils.getBooleanValue(ep.getProperties(), UdpConnector.KEEP_SEND_SOCKET_OPEN_PROPERTY, ((UdpConnector)ep.getConnector()).isKeepSendSocketOpen()); DatagramSocket socket = (DatagramSocket)object; if (!keepSocketOpen) { if (socket != null) { socket.close(); } } }
if (this.endpoint.getProperties().containsKey(PROPERTY_FILE_AGE)) fileAge = (Long) endpoint.getProperties().get(PROPERTY_FILE_AGE); String encoding = endpoint.getEncoding(); try