public String getQualifiedInterfaceName() { return getInterfaceClass().getName(); }
/** * Loads a service contract class in either a host environment that supports classloader isolation or one that does not, in which case the TCCL is used. * * @param javaContract the contract * @param contributionUri the contribution URI the contract class is loaded in * @return the loaded class */ private Class<?> loadServiceClass(JavaServiceContract javaContract, URI contributionUri) throws GenerationException { ClassLoader loader = classLoaderRegistry.getClassLoader(contributionUri); try { return loader.loadClass(javaContract.getInterfaceClass()); } catch (ClassNotFoundException e) { throw new GenerationException(e); } }
public void generateResourceWireSource(JavaWireSource source, LogicalResourceReference<?> resourceReference) { URI uri = resourceReference.getUri(); JavaServiceContract serviceContract = (JavaServiceContract) resourceReference.getDefinition().getServiceContract(); source.setUri(uri); source.setInjectable(new Injectable(InjectableType.RESOURCE, uri.getFragment())); source.setInterfaceClass(serviceContract.getInterfaceClass()); }
public PhysicalConnectionSource generateConnectionSource(LogicalProducer producer) { SystemConnectionSource source = new SystemConnectionSource(); URI uri = producer.getUri(); JavaServiceContract serviceContract = (JavaServiceContract) producer.getDefinition().getServiceContract(); source.setUri(uri); source.setInjectable(new Injectable(InjectableType.PRODUCER, uri.getFragment())); source.setServiceInterface(serviceContract.getInterfaceClass()); return source; }
return MATCH; if (source.getInterfaceClass().isAssignableFrom(target.getInterfaceClass())) { return MATCH; if (superType.equals(source.getInterfaceClass().getName())) {
return MATCH; if (source.getInterfaceClass().isAssignableFrom(target.getInterfaceClass())) { return MATCH; if (superType.equals(source.getInterfaceClass().getName())) {
if (source.getInterfaceClass().equals(target.getInterfaceClass())) { for (Signature signature : source.getMethodSignatures()) { if (!target.getMethodSignatures().contains(signature)) { if (superType.equals(source.getInterfaceClass())) {
public PhysicalConnectionSource generateConnectionSource(LogicalProducer producer) throws Fabric3Exception { String producerName = producer.getDefinition().getName(); URI uri = producer.getParent().getUri(); JavaServiceContract serviceContract = (JavaServiceContract) producer.getDefinition().getServiceContract(); return new SpringConnectionSource(producerName, serviceContract.getInterfaceClass(), uri); }
public PhysicalConnectionSource generateConnectionSource(LogicalProducer producer) throws Fabric3Exception { String producerName = producer.getDefinition().getName(); URI uri = producer.getParent().getUri(); JavaServiceContract serviceContract = (JavaServiceContract) producer.getDefinition().getServiceContract(); return new SpringConnectionSource(producerName, serviceContract.getInterfaceClass(), uri); }
protected Binding processService(ZeroMQ annotation, Service<ComponentType> boundService, InjectingComponentType componentType, Class<?> implClass, IntrospectionContext context) { if(!isActiveForEnvironment(annotation.environments())) { return null; } Class<?> serviceInterface = ((JavaServiceContract) boundService.getServiceContract()).getInterfaceClass(); ZeroMQMetadata metadata = new ZeroMQMetadata(); String bindingName = "ZMQ" + serviceInterface.getSimpleName(); ZeroMQBinding binding = new ZeroMQBinding(bindingName, metadata); int port = annotation.port(); if (port > 0) { SocketAddressDefinition address = new SocketAddressDefinition("localhost", port); metadata.setSocketAddresses(Collections.singletonList(address)); } else { parseAddresses(annotation, metadata, implClass, context); } processMetadata(annotation, metadata); return binding; }
private MetroWireTarget generateTarget(LogicalBinding<WsBinding> binding, URL targetUrl, JavaServiceContract contract) { Class<?> serviceClass = contract.getInterfaceClass(); WsBinding bindingDefinition = binding.getDefinition(); URL wsdlLocation = getWsdlLocation(bindingDefinition, serviceClass); Class<?> interfaze = contract.getInterfaceClass();
public MonitorWireTarget generateWireTarget(LogicalResourceReference<MonitorResourceReference> resourceReference) { LogicalComponent<?> component = resourceReference.getParent(); Class<?> type = ((JavaServiceContract)resourceReference.getDefinition().getServiceContract()).getInterfaceClass(); URI monitorable = component.getUri(); String destination = resourceReference.getDefinition().getDestination(); MonitorWireTarget definition = new MonitorWireTarget(type, monitorable, destination); definition.setOptimizable(true); return definition; } }
public MonitorWireTarget generateWireTarget(LogicalResourceReference<MonitorResourceReference> resourceReference) { LogicalComponent<?> component = resourceReference.getParent(); Class<?> type = ((JavaServiceContract)resourceReference.getDefinition().getServiceContract()).getInterfaceClass(); URI monitorable = component.getUri(); String destination = resourceReference.getDefinition().getDestination(); MonitorWireTarget definition = new MonitorWireTarget(type, monitorable, destination); definition.setOptimizable(true); return definition; } }
public MetroJavaWireSource generateSource(LogicalBinding<WsBinding> binding, JavaServiceContract contract) { Class<?> serviceClass = contract.getInterfaceClass(); WsBinding bindingDefinition = binding.getDefinition(); URL wsdlLocation = getWsdlLocation(bindingDefinition, serviceClass); Class<?> interfaze = contract.getInterfaceClass();
public PhysicalWireSource generateSource(LogicalReference reference) throws Fabric3Exception { URI uri = reference.getUri(); SystemWireSource definition = new SystemWireSource(); definition.setOptimizable(true); definition.setUri(uri); definition.setInjectable(new Injectable(InjectableType.REFERENCE, uri.getFragment())); JavaServiceContract serviceContract = (JavaServiceContract) reference.getDefinition().getServiceContract(); definition.setInterfaceClass(serviceContract.getInterfaceClass()); if (reference.getDefinition().isKeyed()) { definition.setKeyed(true); String className = reference.getDefinition().getKeyDataType().getType().getName(); definition.setKeyClassName(className); } return definition; }
public void generateWireSource(JavaWireSource source, LogicalReference reference) { URI uri = reference.getUri(); JavaServiceContract serviceContract = (JavaServiceContract) reference.getDefinition().getServiceContract(); source.setUri(uri); source.setInjectable(new Injectable(InjectableType.REFERENCE, uri.getFragment())); source.setInterfaceClass(serviceContract.getInterfaceClass()); // assume for now that any wire from a Java component can be optimized source.setOptimizable(true); if (reference.getDefinition().isKeyed()) { source.setKeyed(true); DataType type = reference.getDefinition().getKeyDataType(); String className = type.getType().getName(); source.setKeyClassName(className); } }
public void generateCallbackWireSource(JavaWireSource source, LogicalComponent<? extends JavaImplementation> component, JavaServiceContract contract) { InjectingComponentType type = component.getDefinition().getImplementation().getComponentType(); String name = null; for (Callback entry : type.getCallbacks().values()) { // NB: This currently only supports the case where one callback injection site of the same type is on an implementation. ServiceContract candidate = entry.getServiceContract(); MatchResult result = matcher.isAssignableFrom(candidate, contract, false); if (result.isAssignable()) { name = entry.getName(); break; } } if (name == null) { String interfaze = contract.getQualifiedInterfaceName(); throw new Fabric3Exception("Callback injection site not found for type: " + interfaze); } Injectable injectable = new Injectable(InjectableType.CALLBACK, name); source.setInjectable(injectable); source.setInterfaceClass(contract.getInterfaceClass()); URI uri = URI.create(component.getUri().toString() + "#" + name); source.setUri(uri); source.setOptimizable(false); }