This file contains hidden or 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
/** | |
* Policy client class. | |
* @author Dileep Hareendran | |
* | |
*/ | |
public class PolicyServiceClient { | |
private Set<PolicyService> services = new HashSet<PolicyService>(); | |
/** | |
* Hook method called on activation of this service client. |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="policy.service.client" immediate="true"> | |
<implementation class="com.x.policy.client.PolicyServiceClient"/> | |
<reference | |
interface="com.x.policy.service.api.PolicyService" | |
bind="addPolicyService" | |
unbind="removePolicyService" | |
cardinality="1..n" | |
policy="dynamic" |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="policy.service.a" immediate="true"> | |
<service> | |
<provide interface="com.x.policy.service.api.PolicyService"/> | |
</service> | |
<implementation class="com.x.policy.service.impl.PolicyServiceImpl"/> | |
</scr:component> |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="policy.service.api" immediate="false"> | |
<service> | |
<provide interface="com.x.policy.service.api.PolicyService"/> | |
</service> | |
</scr:component> |
This file contains hidden or 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
<!-- at top --> | |
<groupId>com.x</groupId> | |
<artifactId>policy.service.a</artifactId> | |
<version>3.0.0</version> | |
<packaging>bundle</packaging> | |
<!-- in dependencies --> | |
<dependencies> |
This file contains hidden or 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
<!-- at top, note packaging type changed --> | |
<groupId>com.x</groupId> | |
<artifactId>policy.service.api</artifactId> | |
<version>3.0.0</version> | |
<packaging>bundle</packaging> | |
================================== | |
<!-- inside build tag, replace maven jar plugin with this --> | |
<plugin> |
This file contains hidden or 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
<!-- at the top , note packaging is changed from jar to bundle--> | |
<groupId>com.x</groupId> | |
<artifactId>policy.client</artifactId> | |
<version>3.0.0</version> | |
<packaging>bundle</packaging> | |
=================================== | |
<!-- inside dependencies --> |
This file contains hidden or 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
Bundle-Name: Policy.Service.A | |
Bundle-SymbolicName: Policy.Service.A | |
Bundle-Description: policy service for Insurer A | |
Bundle-Version: 1.0.0 | |
Bundle-Activator: com.x.policy.Activator | |
Import-Package: org.osgi.framework, com.x.policy.service.api;version="1.0.0" |
This file contains hidden or 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
<groupId>com.x</groupId> | |
<artifactId>policy.client</artifactId> | |
<version>1.0.0</version> | |
<packaging>jar</packaging> | |
================================== | |
<dependency> | |
<groupId>com.x</groupId> | |
<artifactId>policy.service.api</artifactId> |
This file contains hidden or 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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.x</groupId> | |
<artifactId>policy.service.api</artifactId> | |
<version>1.0.0</version> | |
<packaging>jar</packaging> | |
<name>policy.service.api</name> |