protected String createEndpointName() { if (idGenerator == null) { idGenerator = new IdGenerator("camel"); } return idGenerator.generateSanitizedId(); }
public CamelConsumerEndpoint(JbiBinding binding, JbiEndpoint jbiEndpoint) { setService(SERVICE_NAME); setEndpoint(new IdGenerator().generateId()); this.binding = binding; this.jbiEndpoint = jbiEndpoint; }
/** * Create a RemoteServiceMixClient * @param uri * @param activationSpec */ public RemoteServiceMixClient(String uri, ActivationSpec activationSpec) { container = new JBIContainer(); container.setEmbedded(true); container.setUseMBeanServer(false); container.setName(new IdGenerator().generateSanitizedId()); this.uri = uri; this.activationSpec = activationSpec; }
public void resendExchange(MessageExchange exchange) throws JBIException { if (!(exchange instanceof MessageExchangeImpl)) { throw new IllegalArgumentException("exchange should be a MessageExchangeImpl"); } MessageExchangeImpl me = (MessageExchangeImpl) exchange; me.getPacket().setExchangeId(new IdGenerator().generateId()); me.getPacket().setOut(null); me.getPacket().setFault(null); me.getPacket().setError(null); me.getPacket().setStatus(ExchangeStatus.ACTIVE); me.getPacket().setProperty(JbiConstants.DATESTAMP_PROPERTY_NAME, Calendar.getInstance()); ExchangeListener[] l = (ExchangeListener[]) listeners.getListeners(ExchangeListener.class); ExchangeEvent event = new ExchangeEvent(me, ExchangeEvent.EXCHANGE_SENT); for (int i = 0; i < l.length; i++) { try { l[i].exchangeSent(event); } catch (Exception e) { LOGGER.warn("Error calling listener: {}", e.getMessage(), e); } } me.handleSend(false); sendExchange(me.getMirror()); }
cf.setAddress("jbi://" + new IdGenerator().generateSanitizedId()); if (isUseJBIWrapper()) { cf.setBindingId(org.apache.servicemix.cxf.binding.jbi.JBIConstants.NS_JBI_BINDING);