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.client | |
Bundle-SymbolicName: policy.service.client | |
Bundle-Description: Simple policy.service client | |
Bundle-Version: 1.0 | |
Bundle-Activator: com.x.policy.Activator | |
Import-Package: org.osgi.framework, com.x.policy.service.api;version="[1.0,2)" |
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.api | |
Bundle-Description: policy.service.api | |
Bundle-Version: 1.0.0 | |
Bundle-Activator: com.x.policy.Activator | |
Import-Package: org.osgi.framework | |
Export-Package: com.x.policy.service.api |
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
public void start(BundleContext context) throws Exception { | |
System.out.println("start simple policy client"); | |
ServiceReference[] serviceReferences = context.getServiceReferences(PolicyService.class.getName(), "(Insurer=*)"); | |
if(serviceReferences != null && serviceReferences.length > 0){ | |
for(int i =0; i < serviceReferences.length; i++){ | |
PolicyService policyService = (PolicyService)context.getService(serviceReferences[i]); | |
System.out.println("Trying to find the services"); |
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
http://www.eclipse.org/equinox/documents/quickstart-framework.php | |
http://download.eclipse.org/equinox/drops/R-Neon.3-201703010400/index.php | |
• somedir/ | |
○ configuration/ | |
§ config.ini | |
○ org.apache.commons.logging_1.1.1.v201101211721.jar | |
○ org.apache.felix.gogo.command_0.10.0.v201209301215.jar | |
○ org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar | |
○ org.apache.felix.gogo.shell_0.10.0.v201212101605.jar |
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
<dependencies> | |
<dependency> | |
<groupId>org.osgi</groupId> | |
<artifactId>org.osgi.core</artifactId> | |
<version>4.2.0</version> | |
<scope>provided</scope> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> |
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
public void start(BundleContext context) throws Exception { | |
System.out.println("start simple policy client"); | |
ServiceReference[] serviceReferences = context.getServiceReferences(PolicyService.class.getName(), "(Insurer=*)"); | |
if(serviceReferences != null && serviceReferences.length > 0){ | |
for(int i =0; i < serviceReferences.length; i++){ | |
PolicyService policyService = (PolicyService)context.getService(serviceReferences[i]); | |
System.out.println("Trying to find the services"); | |
if(policyService.verifyPolicy("1212")){ | |
System.out.println("Insurer A got bound at " + i); |
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-Description: policy service for Insurer A | |
Bundle-Version: 1.0.0 | |
Bundle-Activator: com.x.policy.Activator | |
Import-Package: org.osgi.framework | |
Export-Package: com.x.policy.service | |
======================================== | |
package com.x.policy.service; |
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
<dependencies> | |
<dependency> | |
<groupId>org.osgi</groupId> | |
<artifactId>org.osgi.core</artifactId> | |
<version>4.2.0</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> |
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
public void serviceChanged(ServiceEvent event) { | |
String[] objectClass = (String[]) | |
event.getServiceReference().getProperty("objectClass"); | |
if (event.getType() == ServiceEvent.REGISTERED) | |
{ | |
System.out.println( | |
"Ex1: Service of type " + objectClass[0] + " registered."); | |
} | |
else if (event.getType() == ServiceEvent.UNREGISTERING) |
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
module add -–name=com.mysql –-resources=mysql-connector-java-5.1.38.jar –-dependencies=javax.api,javax.transaction.api | |
/subsystem=datasources/jdbc-driver=mysql:add(driver-name="mysql",driver-module-name="com.mysql",driver-class-name=com.mysql.jdbc.Driver) |