use of io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem in project camel-quarkus by apache.
the class JacksonDataformatXmlSupportProcessor method serviceProviders.
@BuildStep
void serviceProviders(BuildProducer<ServiceProviderBuildItem> serviceProviders) {
Stream.concat(Stream.of(JsonFactory.class, ObjectCodec.class, VerifierFactoryLoader.class, DatatypeLibraryFactory.class, XMLEventFactory.class, XMLInputFactory.class, XMLOutputFactory.class).map(Class::getName), Stream.of(XMLValidationSchemaFactory.INTERNAL_ID_SCHEMA_DTD, XMLValidationSchemaFactory.INTERNAL_ID_SCHEMA_RELAXNG, XMLValidationSchemaFactory.INTERNAL_ID_SCHEMA_W3C, XMLValidationSchemaFactory.INTERNAL_ID_SCHEMA_TREX).map(schemaId -> XMLValidationSchemaFactory.class.getName() + "." + schemaId)).forEach(serviceName -> {
try {
final Set<String> names = ServiceUtil.classNamesNamedIn(Thread.currentThread().getContextClassLoader(), SERVICES_PREFIX + serviceName);
serviceProviders.produce(new ServiceProviderBuildItem(serviceName, new ArrayList<>(names)));
} catch (IOException e) {
throw new RuntimeException(e);
}
});
}
use of io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem in project camel-quarkus by apache.
the class AtlasmapProcessor method registerNativeImageResources.
@BuildStep
void registerNativeImageResources(BuildProducer<ServiceProviderBuildItem> services, BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
Stream.of(AtlasConverter.class.getName(), AtlasFieldAction.class.getName(), Action.class.getName()).forEach(service -> {
try {
Set<String> implementations = ServiceUtil.classNamesNamedIn(Thread.currentThread().getContextClassLoader(), ATLASMAP_SERVICE_BASE + service);
services.produce(new ServiceProviderBuildItem(service, implementations.toArray(new String[0])));
// register those classes for reflection too
// we don't need to add external dependency atlas-core for the services
String[] dtos = implementations.stream().toArray(String[]::new);
reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, dtos));
} catch (IOException e) {
throw new RuntimeException(e);
}
});
}
use of io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem in project camel-quarkus by apache.
the class AzureCoreSupportProcessor method nativeResources.
@BuildStep
void nativeResources(BuildProducer<ServiceProviderBuildItem> services, BuildProducer<NativeImageResourceBuildItem> nativeResources) {
Stream.of(// TODO move this to a separate camel-quarkus-azure-core extension
HttpClientProvider.class.getName(), // TODO: move to reactor extension
"reactor.blockhound.integration.BlockHoundIntegration").forEach(service -> {
try {
Set<String> implementations = ServiceUtil.classNamesNamedIn(Thread.currentThread().getContextClassLoader(), "META-INF/services/" + service);
services.produce(new ServiceProviderBuildItem(service, implementations.toArray(new String[0])));
} catch (IOException e) {
throw new RuntimeException(e);
}
});
nativeResources.produce(new NativeImageResourceBuildItem("azure-core.properties"));
}
use of io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem in project camel-quarkus by apache.
the class SoapProcessor method serviceProviders.
@BuildStep
void serviceProviders(BuildProducer<ServiceProviderBuildItem> serviceProvider) {
String[] soapVersions = new String[] { "1_1", "1_2" };
for (String version : soapVersions) {
serviceProvider.produce(new ServiceProviderBuildItem("javax.xml.soap.MessageFactory", "com.sun.xml.messaging.saaj.soap.ver" + version + ".SOAPMessageFactory" + version + "Impl"));
serviceProvider.produce(new ServiceProviderBuildItem("javax.xml.soap.SOAPFactory", "com.sun.xml.messaging.saaj.soap.ver" + version + ".SOAPFactory" + version + "Impl"));
}
serviceProvider.produce(new ServiceProviderBuildItem("javax.xml.soap.SOAPConnectionFactory", "com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnectionFactory"));
serviceProvider.produce(new ServiceProviderBuildItem("javax.xml.soap.SAAJMetaFactory", "com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl"));
}
use of io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem in project camel-k-runtime by apache.
the class CoreProcessor method registerServices.
@BuildStep
List<ServiceProviderBuildItem> registerServices(CombinedIndexBuildItem combinedIndexBuildItem) {
final IndexView view = combinedIndexBuildItem.getIndex();
final String serviceType = "org.apache.camel.k.Runtime$Listener";
return stream(getAllKnownImplementors(view, serviceType)).map(i -> new ServiceProviderBuildItem(serviceType, i.name().toString())).collect(Collectors.toList());
}
Aggregations