public void activate(CompositeContext compositeContext, RuntimeEndpointReference epr) { // create the wire // null endpoint passed in here as the endpoint reference may // not be resolved yet epr.bind(compositeContext); ComponentReference reference = epr.getReference(); InterfaceContract sourceContract = epr.getComponentTypeReferenceInterfaceContract(); // TODO - EPR - interface contract seems to be null in the implementation.web // case. Not introspecting the CT properly? if (sourceContract == null){ // TODO - Can't do this with move of matching to wire // take the contract from the service to which the reference is connected sourceContract = ((RuntimeEndpoint) epr.getTargetEndpoint()).getComponentTypeServiceInterfaceContract(); reference.setInterfaceContract(sourceContract); } // endpointReference.setInterfaceContract(sourceContract.makeUnidirectional(false)); // if the reference already has a binding we can check the reference binding interface // and reference interfaces for compatibility. If we can't check now compatibility // will be checked when the endpoint reference is resolved. if (epr.getStatus() == EndpointReference.Status.RESOLVED_BINDING){ epr.validateReferenceInterfaceCompatibility(); } }
/** * Implementation.web components currently don't use introspection to find the component type so unless an interface * is explicitly defined on a refererence with <interface.java> then the InterfaceContract will be null. This will * check for that and set the InterfaceContract from the Java class of the JSP tag. */ private void setInterfaceContract(RuntimeComponent component, Class<?> typeClass) throws InvalidInterfaceException { ComponentReference ref = component.getReference(name); if (ref.getInterfaceContract() == null) { ExtensionPointRegistry epr = component.getComponentContext().getExtensionPointRegistry(); FactoryExtensionPoint fep = epr.getExtensionPoint(FactoryExtensionPoint.class); JavaInterfaceFactory jif = fep.getFactory(JavaInterfaceFactory.class); JavaInterface javaIface = jif.createJavaInterface(typeClass); InterfaceContract interfaceContract = jif.createJavaInterfaceContract(); interfaceContract.setInterface(javaIface); ref.setInterfaceContract(interfaceContract); } } }
/** * Implementation.web components currently don't use introspection to find the component type so unless an interface * is explicitly defined on a refererence with <interface.java> then the InterfaceContract will be null. This will * check for that and set the InterfaceContract from the Java class of the JSP tag. */ private void setInterfaceContract(RuntimeComponent component, Class<?> typeClass) throws InvalidInterfaceException { ComponentReference ref = component.getReference(name); if (ref.getInterfaceContract() == null) { ExtensionPointRegistry epr = component.getComponentContext().getExtensionPointRegistry(); FactoryExtensionPoint fep = epr.getExtensionPoint(FactoryExtensionPoint.class); JavaInterfaceFactory jif = fep.getFactory(JavaInterfaceFactory.class); JavaInterface javaIface = jif.createJavaInterface(typeClass); InterfaceContract interfaceContract = jif.createJavaInterfaceContract(); interfaceContract.setInterface(javaIface); ref.setInterfaceContract(interfaceContract); } } }
componentReference.setInterfaceContract(interfaceContract); componentReference.setMultiplicity(Multiplicity.ONE_ONE);
componentReference.setInterfaceContract(interfaceContract); componentReference.setMultiplicity(Multiplicity.ONE_ONE);
componentReference.setInterfaceContract(interfaceContract); componentReference.setMultiplicity(Multiplicity.ONE_ONE);
componentReference.setInterfaceContract(interfaceContract); componentReference.setMultiplicity(Multiplicity.ONE_ONE);
componentReference.setInterfaceContract(interfaceContract); componentReference.setMultiplicity(Multiplicity.ONE_ONE);
contract.setCallbackInterface(null); contract.setNormalizedWSDLContract(null); callbackReference.setInterfaceContract(contract); } catch (CloneNotSupportedException e) {
contract.setCallbackInterface(null); contract.setNormalizedWSDLContract(null); callbackReference.setInterfaceContract(contract); } catch (CloneNotSupportedException e) {
reference.setInterfaceContract(interfaceContract); String referenceName = endpoint.getService().getName() + "_asyncCallback"; reference.setName(referenceName);