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; }
/** * Factory method to create a new component ID if none is specified * * @return uniqueId */ protected String createComponentID() { return idGenerator.generateId(); }
public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException { if (field.getAnnotation(WebServiceRef.class) != null) { ServiceImpl s = new ServiceImpl(getBus(), null, null, field.getType()); s.addPort(new QName("port"), JBITransportFactory.TRANSPORT_ID, "jbi://" + ID_GENERATOR.generateSanitizedId()); Object o = s.getPort(new QName("port"), field.getType()); field.setAccessible(true); field.set(getPojo(), o); } } });
protected String getExchangeId() { return idGenerator.generateId(); }
String address = "jbi://" + ID_GENERATOR.generateSanitizedId();
/** * 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()); }
/** * Generate a unique ID - that is friendly for a URL or file system * * @return a unique id */ public String generateSanitizedId() { String result = generateId(); result = result.replace(':', '-'); result = result.replace('_', '-'); result = result.replace('.', '-'); return result; }
cf.setAddress("jbi://" + new IdGenerator().generateSanitizedId()); if (isUseJBIWrapper()) { cf.setBindingId(org.apache.servicemix.cxf.binding.jbi.JBIConstants.NS_JBI_BINDING);
public String store(Object data) throws IOException { String id = idGenerator.generateId(); store(id, data); return id; }
public String store(Object data) throws IOException { String id = factory.getIdGenerator().generateId(); store(id, data); return id; }