ENTAXY-480 release version 1.8.3
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>connection-implementation</artifactId>
|
||||
<version>1.8.2.2</version>
|
||||
<version>1.8.3</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations.connection-implementation</groupId>
|
||||
<artifactId>connection-producing</artifactId>
|
||||
@ -35,4 +35,20 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Entaxy-Factory-Provider>true</Entaxy-Factory-Provider>
|
||||
<Entaxy-Template-Provider>true</Entaxy-Template-Provider>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -27,8 +27,11 @@ import org.osgi.service.component.ComponentContext;
|
||||
import org.osgi.service.component.annotations.Activate;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Deactivate;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
import org.osgi.service.component.annotations.ReferenceCardinality;
|
||||
import org.osgi.util.tracker.BundleTracker;
|
||||
|
||||
import ru.entaxy.platform.base.objects.factory.tracker.TrackedFactoryManager;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.BundleTrackerUtils;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.filter.BundleHeaderFilter;
|
||||
|
||||
@ -39,6 +42,9 @@ public class AdapterWrapManager {
|
||||
|
||||
protected BundleTracker<List<TrackedAdapter>> adapterTracker;
|
||||
|
||||
@Reference (cardinality = ReferenceCardinality.MANDATORY)
|
||||
TrackedFactoryManager trackedFactoryManager;
|
||||
|
||||
@Activate
|
||||
public void activate(ComponentContext componentContext) {
|
||||
this.bundleContext = componentContext.getBundleContext();
|
||||
@ -48,7 +54,7 @@ public class AdapterWrapManager {
|
||||
)
|
||||
.customizer(
|
||||
(new TrackedAdapterCustomizer())
|
||||
.listener(new TrackedAdapterCustomizerListener(bundleContext))
|
||||
.listener(new TrackedAdapterCustomizerListener(bundleContext, trackedFactoryManager))
|
||||
)
|
||||
.bundleState(Bundle.ACTIVE | Bundle.INSTALLED | Bundle.RESOLVED)
|
||||
.get();
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -90,7 +90,7 @@ public class AdapterWrapperGenerationProcessor implements GenerationProcessor {
|
||||
Map<String, Object> copy = new HashMap<>(parameters);
|
||||
parameters.put("connection", copy);
|
||||
|
||||
System.out.println("\n\n===>>>\n:" + parameters.toString() + "\n\n");
|
||||
// System.out.println("\n\n===>>>\n:" + parameters.toString() + "\n\n");
|
||||
|
||||
log.debug("RESULT PARAMETERS :: " + parameters.toString());
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -37,7 +37,9 @@ import ru.entaxy.platform.base.objects.EntaxyObject;
|
||||
import ru.entaxy.platform.base.objects.EntaxyObject.OBJECT_TYPES;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory.CONFIGURATION.OUTPUTS;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactoryUtils;
|
||||
import ru.entaxy.platform.base.objects.factory.configuration.FactoryElement;
|
||||
import ru.entaxy.platform.base.objects.factory.tracker.TrackedFactoryManager;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.base.support.JSONUtils;
|
||||
|
||||
@ -68,7 +70,9 @@ public class ConfigConverter {
|
||||
factoryElement.setId(metadata.get("id").getAsString());
|
||||
factoryElement.setType(OBJECT_TYPES.CONNECTION);
|
||||
|
||||
JsonElement factoryJson = gson.toJsonTree(factoryElement);
|
||||
JsonObject factoryJson = gson.toJsonTree(factoryElement).getAsJsonObject();
|
||||
factoryJson.addProperty(EntaxyFactory.CONFIGURATION.FACTORY.PARENT
|
||||
, TrackedFactoryManager.DEFAULT_PARENT);
|
||||
configuration.add(EntaxyFactory.CONFIGURATION.FACTORY_SECTION_NAME, factoryJson);
|
||||
|
||||
// add type specific section
|
||||
@ -102,11 +106,11 @@ public class ConfigConverter {
|
||||
JsonObject sourceGenerator = sourceGenerators.get(i).getAsJsonObject();
|
||||
JsonObject targetOutput = new JsonObject();
|
||||
|
||||
log.info("GENERATOR: " + sourceGenerator.toString());
|
||||
log.debug("GENERATOR: " + sourceGenerator.toString());
|
||||
|
||||
// name
|
||||
String name = sourceGenerator.get("type").getAsString();
|
||||
log.info("GENERATOR NAME: " + name);
|
||||
log.debug("GENERATOR NAME: " + name);
|
||||
|
||||
// isDefault: true for 'init'
|
||||
if (EntaxyFactory.CONFIGURATION.OUTPUTS.OUTPUT_TYPE_INIT.equals(name))
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -37,6 +37,7 @@ import org.slf4j.LoggerFactory;
|
||||
import ru.entaxy.base.generator.template.impl.ProvidedTemplate;
|
||||
import ru.entaxy.base.generator.template.impl.TemplateMetadata;
|
||||
import ru.entaxy.base.generator.template.impl.TemplateProvider;
|
||||
import ru.entaxy.platform.base.support.JSONUtils;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.UniformBundleTrackerCustomizer;
|
||||
|
||||
public class TrackedAdapterCustomizer extends UniformBundleTrackerCustomizer<List<TrackedAdapter>> {
|
||||
@ -52,12 +53,8 @@ public class TrackedAdapterCustomizer extends UniformBundleTrackerCustomizer<Lis
|
||||
|
||||
try {
|
||||
|
||||
String metadata = new BufferedReader (
|
||||
new InputStreamReader(
|
||||
metadataUrl.openStream(), StandardCharsets.UTF_8))
|
||||
.lines()
|
||||
.collect(Collectors.joining("\n"));
|
||||
|
||||
String metadata = JSONUtils.getJsonRootObjectString(metadataUrl);
|
||||
|
||||
TrackedAdapter trackedAdapter = new TrackedAdapter();
|
||||
trackedAdapter.setMetadata(metadata);
|
||||
trackedAdapter.setBundleId(bundle.getBundleId());
|
||||
@ -65,8 +62,8 @@ public class TrackedAdapterCustomizer extends UniformBundleTrackerCustomizer<Lis
|
||||
String configuration = ConfigConverter.convertFromAdapter(metadata);
|
||||
trackedAdapter.setConfiguration(configuration);
|
||||
|
||||
log.info("TrackedAdapter metadata: \n" + metadata);
|
||||
log.info("TrackedAdapter configuration: \n" + configuration);
|
||||
log.debug("TrackedAdapter metadata: \n" + metadata);
|
||||
log.debug("TrackedAdapter configuration: \n" + configuration);
|
||||
|
||||
Enumeration<URL> foundEntries = bundle.findEntries("/template/", "*.*", true);
|
||||
while (foundEntries.hasMoreElements()) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* connection-producing
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2022 EmDev LLC
|
||||
* Copyright (C) 2020 - 2023 EmDev LLC
|
||||
* ==========
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -28,12 +28,17 @@ import org.osgi.framework.BundleContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import ru.entaxy.base.generator.template.Template;
|
||||
import ru.entaxy.base.generator.template.TemplateImpl;
|
||||
import ru.entaxy.base.generator.template.TemplateService;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactory;
|
||||
import ru.entaxy.platform.base.objects.factory.EntaxyFactoryUtils;
|
||||
import ru.entaxy.platform.base.objects.factory.impl.DefaultFactory;
|
||||
import ru.entaxy.platform.base.objects.factory.tracker.TrackedFactoryManager;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.base.support.JSONUtils;
|
||||
import ru.entaxy.platform.base.support.osgi.tracker.BundleTrackerCustomizerListener;
|
||||
|
||||
public class TrackedAdapterCustomizerListener implements BundleTrackerCustomizerListener<List<TrackedAdapter>> {
|
||||
@ -42,9 +47,12 @@ public class TrackedAdapterCustomizerListener implements BundleTrackerCustomizer
|
||||
|
||||
protected BundleContext bundleContext;
|
||||
|
||||
public TrackedAdapterCustomizerListener(BundleContext bundleContext) {
|
||||
protected TrackedFactoryManager trackedFactoryManager;
|
||||
|
||||
public TrackedAdapterCustomizerListener(BundleContext bundleContext, TrackedFactoryManager factoryManager) {
|
||||
super();
|
||||
this.bundleContext = bundleContext;
|
||||
this.trackedFactoryManager = factoryManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -56,15 +64,18 @@ public class TrackedAdapterCustomizerListener implements BundleTrackerCustomizer
|
||||
|
||||
AdapterWrapperDefaultFactory factory = new AdapterWrapperDefaultFactory();
|
||||
// factory.setFactoryId(adapter.getId());
|
||||
factory.configure(adapter.configuration);
|
||||
adapter.setId(factory.getFactoryId());
|
||||
JsonObject effective = EntaxyFactoryUtils.calculateEffectiveJson(
|
||||
JSONUtils.getJsonRootObject(adapter.configuration)
|
||||
, trackedFactoryManager);
|
||||
factory.configure(effective);
|
||||
adapter.setId(factory.getId());
|
||||
|
||||
if (!factory.isValid())
|
||||
continue;
|
||||
|
||||
Dictionary<String, String> props = new Hashtable<String, String>();
|
||||
props.put(EntaxyFactory.SERVICE.PROP_ID, factory.getFactoryId());
|
||||
props.put(EntaxyFactory.SERVICE.PROP_TYPE, factory.getFactoryType());
|
||||
props.put(EntaxyFactory.SERVICE.PROP_ID, factory.getId());
|
||||
props.put(EntaxyFactory.SERVICE.PROP_TYPE, factory.getType());
|
||||
props.put(EntaxyFactory.SERVICE.PROP_ORIGIN_BUNDLE, adapter.getBundleId()+"");
|
||||
|
||||
adapter.serviceRegistration = this.bundleContext.registerService(
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core</groupId>
|
||||
<artifactId>objects-implementations</artifactId>
|
||||
<version>1.8.2.2</version>
|
||||
<version>1.8.3</version>
|
||||
</parent>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.core.objects-implementations</groupId>
|
||||
<artifactId>connection-implementation</artifactId>
|
||||
@ -12,5 +12,6 @@
|
||||
<description>ENTAXY :: PLATFORM :: CORE :: OBJECTS IMPLEMENTATIONS :: CONNECTION</description>
|
||||
<modules>
|
||||
<module>connection-producing</module>
|
||||
<module>standard-connections-pack</module>
|
||||
</modules>
|
||||
</project>
|
Reference in New Issue
Block a user