private InitialContext getInitialContext() throws NamingException { Hashtable<String,String> env = new Hashtable<String,String>(); env.put(Context.PROVIDER_URL, this.configuration.getProviderURL()); env.put(Context.INITIAL_CONTEXT_FACTORY, this.configuration.getInitialContextFactory()); if(this.configuration.getUrlPackagePrefixes() != null) { env.put(Context.URL_PKG_PREFIXES, this.configuration.getUrlPackagePrefixes()); } return new InitialContext(env); }
Message jmsMessage = this.convertToMessage(getPayload(message)); if(postProcessor != null) postProcessor.invoke(message, jmsMessage);
if(this.configuration.isRemoteJNDILookup()) Context context = getInitialContext(); if(this.configuration.getConnectionFactoryName() == null) _connectionFactory = (ConnectionFactory)context.lookup(this.configuration.getConnectionFactoryName()); if(this.configuration.getDestinationName() == null) this.destination = (Destination)context.lookup(this.configuration.getDestinationName()); if(this.configuration.getUsername() != null && this.configuration.getUsername().trim().length() > 0) connection = _connectionFactory.createConnection(this.configuration.getUsername(), this.configuration.getPassword()); this.session = connection.createSession(this.configuration.isTransacted(), this.configuration.getAcknowledgement()); if(this.destination == null)
public Message createMessage(Session session) throws JMSException { Message msg = getRequiredMessageConverter().toMessage(getPayload(message), session); if(postProcessor != null) { postProcessor.invoke(message, msg); } return msg; } });
@Override public void invoke(T originalMessage, Message jmsMessage) { if(originalMessage instanceof FlowEvent) { FlowEvent<String,?> flowEvent = (FlowEvent<String,?>)originalMessage; // carry the event identifier this.managedEventIdentifierService.setEventIdentifier(flowEvent.getIdentifier(), jmsMessage); // carry the related event identifier if available this.managedEventIdentifierService.setRelatedEventIdentifier(flowEvent.getRelatedIdentifier(), jmsMessage); } if(this.configuration != null) { try { setMessageProperties(jmsMessage, this.configuration.getProperties()); } catch(JMSException e) { throw new TransformationException(e); } } }