public CamelSE getCamelSE() { final AbstractComponent component = super.getComponent(); assert component != null; return (CamelSE) component; }
@Override public BcGatewayComponent getComponent() { final AbstractComponent component = super.getComponent(); assert component != null; return (BcGatewayComponent) component; }
public JMSMessageListener(final AbstractExternalListener externalListener) { this.externalListener = externalListener; this.logger = externalListener.getLogger(); }
public void onMessage(final Message jmsExchange) { this.logger.log(Level.FINEST, "onMessage"); final SuConfigurationParameters extensions = externalListener.getExtensions(); this.logger.log(Level.FINEST, "A JMS message is received from '" + extensions.get("jndi-provider-url") + "'."); exchange = this.externalListener.createConsumeExchange(); if (exchange == null) { .log(Level.WARNING, "An invalid pattern is specified in consumes extensions. So an in-only message is sent."); exchange = this.externalListener.createConsumeExchange(externalListener .getConsumes(), MEPConstants.IN_ONLY_PATTERN); .log(Level.WARNING, "No pattern specified in consumes extensions. So an in-only message is sent."); exchange = this.externalListener.createConsumeExchange(externalListener .getConsumes(), MEPConstants.IN_ONLY_PATTERN); this.externalListener.send(exchange);
listener.getLogger().log(Level.FINE, "sendJMSMessage"); JmsBC component = (JmsBC) listener.getComponent(); GenericObjectPool<JMSProviderConnection> pool = component.getJmsProducerConnections() .get(listener.getProvides()); JMSProviderConnection conn; try { + "linked to the following endpoint: " + exchange.getEndpoint()); } else { listener.getLogger().log( Level.INFO, "Try to send JBI message to '" + conn.getDestinationName() listener.getLogger().log(Level.SEVERE, "Can not create the JMS message from JBI message.", e); if (e instanceof PEtALSCDKException) { listener.getLogger() .log(Level.INFO, "Message sent to '" + conn.getDestinationName() + "'.");
if (ServiceUnitUtil.retrievePattern(this.externalListener.getConsumes()) == null) { exchange = this.externalListener.createConsumeExchange(this.externalListener.getConsumes(), MEPPatternConstants.IN_ONLY); } else { exchange = this.externalListener.createConsumeExchange(this.externalListener.getConsumes()); this.externalListener.sendAsync(exchange, asyncCtx);
Consumes consume = this.sender.getComponent().getServiceUnitManager().getConsumesFromDestination(null, serviceName, interfaceName); this.sender.getLogger().log(Level.WARNING, String.format( "No Consumes declared in the JBI descriptor for the request to send, using informations from the process: interface=%s, serviceName=%s, operation=%s, mep=%s", } else { if (interfaceName != null && !consume.getInterfaceName().equals(interfaceName)) { this.sender.getLogger().log(Level.WARNING, "Mismatch between JBI Consumes interface name and process information (" + consume.getInterfaceName() + " vs " + interfaceName this.sender.getLogger().log(Level.WARNING, "Mismatch between JBI Consumes service name and process information (" + consume.getServiceName() + " vs " + serviceName this.sender.getLogger().log(Level.WARNING, "An operation is declared in the Consumes in the JBI descriptor for the request to send: IGNORED and using informations from the process: " + operationName); this.sender.getLogger().log(Level.WARNING, "A MEP is declared in the Consumes in the JBI descriptor for the request to send: IGNORED and using informations from the process: " + mep); .createConsumeExchange(consume, mep); if (this.sender.getLogger().isLoggable(Level.FINE)) { this.sender.getLogger().fine("Request to send: " + new String(buf));
public void onJBIMessage(final Exchange exchange) throws PEtALSCDKException { // Simply log Response content if (this.listener.getLogger().isLoggable(Level.FINE)) { this.listener.getLogger().fine( "JMS BC receive an unhandled response message:\n" + SourceUtil.createString( exchange.getOutMessage().getContent())); } } }
@Override public SoapComponent getComponent() { return (SoapComponent) super.getComponent(); }
public PetalsSender(final ActivitiSE activitiSE) { super.init(activitiSE); final Monitoring monitoringMBean = (Monitoring) activitiSE.getMonitoringBean(); this.probeAsyncExecutorThreadPool = monitoringMBean.getProbeAsyncExecutorThreadPool(); this.probeDatabaseConnectionPool = monitoringMBean.getProbeDatabaseConnectionPool(); }
@Override public void send(final Exchange exchange) throws MessagingException { // Update monitoring probes before sending message try { // Probes are not null here because message processing starts after JBI listener initialization this.probeAsyncExecutorThreadPool.pick(); this.probeDatabaseConnectionPool.pick(); } catch (final ProbeNotStartedException e) { this.getLogger().log(Level.WARNING, "Activiti engine probes are not started. Values of probes could be incorrect.", e); } super.send(exchange); }
@Override public void init() { super.init(); final Monitoring monitoringMBean = (Monitoring) ((ActivitiSE) this.getComponent()).getMonitoringBean(); this.probeAsyncExecutorThreadPool = monitoringMBean.getProbeAsyncExecutorThreadPool(); this.probeDatabaseConnectionPool = monitoringMBean.getProbeDatabaseConnectionPool(); }
/** * <p> * Set the operation into the JBI message exchange according to the * following priorized values: * </p> * * @param jmsMessage * The JMS message from which the operation is extracted. * @param exchange * The JBI message exchange in which the operation should be set. * @throws JMSException */ private void setOperation(final Message jmsMessage, final Exchange exchange) throws JMSException { if (jmsMessage.getStringProperty(JMS_OPERATION_NAME) != null && jmsMessage.getStringProperty(JMS_OPERATION_NAME).length() > 0) { exchange.setOperation(QName.valueOf(jmsMessage .getStringProperty(JMS_OPERATION_NAME))); } else if (this.externalListener.getExtensions().get(OPERATION) != null) { exchange.setOperation(QName.valueOf(this.externalListener.getExtensions() .get(OPERATION))); } }
final long timeout = AbstractListener.getTimeout(provides, this.component.getPlaceHolders(), this.logger);
@Override public BcGatewayComponent getComponent() { final AbstractComponent component = super.getComponent(); assert component != null; return (BcGatewayComponent) component; }
public void onJBIMessage(Exchange exchange) throws PEtALSCDKException { // Simply log Fault Fault fault = exchange.getFault(); try { listener.getLogger().log( Level.INFO, "JMS BC receive a Fault from an other component : \n" + SourceUtil.createString(fault.getContent())); } catch (PEtALSCDKException e) { throw new PEtALSCDKException("Error logging fault received on JMS BC", e); } } }
@Override public RESTComponent getComponent() { return (RESTComponent) super.getComponent(); } }
/** * Transform the NormalizedMessage of a JBI MsgExch into a TextMessage. The * content , properties of the IN NormalizedMessage are set. * * @param exchange * @param jmsMessage * @throws JMSException * writing properties to the TextMessage * @throws TransformerException * NormalizedMessage content access error * @throws IOException * NormalizedMessage content access error * @throws PEtALSCDKException */ private void transform(final Exchange exchange, final TextMessage jmsMessage) throws JMSException, TransformerException, IOException, PEtALSCDKException { listener.getLogger().log(Level.FINE, "transform"); NormalizedMessage in = exchange.getInMessage(); // TODO: Do we attach the global properties of the exchange? // set normalized message properties this.setMessageProperties(jmsMessage, in); // set the SOAP Action operation in the JMS message this.setServiceOperation(exchange, jmsMessage); // set content String inSourceAsString = SourceUtil.createString(in.getContent()); jmsMessage.setText(inSourceAsString); }