static private List<DatabindingProvider> providers() { List<DatabindingProvider> factories = new java.util.ArrayList<DatabindingProvider>(); for (DatabindingProvider p : ServiceFinder.find(DatabindingProvider.class)) { factories.add(p); } return factories; }
/** * Looks for all "META-INF/services/[className]" files and * create one instance for each class name found inside this file. */ private static <T> T[] findServices(Class<T> clazz, ClassLoader classLoader) { ServiceFinder<T> serviceFinder = ServiceFinder.find(clazz, classLoader); List<T> r = new ArrayList<T>(); for (T t : serviceFinder) { r.add(t); } return r.toArray((T[]) Array.newInstance(clazz, r.size())); }
/** * Looks for all "META-INF/services/[className]" files and * create one instance for each class name found inside this file. */ private static <T> T[] findServices(Class<T> clazz, ClassLoader classLoader) { ServiceFinder<T> serviceFinder = ServiceFinder.find(clazz, classLoader); List<T> r = new ArrayList<T>(); for (T t : serviceFinder) { r.add(t); } return r.toArray((T[]) Array.newInstance(clazz, r.size())); }
private StreamDecoder selectStreamDecoder() { for (StreamDecoder sd : ServiceFinder.find(StreamDecoder.class)) { return sd; } return new StreamDecoderImpl(); }
public static PolicyResolver create(){ for (PolicyResolverFactory factory : ServiceFinder.find(PolicyResolverFactory.class)) { PolicyResolver policyResolver = factory.doCreate(); if (policyResolver != null) { return policyResolver; } } // return default policy resolver. return DEFAULT_POLICY_RESOLVER; }
public static PolicyResolver create(){ for (PolicyResolverFactory factory : ServiceFinder.find(PolicyResolverFactory.class)) { PolicyResolver policyResolver = factory.doCreate(); if (policyResolver != null) { return policyResolver; } } // return default policy resolver. return DEFAULT_POLICY_RESOLVER; }
private StreamDecoder selectStreamDecoder() { for (StreamDecoder sd : ServiceFinder.find(StreamDecoder.class)) { return sd; } return new StreamDecoderImpl(); }
public WsgenOptions() { protocols.add(SOAP11); protocols.add(X_SOAP12); nonstdProtocols.put(X_SOAP12, SOAPBindingImpl.X_SOAP12HTTP_BINDING); ServiceFinder<WsgenExtension> extn = ServiceFinder.find(WsgenExtension.class); for(WsgenExtension ext : extn) { Class clazz = ext.getClass(); WsgenProtocol pro = (WsgenProtocol)clazz.getAnnotation(WsgenProtocol.class); protocols.add(pro.token()); nonstdProtocols.put(pro.token(), pro.lexical()); } }
public WsgenOptions() { protocols.add(SOAP11); protocols.add(X_SOAP12); nonstdProtocols.put(X_SOAP12, SOAPBindingImpl.X_SOAP12HTTP_BINDING); ServiceFinder<WsgenExtension> extn = ServiceFinder.find(WsgenExtension.class); for(WsgenExtension ext : extn) { Class clazz = ext.getClass(); WsgenProtocol pro = (WsgenProtocol)clazz.getAnnotation(WsgenProtocol.class); protocols.add(pro.token()); nonstdProtocols.put(pro.token(), pro.lexical()); } }
public WsgenOptions() { protocols.add(SOAP11); protocols.add(X_SOAP12); nonstdProtocols.put(X_SOAP12, SOAPBindingImpl.X_SOAP12HTTP_BINDING); ServiceFinder<WsgenExtension> extn = ServiceFinder.find(WsgenExtension.class); for(WsgenExtension ext : extn) { Class clazz = ext.getClass(); WsgenProtocol pro = (WsgenProtocol)clazz.getAnnotation(WsgenProtocol.class); protocols.add(pro.token()); nonstdProtocols.put(pro.token(), pro.lexical()); } }
@Deprecated private static MessageContext serviceFinder(final ClassLoader[] classLoader, final Creator creator) { final ClassLoader cl = classLoader.length == 0 ? null : classLoader[0]; for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) { final MessageContext messageContext = creator.create(factory); if (messageContext != null) return messageContext; } return creator.create(DEFAULT); }
private static BindingID createBindingId(String transport, SOAPVersion soapVersion) { if (!transport.equals(SOAPConstants.URI_SOAP_TRANSPORT_HTTP)) { for( BindingIDFactory f : ServiceFinder.find(BindingIDFactory.class) ) { BindingID bindingId = f.create(transport, soapVersion); if(bindingId!=null) { return bindingId; } } } return soapVersion.equals(SOAPVersion.SOAP_11)?BindingID.SOAP11_HTTP:BindingID.SOAP12_HTTP; }
@Deprecated private static MessageContext serviceFinder(final ClassLoader[] classLoader, final Creator creator) { final ClassLoader cl = classLoader.length == 0 ? null : classLoader[0]; for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) { final MessageContext messageContext = creator.create(factory); if (messageContext != null) return messageContext; } return creator.create(DEFAULT); }
private static BindingID createBindingId(String transport, SOAPVersion soapVersion) { if (!transport.equals(SOAPConstants.URI_SOAP_TRANSPORT_HTTP)) { for( BindingIDFactory f : ServiceFinder.find(BindingIDFactory.class) ) { BindingID bindingId = f.create(transport, soapVersion); if(bindingId!=null) { return bindingId; } } } return soapVersion.equals(SOAPVersion.SOAP_11)?BindingID.SOAP11_HTTP:BindingID.SOAP12_HTTP; }
@Deprecated private static MessageContext serviceFinder(final ClassLoader[] classLoader, final Creator creator) { final ClassLoader cl = classLoader.length == 0 ? null : classLoader[0]; for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) { final MessageContext messageContext = creator.create(factory); if (messageContext != null) return messageContext; } return creator.create(DEFAULT); }
static public MessageContextFactory createFactory(ClassLoader cl, WebServiceFeature ...f) { for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) { MessageContextFactory newfac = factory.newFactory(f); if (newfac != null) return newfac; } return new com.sun.xml.ws.api.message.MessageContextFactory(f); }
static public MessageContextFactory createFactory(ClassLoader cl, WebServiceFeature ...f) { for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) { MessageContextFactory newfac = factory.newFactory(f); if (newfac != null) return newfac; } return new com.sun.xml.ws.api.message.MessageContextFactory(f); }
static public MessageContextFactory createFactory(ClassLoader cl, WebServiceFeature ...f) { for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) { MessageContextFactory newfac = factory.newFactory(f); if (newfac != null) return newfac; } return new com.sun.xml.ws.api.message.MessageContextFactory(f); }
/** * Creates Message from SOAPMessage * @param saaj SOAPMessage * @return created Message */ public static Message create(SOAPMessage saaj) { for (SAAJFactory s : ServiceFinder.find(SAAJFactory.class)) { Message m = s.createMessage(saaj); if (m != null) return m; } return instance.createMessage(saaj); }
/** * Loads all {@link ServiceInterceptor}s and return aggregated one. */ public static @NotNull ServiceInterceptor load(@NotNull WSService service, @Nullable ClassLoader cl) { List<ServiceInterceptor> l = new ArrayList<ServiceInterceptor>(); // first service look-up for( ServiceInterceptorFactory f : ServiceFinder.find(ServiceInterceptorFactory.class)) l.add(f.create(service)); // then thread-local for( ServiceInterceptorFactory f : threadLocalFactories.get()) l.add(f.create(service)); return ServiceInterceptor.aggregate(l.toArray(new ServiceInterceptor[l.size()])); }