public ServiceEndpoint[] resolveAvailableEndpoints(ComponentContext context, MessageExchange exchange) throws JBIException { ServiceEndpoint endpoint = context.getEndpoint(serviceName, endpointName); if (endpoint != null) { return new ServiceEndpoint[] {endpoint }; } else { return new ServiceEndpoint[0]; } }
protected ServiceEndpoint[] getEndpoints() throws JBIException { ServiceEndpoint[] endpoints; if (endpointName != null && serviceName != null) { ServiceEndpoint ep = context.getEndpoint(serviceName, endpointName); if (ep == null) { endpoints = new ServiceEndpoint[0]; } else { this.endpoint = ep; endpoints = new ServiceEndpoint[] {ep }; } } else if (serviceName != null) { endpoints = context.getEndpointsForService(serviceName); } else if (interfaceName != null) { endpoints = context.getEndpoints(interfaceName); } else { throw new IllegalStateException("One of interfaceName or serviceName should be provided"); } return endpoints; }
/** * TODO getEndpointDescriptor works only with implementation InternalEndpoint * Retrieve the service description metadata for the specified endpoint. * <p> * Note that the result can use either the WSDL 1.1 or WSDL 2.0 description * language. * * @param endpoint * endpoint reference; must be non-null. * @return metadata describing endpoint, or <code>null</code> if metadata * is unavailable. * @throws javax.jbi.JBIException * invalid endpoint reference. * @throws RemoteException * impossible to realize a remote access */ public Document getEndpointDescriptor(final ServiceEndpoint endpoint) throws JBIException, RemoteException { Document doc = null; ServiceEndpoint se = this.componentContext.getEndpoint(endpoint.getServiceName(), endpoint.getEndpointName()); if (se != null) { doc = this.componentContext.getEndpointDescriptor(se); } return doc; }
String u = this.uri.substring(9); String[] parts = split3(u); ServiceEndpoint se = context.getEndpoint(new QName(parts[0], parts[1]), parts[2]); if (se != null) { return new ServiceEndpoint[] {se };
public ServiceEndpoint getEndpoint(QName service, String name) { return context.getEndpoint(service, name); }
String u = this.uri.substring(9); String[] parts = split3(u); ServiceEndpoint se = context.getEndpoint(new QName(parts[0], parts[1]), parts[2]); if (se != null) { return new ServiceEndpoint[] {se };
public ServiceEndpoint getEndpoint(QName qName, String s) { return getContext().getEndpoint(qName, s); }
/** * * @param match * @return an ServiceEndpoint[] of all the endpoints that matched. * @throws JBIException */ protected ServiceEndpoint[] getEndpointsForExchangeTarget(ExchangeTarget match) throws JBIException { ServiceEndpoint[] endpoints; if (match.getEndpoint() != null && match.getService() != null) { ServiceEndpoint endpoint = getContext().getEndpoint(match.getService(), match.getEndpoint()); if (endpoint == null) { endpoints = new ServiceEndpoint[0]; } else { endpoints = new ServiceEndpoint[] {endpoint }; } } else if (match.getService() != null) { endpoints = getContext().getEndpointsForService(match.getService()); } else if (interfaceName != null) { endpoints = getContext().getEndpoints(interfaceName); } else { throw new IllegalStateException("One of interfaceName or serviceName should be provided"); } return endpoints; }
@Override public @Nullable ServiceEndpoint resolveEndpoint(final QName serviceName, final String endpointName) { return sender.getComponent().getContext().getEndpoint(serviceName, endpointName); }
ServiceEndpoint getServiceEndpoint() { if (_se == null) { if (_initialPartnerEndpoint != null) { _se = _ode.getContext().getEndpoint(_initialPartnerEndpoint.serviceName, _initialPartnerEndpoint.portName); if (_se == null) { throw new ContextException("Unknown endpoint: " + _initialPartnerEndpoint, null); } } } return _se; } }
String uri2 = uri.substring(9); String[] parts = URIResolver.split3(uri2); ServiceEndpoint se = context.getEndpoint(new QName(parts[0], parts[1]), parts[2]); exchange.setEndpoint(se); } else {
String uri2 = uri.substring(9); String[] parts = URIResolver.split3(uri2); ServiceEndpoint se = context.getEndpoint(new QName(parts[0], parts[1]), parts[2]); exchange.setEndpoint(se); } else {
public void start() throws Exception { super.start(); if (serviceEndpoint == null) { serviceEndpoint = getContext().getEndpoint(getService(), getEndpoint()); } Object pojo = getBean(); if (pojo != null) { beanType = pojo.getClass(); injectBean(pojo); ReflectionUtils.callLifecycleMethod(pojo, PostConstruct.class); } else { beanType = createBean().getClass(); } if (getMethodInvocationStrategy() == null) { throw new IllegalArgumentException("No 'methodInvocationStrategy' property set"); } }
/** * Get the service endpoint for the named activated endpoint, if any. * * @param service * qualified-name of the endpoint's service; must be non-null. * @param name * name of the endpoint; must be non-null. * @return the named endpoint, or <code>null</code> if the named endpoint * is not activated. * @throws RemoteException * impossible to realize a remote access */ public ServiceEndpoint getEndpoint(final QName service, final String name) throws RemoteException { ServiceEndpoint seC = this.componentContext.getEndpoint(service, name); ServiceEndpoint seF = null; if (seC != null) { seF = new org.objectweb.petals.tools.rmi.common.serializable. ServiceEndpoint(seC.getServiceName(), seC.getEndpointName(), seC.getInterfaces()); } return seF; }
/** * Deactivates the given endpoint with the NMR. Deactivation indicates to * the NMR that this component will no longer process requests sent to the * named endpoint. * * @param endpoint * reference to the endpoint to be deactivated; must be non-null. * @throws javax.jbi.JBIException * if the endpoint cannot be deactivated. * @throws RemoteException * impossible to realize a remote access */ public void deactivateEndpoint(final ServiceEndpoint endpoint) throws JBIException, RemoteException { try { ServiceEndpoint se = this.componentContext.getEndpoint(endpoint.getServiceName(), endpoint.getEndpointName()); this.componentContext.deactivateEndpoint(se); } catch (JBIException e) { throw Convert.convertJBIException(e); } }
/** * Configures the target on the newly created exchange * @param exchange the exchange to configure * @throws MessagingException if the target could not be configured */ public void configureTarget(MessageExchange exchange, ComponentContext context) throws MessagingException { if (interf == null && service == null && uri == null) { throw new MessagingException("interface, service or uri should be specified"); } if (uri != null) { URIResolver.configureExchange(exchange, context, uri); } if (interf != null) { exchange.setInterfaceName(interf); } if (operation != null) { exchange.setOperation(operation); } if (service != null) { exchange.setService(service); if (endpoint != null) { ServiceEndpoint se = context.getEndpoint(service, endpoint); exchange.setEndpoint(se); } } }
/** * Configures the target on the newly created exchange * @param exchange the exchange to configure * @throws MessagingException if the target could not be configured */ public void configureTarget(MessageExchange exchange, ComponentContext context) throws MessagingException { if (interf == null && service == null && uri == null) { throw new MessagingException("interface, service or uri should be specified"); } if (uri != null) { URIResolver.configureExchange(exchange, context, uri); } if (interf != null) { exchange.setInterfaceName(interf); } if (operation != null) { exchange.setOperation(operation); } if (service != null) { exchange.setService(service); if (endpoint != null) { ServiceEndpoint se = context.getEndpoint(service, endpoint); exchange.setEndpoint(se); } } }
/** * Configures the target on the newly created exchange * @param exchange the exchange to configure * @throws MessagingException if the target could not be configured */ public void configureTarget(MessageExchange exchange, ComponentContext context) throws MessagingException { if (interf == null && service == null && uri == null) { throw new MessagingException("interface, service or uri should be specified"); } if (uri != null) { URIResolver.configureExchange(exchange, context, uri); } if (interf != null) { exchange.setInterfaceName(interf); } if (operation != null) { exchange.setOperation(operation); } if (service != null) { exchange.setService(service); if (endpoint != null) { ServiceEndpoint se = context.getEndpoint(service, endpoint); exchange.setEndpoint(se); } } }
protected void configureExchangeTarget(MessageExchange exchange) { if (targetUri != null) { URIResolver.configureExchange(exchange, getContext(), targetUri); } if (exchange.getInterfaceName() == null && targetInterface != null) { exchange.setInterfaceName(targetInterface); } if (exchange.getOperation() == null && targetOperation != null) { exchange.setOperation(targetOperation); } if (exchange.getService() == null && targetService != null) { exchange.setService(targetService); if (targetEndpoint != null) { ServiceEndpoint se = getContext().getEndpoint(targetService, targetEndpoint); if (se != null) { exchange.setEndpoint(se); } else { logger.warn("Target service (" + targetService + ") and endpoint (" + targetEndpoint + ")" + " specified, but no matching endpoint found. Only the service will be used for routing."); } } } }
/** * Configures the target on the newly created exchange * @param exchange the exchange to configure * @throws MessagingException if the target could not be configured */ public void configureTarget(MessageExchange exchange) throws MessagingException { if (targetInterface == null && targetService == null && targetUri == null) { throw new MessagingException("target's interface, service or uri should be specified"); } if (targetUri != null) { URIResolver.configureExchange(exchange, getContext(), targetUri); } if (targetInterface != null) { exchange.setInterfaceName(targetInterface); } if (targetOperation != null) { exchange.setOperation(targetOperation); } if (targetService != null) { exchange.setService(targetService); if (targetEndpoint != null) { ServiceEndpoint se = getContext().getEndpoint(targetService, targetEndpoint); exchange.setEndpoint(se); } } }