Apache CXF CDI + Apache Karaf We are going to follow the following specs to create CXF application in Karaf Jaxrs Spec - JSR-339 CDI 1.1 (JSR-346) Create an Rest API and Implement the Rest Service Provider for the Same. Expose the feature with feature:install cxf-jaxrs-cdi supported in Apache Karaf. osgi-example-rest.api Rest Api will Pom.xml <?xml version="1.0" encoding="UTF-8"?> <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> <parent> <groupId>osgi.example</groupId> <artifactId>osgi-example-rest</artifactId> <version>1.0</version> </parent> <artifactId>osgi-example-rest.api</artifactId> <packaging>bundl...
public interface Command<T>{ boolean execute(T context); } public class FirstCommand implements Command<Map<String, Object>>{ public boolean execute(Map<String, Object> context){ //doing something in here } } public class SecondCommand implements Command<Map<String, Object>>{ public boolean execute(Map<String, Object> context){ //doing something in here } } public class Chain { public List<Command> commands; public Chain(Command... commands){ this.commands = Arrays.asList(commands); } public void start(Object context){ for(Command command : commands){ boolean shouldStop = command.execute(context); i...
OSGI Command and Function In the Previous post we saw how to implement OSGI Service PAX CDI Implementation http://opensourceappexample.blogspot.ca/2017/06/apache-karaf-pax-cdi-osgi-service.html Let us see how we can use OSGI Command osgi.command.scope osgi.command.function pom.xml <?xml version="1.0" encoding="UTF-8"?> <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> <parent> <groupId>osgi.example</groupId> <artifactId>osgi-example-parent</artifactId> <version>1.0</version> </parent> <artifactId>osgi-example-cmd</artifactId> <packaging>bundle</packaging> <dependencies> <dep...
Comments
Post a Comment