-
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.
Bug 571190 build the solution on Framework services host
Substitute artificial inheritance with delegation Signed-off-by: eparovyshnaya <[email protected]>
- Loading branch information
1 parent
f242aee
commit 8910c42
Showing
8 changed files
with
108 additions
and
18 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...assage.lic.base/src/org/eclipse/passage/lic/internal/base/registry/ProducingRegistry.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,44 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 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.internal.base.registry; | ||
|
||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.eclipse.passage.lic.internal.api.registry.Registry; | ||
import org.eclipse.passage.lic.internal.api.registry.Service; | ||
import org.eclipse.passage.lic.internal.api.registry.ServiceId; | ||
|
||
/** | ||
* Begets new instance of a service for each {@code service} request. | ||
*/ | ||
public abstract class ProducingRegistry<I extends ServiceId, S extends Service<I>> implements Registry<I, S> { | ||
|
||
@Override | ||
public boolean hasService(I id) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public S service(I id) { | ||
return brandNew(id); | ||
} | ||
|
||
@Override | ||
public Collection<S> services() { | ||
return Collections.emptyList(); | ||
} | ||
|
||
protected abstract S brandNew(I id); | ||
|
||
} |
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