-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add binding to service provider for use in Groovy script
Add an additional binding for the Service Provider to Groovy scripts. ING-4265
- Loading branch information
1 parent
b8241c1
commit 990a152
Showing
5 changed files
with
67 additions
and
1 deletion.
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
44 changes: 44 additions & 0 deletions
44
...ale.common.core/src/eu/esdihumboldt/hale/common/core/service/DelegateServiceProvider.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) 2024 wetransform GmbH | ||
* | ||
* All rights reserved. This program and the accompanying materials are made | ||
* available under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation, either version 3 of the License, | ||
* or (at your option) any later version. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this distribution. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* Contributors: | ||
* wetransform GmbH <http://www.wetransform.to> | ||
*/ | ||
|
||
package eu.esdihumboldt.hale.common.core.service; | ||
|
||
/** | ||
* A DelegateServiceProvider delegates service requests to an underlying | ||
* ServiceProvider. It implements the ServiceProvider interface and forwards | ||
* getService calls to the specified underlying ServiceProvider. | ||
* | ||
* @author EmanuelaEpure | ||
*/ | ||
public class DelegateServiceProvider implements ServiceProvider { | ||
|
||
private final ServiceProvider serviceProvider; | ||
|
||
/** | ||
* Constructs a new DelegateServiceProvider with the specified | ||
* ServiceProvider. | ||
* | ||
* @param serviceProvider the underlying ServiceProvider to delegate to | ||
*/ | ||
public DelegateServiceProvider(ServiceProvider serviceProvider) { | ||
this.serviceProvider = serviceProvider; | ||
} | ||
|
||
@Override | ||
public <T> T getService(Class<T> serviceInterface) { | ||
return serviceProvider.getService(serviceInterface); | ||
} | ||
|
||
} |
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