/** * Removes the service and all of its bindingTemplates of the annotated classes. */ public void unRegisterAnnotatedServices() { Dictionary<String, UDDIClerk> clerks = clientConfig.getUDDIClerks(); if (clerks.Count > 0) { AnnotationProcessor ap = new AnnotationProcessor(); Dictionary<string, UDDIClerk>.Enumerator it = clerks.GetEnumerator(); while (it.MoveNext()) { UDDIClerk c = it.Current.Value; List<businessService> services = ap.readServiceAnnotations( c.getClassWithAnnotations(), c.getUDDINode().getProperties()); foreach (businessService businessService in services) { c.unRegisterService(businessService.serviceKey, c.getUDDINode().getApiNode()); } } } }
/** * Removes the bindings of the services in the annotated classes. Multiple nodes may register * the same service using different BindingTempates. If the last BindingTemplate is removed * the service can be removed as well. * * @param removeServiceWithNoBindingTemplates - if set to true it will remove the service if there * are no other BindingTemplates. */ public void unRegisterBindingsOfAnnotatedServices(bool removeServiceWithNoBindingTemplates) { Dictionary<String, UDDIClerk> clerks = clientConfig.getUDDIClerks(); if (clerks.Count > 0) { AnnotationProcessor ap = new AnnotationProcessor(); Dictionary<string, UDDIClerk>.Enumerator it = clerks.GetEnumerator(); while (it.MoveNext()) { UDDIClerk c = it.Current.Value; List<businessService> services = ap.readServiceAnnotations( c.getClassWithAnnotations(), c.getUDDINode().getProperties()); foreach (businessService businessService in services) { if (businessService.bindingTemplates != null) { foreach (bindingTemplate bindingTemplate in businessService.bindingTemplates) { c.unRegisterBinding(bindingTemplate.bindingKey, c.getUDDINode().getApiNode()); } } if (removeServiceWithNoBindingTemplates) { try { businessService existingService = c.getServiceDetail(businessService.serviceKey, c.getUDDINode().getApiNode()); if (existingService.bindingTemplates == null || existingService.bindingTemplates.Length == 0) { c.unRegisterService(businessService.serviceKey, c.getUDDINode().getApiNode()); } } catch (Exception e) { log.error(e.Message, e); } } } } } }
/// <summary> /// Registers services to UDDI using a clerk, and the uddi.xml configuration. /// For .NET users, the class names must be AssemblyQualifiedNames /// </summary> /// <pre> /// Type objType = typeof(System.Array); /// Console.WriteLine ("Qualified assembly name:\n {0}.", objType.AssemblyQualifiedName.ToString()); /// </pre> public void registerAnnotatedServices() { Dictionary<String, UDDIClerk> uddiClerks = clientConfig.getUDDIClerks(); if (uddiClerks.Count > 0) { AnnotationProcessor ap = new AnnotationProcessor(); Dictionary<string, UDDIClerk>.Enumerator it = uddiClerks.GetEnumerator(); while (it.MoveNext()) { UDDIClerk c = it.Current.Value; List<businessService> services = ap.readServiceAnnotations( c.getClassWithAnnotations(), c.getUDDINode().getProperties()); foreach (businessService businessService in services) { log.info("Node=" + c.getUDDINode().getApiNode().name); c.register(businessService, c.getUDDINode().getApiNode()); } } } }