public EcaEventPattern(RouteDefinition route, TYPE type) { this.route = route; this.targetId = route != null ? route.getId() : null; this.type = type; }
public boolean hasMissingId() { for (RouteDefinition rd : getRouteDefinitionList()) { if (rd.getId() == null) { return true; } } return false; }
public boolean hasMissingId() { for (RouteDefinition rd : getRouteDefinitionList()) { if (rd.getId() == null) { return true; } } return false; }
public String toString() { return getName() + " " + (this.route != null ? this.route.getId() : this.targetId); }
public String dumpStatsAsXml(String routeId) { Set<RouteDefinition> routes = new HashSet<RouteDefinition>(); for (ProcessorDefinition<?> definition : statistics.keySet()) { RouteDefinition route = ProcessorDefinitionHelper.getRoute(definition); routes.add(route); } StringBuilder sb = new StringBuilder(); sb.append("<profiling>"); for (RouteDefinition route : routes) { if (routeId == null || routeId.equals(route.getId())) { sb.append("<route"); if (route.getId() != null) { sb.append(" id=\"").append(route.getId()).append("\""); } sb.append(">"); appendStats(sb, route); sb.append("</route>"); } } sb.append("</profiling>"); return sb.toString(); }
public String dumpStatsAsXml(String routeId) { Set<RouteDefinition> routes = new HashSet<RouteDefinition>(); for (ProcessorDefinition<?> definition : statistics.keySet()) { RouteDefinition route = ProcessorDefinitionHelper.getRoute(definition); routes.add(route); } StringBuilder sb = new StringBuilder(); sb.append("<profiling>"); for (RouteDefinition route : routes) { if (routeId == null || routeId.equals(route.getId())) { sb.append("<route"); if (route.getId() != null) { sb.append(" id=\"").append(route.getId()).append("\""); } sb.append(">"); appendStats(sb, route); sb.append("</route>"); } } sb.append("</profiling>"); return sb.toString(); }
public Processor wrap(RouteContext routeContext, final Processor processor) { if (LOG.isDebugEnabled()) { LOG.debug("Securing route {} using Shiro policy {}", routeContext.getRoute().getId(), this); } return new ShiroSecurityProcessor(processor, this); }
public void validate(CamelContext context) { if ((targetId == null || targetId.trim().isEmpty()) && route != null) { targetId = route.getId(); } route = context.getRouteDefinition(targetId); if (route == null) { throw new RuntimeCamelException("Failed to find RouteDefinition with id: " + targetId); } }
public ObjectName getObjectNameForProcessor(CamelContext context, Processor processor, ProcessorDefinition<?> definition) throws MalformedObjectNameException { StringBuilder buffer = new StringBuilder(); buffer.append(domainName).append(":"); buffer.append(KEY_CONTEXT + "=").append(getContextId(context)).append(","); buffer.append(KEY_TYPE + "=").append(TYPE_PROCESSOR).append(","); RouteDefinition route = ProcessorDefinitionHelper.getRoute(definition); if (route != null) { buffer.append(KEY_ROUTE + "=").append(route.getId()).append(","); } buffer.append(KEY_NAME + "=").append(ObjectName.quote(definition.getId())); return createObjectName(buffer); }
@Nullable @Override public RouteType findRouteType(RouteTypeInfo routeTypeInfo) { Assert.notNull(routeTypeInfo, "routeTypeInfo must not be null"); String routeId = routeTypeInfo.getRouteId(); //check in routeDefinition if (StringUtils.isBlank(routeId) && routeTypeInfo.getRouteDefinition() != null) { routeId = routeTypeInfo.getRouteDefinition().getId(); } //check in route if (StringUtils.isBlank(routeId) && routeTypeInfo.getRoute() != null) { routeId = routeTypeInfo.getRoute().getId(); } RouteType result = null; if (!StringUtils.isBlank(routeId) && routeId.matches(ROUTE_ID_IN_REG_EXP)) { result = RouteTypeEnum.INPUT; } return result; } }
@Override public void doExecute(TestContext context) { if (StringUtils.hasText(routeContext)) { // now lets parse the routes with JAXB try { Object value = getJaxbContext().createUnmarshaller().unmarshal(new StringSource(context.replaceDynamicContentInString(routeContext))); if (value instanceof CamelRouteContextFactoryBean) { CamelRouteContextFactoryBean factoryBean = (CamelRouteContextFactoryBean) value; routes = factoryBean.getRoutes(); } } catch (JAXBException e) { throw new BeanDefinitionStoreException("Failed to create the JAXB unmarshaller", e); } } for (RouteDefinition routeDefinition : routes) { try { camelContext.addRouteDefinition(routeDefinition); log.info(String.format("Created new Camel route '%s' in context '%s'", routeDefinition.getId(), camelContext.getName())); } catch (Exception e) { throw new CitrusRuntimeException(String.format("Failed to create route definition '%s' in context '%s'", routeDefinition.getId(), camelContext.getName()), e); } } }
private void logRouteStart(Exchange exchange) { //UnitOfWork -> getRouteContext -> Route -> Id. String routeId = exchange.getUnitOfWork().getRouteContext().getRoute().getId(); WonMessage message = (WonMessage) exchange.getIn().getHeader(WonCamelConstants.MESSAGE_HEADER); if (message == null){ logger.debug("starting route {}: [no WoNMessage]", routeId); return; } logger.debug("starting route {}: {} type:{}, dir:{}, resp:{}, rem: {}", new String[]{ routeId, message.getMessageURI().toString(), message.getMessageType().toString(), message.getEnvelopeType().toString(), message.getIsResponseToMessageURI() == null ? "[not a response]" : message.getIsResponseToMessageURI().toString(), message.getCorrespondingRemoteMessageURI() == null ? "[no remote message uri]" : message.getCorrespondingRemoteMessageURI().toString() }); }
? null : source.getUnitOfWork().getRouteContext().getRoute().getId(); this.breadCrumbId = getBreadCrumbId(source); this.exception = source.getException() == null ? source.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class) : source.getException();