Skip to content

Commit

Permalink
Merge pull request #661 from eclipse-passage/571190-1
Browse files Browse the repository at this point in the history
Bug 571190 build the solution on Framework services host
  • Loading branch information
eparovyshnaya authored Feb 16, 2021
2 parents d8fc77a + 2ee850c commit cec321a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.passage.lac.internal.seal.AgentFrameworkConstructor">
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.passage.lac.internal.gear.RuntimeFrameworkConstructor">
<service>
<provide interface="org.eclipse.passage.lic.internal.net.api.FrameworkConstructor"/>
</service>
<implementation class="org.eclipse.passage.lac.internal.seal.AgentFrameworkConstructor"/>
<implementation class="org.eclipse.passage.lac.internal.gear.RuntimeFrameworkConstructor"/>
</scr:component>
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.lac.internal.seal;
package org.eclipse.passage.lac.internal.gear;

import java.nio.file.Path;
import java.util.Arrays;
import java.util.Collections;
import java.util.function.Supplier;

import org.eclipse.passage.lic.internal.api.AccessCycleConfiguration;
Expand Down Expand Up @@ -55,20 +56,18 @@
import org.eclipse.passage.lic.internal.base.conditions.evaluation.SimpleMapExpressionEvaluationService;
import org.eclipse.passage.lic.internal.base.conditions.mining.PathResidentConditions;
import org.eclipse.passage.lic.internal.base.conditions.mining.PersonalLicenseMiningEquipment;
import org.eclipse.passage.lic.internal.base.io.PathKeyKeeper;
import org.eclipse.passage.lic.internal.base.registry.ReadOnlyRegistry;
import org.eclipse.passage.lic.internal.base.restrictions.BasePermissionsExaminationService;
import org.eclipse.passage.lic.internal.bc.BcStreamCodec;
import org.eclipse.passage.lic.internal.equinox.io.BundleKeyKeeper;
import org.eclipse.passage.lic.internal.equinox.requirements.BundleRequirements;
import org.eclipse.passage.lic.internal.equinox.requirements.ComponentRequirements;
import org.eclipse.passage.lic.internal.json.JsonConditionTransport;
import org.eclipse.passage.lic.internal.licenses.migration.tobemoved.UserFilteringConditionTransport;
import org.eclipse.passage.lic.internal.oshi.HardwareAssessmentService;
import org.eclipse.passage.lic.internal.oshi.HardwareEnvironment;
import org.osgi.framework.Bundle;

@SuppressWarnings("restriction")
public final class AgentConfiguration implements AccessCycleConfiguration {
public final class RuntimeConfiguration implements AccessCycleConfiguration {

private final Registry<StringServiceId, ResolvedRequirements> requirements;
private final Registry<ConditionMiningTarget, MinedConditions> conditions;
Expand All @@ -83,8 +82,7 @@ public final class AgentConfiguration implements AccessCycleConfiguration {
private final Registry<EvaluationType, RuntimeEnvironment> environments;
private final Registry<StringServiceId, PermissionsExaminationService> examinators;

public AgentConfiguration(Supplier<Path> source, Supplier<String> user, Supplier<LicensedProduct> product,
Supplier<Bundle> bundle) {
public RuntimeConfiguration(Supplier<Path> source, Supplier<String> user, Supplier<LicensedProduct> product) {
requirements = new ReadOnlyRegistry<>(Arrays.asList(//
new BundleRequirements(), //
new ComponentRequirements() //
Expand All @@ -100,7 +98,7 @@ public AgentConfiguration(Supplier<Path> source, Supplier<String> user, Supplier
new UserFilteringConditionTransport(user) //
));
codecs = new ReadOnlyRegistry<>(new BcStreamCodec(product));
keys = new ReadOnlyRegistry<>(new BundleKeyKeeper(product, bundle));
keys = new ReadOnlyRegistry<>(new PathKeyKeeper(product.get(), source));
emitters = new ReadOnlyRegistry<>(Arrays.asList(//
new BasePermissionEmittingService(//
expressionParsers(), //
Expand All @@ -119,9 +117,7 @@ public AgentConfiguration(Supplier<Path> source, Supplier<String> user, Supplier
environments = new ReadOnlyRegistry<>(Arrays.asList(//
new HardwareEnvironment() //
));
examinators = new ReadOnlyRegistry<>(Arrays.asList(//
new BasePermissionsExaminationService()//
));
examinators = new ReadOnlyRegistry<>(Collections.emptyList());
}

final MiningEquipment miningEquipment() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.lac.internal.seal;
package org.eclipse.passage.lac.internal.gear;

import java.util.function.Supplier;

Expand All @@ -21,20 +21,18 @@
import org.eclipse.passage.lic.internal.api.io.UnemployedCodecs;
import org.eclipse.passage.lic.internal.base.io.UserHomePath;
import org.eclipse.passage.lic.internal.net.handle.ProductUserRequest;
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;

@SuppressWarnings("restriction")
final class AgentFramework implements Framework {
final class RuntimeFramework implements Framework {

private final Supplier<String> user;
private final Supplier<LicensedProduct> product;

public AgentFramework(ProductUserRequest<?> request) {
public RuntimeFramework(ProductUserRequest<?> request) {
this(request.user()::get, request.product()::get);
}

public AgentFramework(Supplier<String> user, Supplier<LicensedProduct> product) {
public RuntimeFramework(Supplier<String> user, Supplier<LicensedProduct> product) {
this.user = user;
this.product = product;
}
Expand All @@ -46,7 +44,7 @@ public LicensedProduct product() {

@Override
public AccessCycleConfiguration accessCycleConfiguration() {
return new AgentConfiguration(new UserHomePath(), user, product, this::bundle);
return new RuntimeConfiguration(new UserHomePath(), user, product);
}

@Override
Expand All @@ -59,7 +57,4 @@ public UnemployedCodecs unemployedCodecs() {
throw new UnsupportedOperationException();
}

private Bundle bundle() {
return FrameworkUtil.getBundle(getClass());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.lac.internal.seal;
package org.eclipse.passage.lac.internal.gear;

import org.eclipse.passage.lic.internal.api.Framework;
import org.eclipse.passage.lic.internal.net.api.FrameworkConstructor;
Expand All @@ -19,11 +19,11 @@
import org.osgi.service.component.annotations.Component;

@Component
public final class AgentFrameworkConstructor implements FrameworkConstructor {
public final class RuntimeFrameworkConstructor implements FrameworkConstructor {

@Override
public <R extends NetRequest> Framework forRequest(ProductUserRequest<R> request) {
return new AgentFramework(request);
return new RuntimeFramework(request);
}

}

0 comments on commit cec321a

Please sign in to comment.