Skip to content

Commit

Permalink
#21: DefaultCompatibilityFactoryImpl defined as a @component thus ful…
Browse files Browse the repository at this point in the history
…filling dependency requirement for CompatibilityDaoMongoImpl.
  • Loading branch information
Zdenek Vales committed Feb 9, 2020
1 parent b36930a commit ee76a67
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
30 changes: 18 additions & 12 deletions core/crce-compatibility-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@
<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>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>10</source>
<target>10</target>
</configuration>
</plugin>
</plugins>
</build>

<parent>
<groupId>cz.zcu.kiv.crce</groupId>
Expand All @@ -32,6 +20,24 @@
<bundle.namespace>${namespace}.compatibility</bundle.namespace>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>10</source>
<target>10</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.dependencymanager.annotation</artifactId>
</plugin>
</plugins>
</build>

<dependencies>
<!--CRCE dependencies-->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import cz.zcu.kiv.crce.compatibility.*;
import cz.zcu.kiv.crce.metadata.type.Version;
import org.apache.felix.dm.annotation.api.Component;

import java.util.List;

/**
* Factory which creates default implementations of Compatibility interfaces.
*/
@Component(provides = {CompatibilityFactory.class})
public class DefaultCompatibilityFactoryImpl implements CompatibilityFactory {

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cz.zcu.kiv.crce.compatibility.dao.internal;

import cz.zcu.kiv.crce.compatibility.CompatibilityFactory;
import cz.zcu.kiv.crce.compatibility.dao.CompatibilityDao;
import org.apache.felix.dm.DependencyActivatorBase;
import org.apache.felix.dm.DependencyManager;
Expand Down Expand Up @@ -37,9 +38,9 @@ public void init(BundleContext context, DependencyManager manager) throws Except
.setInterface(s, compatibilityProps)
.setFactory(new CompatibilityDaoMongoFactory(), "get")
//requires CompatibilityFactory for proper mapping
// .add(createServiceDependency().setRequired(false)
// .setService(CompatibilityFactory.class)
// )
.add(createServiceDependency().setRequired(true)
.setService(CompatibilityFactory.class)
)
);
}

Expand Down

0 comments on commit ee76a67

Please sign in to comment.