private Service<ComponentType> createServiceDefinition(Class<?> serviceInterface, InjectingComponentType componentType, IntrospectionContext context) { ServiceContract contract = contractProcessor.introspect(serviceInterface, context, componentType); return new Service<>(contract.getInterfaceName(), contract); } }
@SuppressWarnings({"unchecked"}) private Service createDefinition(Class<?> service, String name, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) { ServiceContract serviceContract = contractProcessor.introspect(service, implClass, context, componentType); Service definition = new Service(name, serviceContract); if (policyIntrospector != null) { policyIntrospector.introspectPolicyOnOperations(serviceContract, implClass, context); } return definition; } }
private void addServiceDefinitions(Object instance, InjectingComponentType componentType, IntrospectionContext context) { Class<?> implClass = instance.getClass(); Class[] interfaces = implClass.getInterfaces(); Class<?> serviceInterface; if (interfaces.length == 0) { serviceInterface = implClass; } else if (interfaces.length == 1) { serviceInterface = interfaces[0]; } else { MultipleInterfacesSupported failure = new MultipleInterfacesSupported(implClass, componentType); context.addError(failure); return; } String serviceName = serviceInterface.getSimpleName(); ServiceContract contract = contractProcessor.introspect(serviceInterface, context); Service<ComponentType> service = new Service<>(serviceName, contract); componentType.add(service); } }
private void addService(Class<?> interfaze, Component<?> definition) throws ValidationDeploymentException { URI uri = ContributionResolver.getContribution(); DefaultIntrospectionContext context = new DefaultIntrospectionContext(uri, getClass().getClassLoader()); JavaServiceContract contract = contractProcessor.introspect(interfaze, context); Service<ComponentType> service = new Service<>(interfaze.getSimpleName(), contract); definition.getComponentType().add(service); checkErrors(context); }
@SuppressWarnings({"unchecked"}) private Service<ComponentType> createServiceDefinition(Class<?> serviceInterface, Class<?> implClass, ComponentType componentType, IntrospectionContext context) { ServiceContract contract = contractProcessor.introspect(serviceInterface, context, componentType); Service<ComponentType> definition = new Service<>(contract.getInterfaceName(), contract); policyIntrospector.introspectPolicyOnOperations(contract, implClass, context); return definition; }
public void visitType(Remotable annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { ServiceContract serviceContract = contractProcessor.introspect(type, context, componentType); Service definition = new Service(serviceContract.getInterfaceName(), serviceContract); componentType.add(definition); } }
private void addService(Class<?> interfaze, Component<?> definition) throws ValidationDeploymentException { URI uri = ContributionResolver.getContribution(); DefaultIntrospectionContext context = new DefaultIntrospectionContext(uri, getClass().getClassLoader()); JavaServiceContract contract = contractProcessor.introspect(interfaze, context); Service<ComponentType> service = new Service<>(interfaze.getSimpleName(), contract); definition.getComponentType().add(service); checkErrors(context); }
/** * Adds a binding configuration to a service provided by the component. * * @param serviceName the service name * @param bindingDefinition the binding definition * @return the builder */ public T binding(String serviceName, Binding bindingDefinition) { checkState(); Component<?> definition = getComponent(); Service<Component> service = definition.getServices().get(serviceName); if (service == null) { service = new Service<>(serviceName); definition.add(service); } service.addBinding(bindingDefinition); return builder(); }
Service<ComponentType> service = new Service<>(serviceName, contract);
Service<ComponentType> service = new Service<>(serviceName, contract);