-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1060 from eclipse-passage/1059
1059 prepare sourcebase for 2.3.0 release
- Loading branch information
Showing
10 changed files
with
224 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...ssage.lic.execute/src/org/eclipse/passage/lic/execute/BundleRequirementsForNamespace.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.lic.execute; | ||
|
||
import org.eclipse.passage.lic.api.registry.Registry; | ||
import org.eclipse.passage.lic.api.registry.StringServiceId; | ||
import org.eclipse.passage.lic.api.requirements.Requirement; | ||
import org.eclipse.passage.lic.api.requirements.ResolvedRequirements; | ||
import org.eclipse.passage.lic.api.requirements.ResolvedRequirementsRegistry; | ||
import org.eclipse.passage.lic.base.registry.ReadOnlyRegistry; | ||
import org.eclipse.passage.lic.equinox.requirements.BundleRequirements; | ||
import org.eclipse.passage.lic.internal.base.requirements.FilteredRequirements; | ||
|
||
@SuppressWarnings("restriction") | ||
final class BundleRequirementsForNamespace implements ResolvedRequirementsRegistry { | ||
|
||
private final String namespace; | ||
private final Registry<StringServiceId, ResolvedRequirements> delegate; | ||
|
||
BundleRequirementsForNamespace(String namespace) { | ||
this.namespace = namespace; | ||
this.delegate = new ReadOnlyRegistry<>(// | ||
new FilteredRequirements(// | ||
new BundleRequirements(), // | ||
this::declaredInNamespace// | ||
)); | ||
} | ||
|
||
@Override | ||
public Registry<StringServiceId, ResolvedRequirements> get() { | ||
return delegate; | ||
} | ||
|
||
private boolean declaredInNamespace(Requirement requirement) { | ||
return requirement.feature().identifier().startsWith(namespace); | ||
} | ||
|
||
} |
139 changes: 139 additions & 0 deletions
139
...clipse.passage.lic.execute/src/org/eclipse/passage/lic/execute/NamespaceConfiguraton.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.lic.execute; | ||
|
||
import java.util.function.Supplier; | ||
|
||
import org.eclipse.passage.lic.api.AccessCycleConfiguration; | ||
import org.eclipse.passage.lic.api.LicensedProduct; | ||
import org.eclipse.passage.lic.api.acquire.GrantsTraceService; | ||
import org.eclipse.passage.lic.api.acquire.LicenseAcquisitionServicesRegistry; | ||
import org.eclipse.passage.lic.api.agreements.AgreementAcceptanceService; | ||
import org.eclipse.passage.lic.api.conditions.evaluation.ExpressionEvaluatorsRegistry; | ||
import org.eclipse.passage.lic.api.conditions.evaluation.ExpressionPasringRegistry; | ||
import org.eclipse.passage.lic.api.conditions.evaluation.ExpressionTokenAssessorsRegistry; | ||
import org.eclipse.passage.lic.api.conditions.evaluation.PermissionEmittersRegistry; | ||
import org.eclipse.passage.lic.api.conditions.mining.ConditionTransportRegistry; | ||
import org.eclipse.passage.lic.api.conditions.mining.MinedConditionsRegistry; | ||
import org.eclipse.passage.lic.api.conditions.mining.MiningEquipment; | ||
import org.eclipse.passage.lic.api.inspection.RuntimeEnvironmentRegistry; | ||
import org.eclipse.passage.lic.api.io.HashesRegistry; | ||
import org.eclipse.passage.lic.api.io.KeyKeeperRegistry; | ||
import org.eclipse.passage.lic.api.io.StreamCodecRegistry; | ||
import org.eclipse.passage.lic.api.requirements.ResolvedRequirementsRegistry; | ||
import org.eclipse.passage.lic.api.restrictions.PermissionsExaminationServicesRegistry; | ||
import org.osgi.framework.Bundle; | ||
|
||
/** | ||
* @since 2.3 | ||
*/ | ||
@SuppressWarnings("restriction") | ||
public final class NamespaceConfiguraton implements AccessCycleConfiguration { | ||
|
||
private final AccessCycleConfiguration delegate; | ||
private final BundleRequirementsForNamespace requirements; | ||
|
||
public NamespaceConfiguraton(String namespace, Supplier<LicensedProduct> product, Supplier<Bundle> bundle) { | ||
this(new FocusedAccessCycleConfiguration.Wide(product, bundle), new BundleRequirementsForNamespace(namespace)); | ||
} | ||
|
||
public NamespaceConfiguraton(String namespace, AccessCycleConfiguration delegate) { | ||
this(delegate, new BundleRequirementsForNamespace(namespace)); | ||
} | ||
|
||
public NamespaceConfiguraton(AccessCycleConfiguration delegate, BundleRequirementsForNamespace requirements) { | ||
this.delegate = delegate; | ||
this.requirements = requirements; | ||
} | ||
|
||
@Override | ||
public ResolvedRequirementsRegistry requirementResolvers() { | ||
return requirements; | ||
} | ||
|
||
@Override | ||
public MinedConditionsRegistry conditionMiners() { | ||
return delegate.conditionMiners(); | ||
} | ||
|
||
@Override | ||
public MiningEquipment miningEquipment() { | ||
return delegate.miningEquipment(); | ||
} | ||
|
||
@Override | ||
public StreamCodecRegistry codecs() { | ||
return delegate.codecs(); | ||
} | ||
|
||
@Override | ||
public KeyKeeperRegistry keyKeepers() { | ||
return delegate.keyKeepers(); | ||
} | ||
|
||
@Override | ||
public ConditionTransportRegistry transports() { | ||
return delegate.transports(); | ||
} | ||
|
||
@Override | ||
public PermissionEmittersRegistry permissionEmitters() { | ||
return delegate.permissionEmitters(); | ||
} | ||
|
||
@Override | ||
public ExpressionPasringRegistry expressionParsers() { | ||
return delegate.expressionParsers(); | ||
} | ||
|
||
@Override | ||
public ExpressionEvaluatorsRegistry expressionEvaluators() { | ||
return delegate.expressionEvaluators(); | ||
} | ||
|
||
@Override | ||
public ExpressionTokenAssessorsRegistry expressionAssessors() { | ||
return delegate.expressionAssessors(); | ||
} | ||
|
||
@Override | ||
public RuntimeEnvironmentRegistry environments() { | ||
return delegate.environments(); | ||
} | ||
|
||
@Override | ||
public PermissionsExaminationServicesRegistry examinators() { | ||
return delegate.examinators(); | ||
} | ||
|
||
@Override | ||
public LicenseAcquisitionServicesRegistry acquirers() { | ||
return delegate.acquirers(); | ||
} | ||
|
||
@Override | ||
public HashesRegistry hashes() { | ||
return delegate.hashes(); | ||
} | ||
|
||
@Override | ||
public AgreementAcceptanceService acceptance() { | ||
return delegate.acceptance(); | ||
} | ||
|
||
@Override | ||
public GrantsTraceService grantsTrace() { | ||
return delegate.grantsTrace(); | ||
} | ||
|
||
} |