Commit e6f2ff22 authored by Constantin Jucovschi's avatar Constantin Jucovschi

initial commit

parents
<project>
<modelVersion>4.0.0</modelVersion>
<name>DeepaMehta 4 Plugin Example</name>
<groupId>de.deepamehta</groupId>
<artifactId>deepamehta-plugin-example</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<maven-bundle-plugin.version>2.4.0</maven-bundle-plugin.version>
<osgi.version>5.0.0</osgi.version>
</properties>
<dependencies>
<dependency>
<groupId>de.deepamehta</groupId>
<artifactId>deepamehta-core</artifactId>
<version>4.3</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.annotations</artifactId>
<version>1.11.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>${osgi.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>${osgi.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- BND Maven Plugin Configuration -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Import-Package>*;</Import-Package>
<Export-Package>de.deepamehta.plugin.example*</Export-Package>
</instructions>
</configuration>
</plugin>
<!-- iPOJO Maven Plugin Configuration : nothing to do -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-ipojo-plugin</artifactId>
<version>1.11.2</version>
<executions>
<execution>
<goals>
<goal>ipojo-bundle</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package de.deepamehta.plugin.example;
import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Instantiate;
import org.apache.felix.ipojo.annotations.Invalidate;
import org.apache.felix.ipojo.annotations.Requires;
import org.apache.felix.ipojo.annotations.Validate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.deepamehta.core.TopicType;
import de.deepamehta.core.service.DeepaMehtaService;
@Instantiate
@Component
public class Plugin {
@Requires
DeepaMehtaService deepa;
Logger log = LoggerFactory.getLogger(getClass());
@Validate
void start() {
for (TopicType type : deepa.getAllTopicTypes()) {
log.info(type.getTypeUri());
}
}
@Invalidate
void stop() {
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment