public boolean isExchangeWithProviderOkay(ServiceEndpoint endpoint, MessageExchange exchange) { return component.isExchangeWithProviderOkay(endpoint, exchange); }
public boolean evaluate(ServiceEndpoint endpoint, MessageExchange exchange) { return component.isExchangeWithProviderOkay(endpoint, exchange); } }
public boolean isExchangeWithProviderOkayForComponent(String componentName, ServiceEndpoint internalEndpoint, MessageExchange exchange) throws JBIException { this.log.start(); Installer installer = this.installersByName.get(componentName); if (installer == null) { throw new JBIException("Cannot find a component '" + componentName + "' in the container"); } boolean result = installer.getComponent().isExchangeWithProviderOkay(internalEndpoint, exchange); this.log.end(); return result; }
private boolean controlAcceptationExchange(final Component consumer, final org.ow2.petals.jbi.messaging.endpoint.ServiceEndpoint providerEP, final MessageExchangeWrapper exchange) { this.log.call(); boolean result = false; if (this.configurationService.getContainerConfiguration().isExchangeValidation()) { if (consumer.isExchangeWithProviderOkay(providerEP, exchange) && this.exchangeCheckerClient.isExchangeWithConsumerOkayForComponent( providerEP, exchange)) { result = true; } } else { result = true; } return result; }
/** * Control that the exchange is possible. Verify if the consumer and * provider are agree to realize the exchange. * * @param consumer * the consumer * @param providerEP * the provider * @param exchange * the exchange * @return true if ok */ private final boolean isExchangeOK(final Component consumer, final org.ow2.petals.jbi.messaging.endpoint.ServiceEndpoint providerEP, final MessageExchange exchange) { this.log.call(); boolean result = true; if (this.configurationService.getContainerConfiguration().isExchangeValidation()) { if (!consumer.isExchangeWithProviderOkay(providerEP, exchange) || !this.exchangeCheckerService.isExchangeWithConsumerOkayForComponent( providerEP, exchange)) { result = false; } } return result; }
/** * (non-Javadoc) * * @see org.objectweb.petals.jbi.management.admin.AdminServiceMBean#isExchangeWithProviderOkayForComponent(java.lang.String, * javax.jbi.servicedesc.ServiceEndpoint, * javax.jbi.messaging.MessageExchange) */ public boolean isExchangeWithProviderOkayForComponent(String componentName, ServiceEndpoint internalEndpoint, MessageExchange exchange) throws JBIException { log.call(); ComponentLifeCycle componentLifeCycle = getComponentLifeCycleByName(componentName); if (componentLifeCycle == null) { log.error("No such component " + componentName + " in the container"); throw new JBIException("No such component " + componentName + " in the container"); } return componentLifeCycle.getComponent().isExchangeWithProviderOkay( internalEndpoint, exchange); }
/** * Filter the given endpoints by asking to the provider and consumer if they * are both ok to process the exchange. * * @param endpoints * an array of internal endpoints to check * @param exchange * the exchange that will be serviced * @return an array of endpoints on which both consumer and provider agrees */ protected ServiceEndpoint[] getMatchingEndpoints(ServiceEndpoint[] endpoints, MessageExchangeImpl exchange) { List<ServiceEndpoint> filtered = new ArrayList<ServiceEndpoint>(); ComponentMBeanImpl consumer = getRegistry().getComponent(exchange.getSourceId()); for (int i = 0; i < endpoints.length; i++) { ComponentNameSpace id = ((InternalEndpoint) endpoints[i]).getComponentNameSpace(); if (id != null) { ComponentMBeanImpl provider = getRegistry().getComponent(id); if (provider != null && (!consumer.getComponent().isExchangeWithProviderOkay(endpoints[i], exchange) || !provider.getComponent().isExchangeWithConsumerOkay(endpoints[i], exchange))) { continue; } } filtered.add(endpoints[i]); } return filtered.toArray(new ServiceEndpoint[filtered.size()]); }
/** * Control that the exchnage is possible. Verify if the consumer and * provider are ok to realize the exchange. * * @param consumer * the consumer * @param providerEP * the provider * @param exchange * the exchange * @return true if ok */ private boolean controlAcceptationExchange(final Component consumer, final InternalEndpoint providerEP, final MessageExchange exchange) { boolean result = false; // test if isExchangeWithXXXOkay has to be used. if (configurationService.getContainerConfiguration() .isExchangeValidation()) { // apply isExchangeWithXXXOkay if (consumer.isExchangeWithProviderOkay(providerEP, exchange) && providerEP.getEndpointService() .isExchangeWithConsumerOkayForComponent(providerEP, exchange)) { result = true; } } else { result = true; } return result; }
exchange.beforeCapabilityCheck(endpoint); if (consumer.isExchangeWithProviderOkay(endpoint, exchange) && provider.isExchangeWithConsumerOkay(endpoint, exchange)) { match = endpoint; break;