/** * @see ComponentContext#getServiceReferences(Class<B>, String) */ public <B> Collection<ServiceReference<B>> getServiceReferences(Class<B> businessInterface, String referenceName) { try { for (ComponentReference ref : component.getReferences()) { if (referenceName.equals(ref.getName())) { if (ref.getMultiplicity() == Multiplicity.ONE_ONE) throw new IllegalArgumentException("Reference " + referenceName + " is not a valid argument for getServiceReferences because it has a multiplicity of 1..1"); if (ref.getMultiplicity() == Multiplicity.ZERO_ONE) throw new IllegalArgumentException("Reference " + referenceName + " is not a valid argument for getServiceReferences because it has a multiplicity of 0..1"); ArrayList<ServiceReference<B>> serviceRefs = new ArrayList<ServiceReference<B>>(); for (EndpointReference endpointReference : ref.getEndpointReferences()) { RuntimeEndpointReference epr = (RuntimeEndpointReference)endpointReference; serviceRefs.add(getServiceReference(businessInterface, epr)); } return serviceRefs; } } throw new IllegalArgumentException("Reference not found: " + referenceName); } catch (IllegalArgumentException iae) { throw iae; } catch (ServiceRuntimeException e) { throw e; } catch (Exception e) { throw new ServiceRuntimeException(e.getMessage(), e); } }
public <B> TuscanyServiceReference<B> getServiceReference(Class<B> businessInterface, String referenceName) throws IllegalArgumentException { for (ComponentReference ref : component.getReferences()) { if (referenceName.equals(ref.getName())) { Multiplicity multiplicity = ref.getMultiplicity(); if (multiplicity == Multiplicity.ZERO_N || multiplicity == Multiplicity.ONE_N) { throw new IllegalArgumentException("Reference " + referenceName + " has multiplicity " + multiplicity); } if (ref.getEndpointReferences().size() < 1) { return null; } TuscanyServiceReference<B> sr = getServiceReference(businessInterface, (RuntimeEndpointReference)getEndpointReference(ref)); if (sr == null) { throw new IllegalArgumentException("Reference " + referenceName + " is null"); } return sr; } } throw new IllegalArgumentException("[JCA80011] Reference not found: " + referenceName); }
private void validateReferenceMultiplicity(Composite composite, Component component, Monitor monitor) { for (ComponentReference componentReference : component.getReferences()) { if (!validateMultiplicity(componentReference.getMultiplicity(), componentReference.getEndpointReferences())) { if (componentReference.getEndpointReferences().isEmpty()) {
private void validateReferenceMultiplicity(Composite composite, Component component, Monitor monitor) { for (ComponentReference componentReference : component.getReferences()) { if (!validateMultiplicity(componentReference.getMultiplicity(), componentReference.getEndpointReferences())) { if (componentReference.getEndpointReferences().isEmpty()) {
if (!validateMultiplicity(componentReference.getMultiplicity(), componentReference.getEndpointReferences())) { if (componentReference.getEndpointReferences().isEmpty()) {
if (!validateMultiplicity(componentReference.getMultiplicity(), componentReference.getEndpointReferences())) { if (componentReference.getEndpointReferences().isEmpty()) {
Multiplicity multiplicity = reference.getMultiplicity(); for (Component targetComponent : composite.getComponents()) {
Multiplicity multiplicity = reference.getMultiplicity(); for (Component targetComponent : composite.getComponents()) {
Multiplicity multiplicity = reference.getMultiplicity(); for (Component targetComponent : composite.getComponents()) {
Multiplicity multiplicity = reference.getMultiplicity(); for (Component targetComponent : composite.getComponents()) {
Multiplicity multiplicity = endpointReference.getReference().getMultiplicity(); for (Endpoint endpoint : domainRegistry.getEndpoints()){