1 package org.jbpm.bpel.service.spi; 2 3 import java.util.ArrayList ; 4 import java.util.List ; 5 6 import javax.xml.namespace.QName ; 7 8 9 import org.jbpm.bpel.service.exe.ServiceReference; 10 11 15 public abstract class EndpointReferenceFactory { 16 17 private static List factories = new ArrayList (); 18 19 protected EndpointReferenceFactory() { 20 } 21 22 public abstract EndpointReference createEndpoint(ServiceReference serviceRef); 23 24 public abstract boolean acceptsReference(QName endpointRefName, String refScheme); 25 26 public static EndpointReferenceFactory getInstance(QName endpointRefName, String refScheme) { 27 for (int i = 0, n = factories.size(); i < n; i++) { 28 EndpointReferenceFactory factory = (EndpointReferenceFactory) factories.get(i); 29 if (factory.acceptsReference(endpointRefName, refScheme)) { 30 return factory; 31 } 32 } 33 return null; 34 } 35 36 public static void registerInstance(EndpointReferenceFactory instance) { 37 factories.add(instance); 38 } 39 } 40 | Popular Tags |