Skip to content

Commit

Permalink
Signed-off-by: Mark Hoffmann <m.hoffmann@data-in-motion.biz>
Browse files Browse the repository at this point in the history
  • Loading branch information
maho7791 committed May 16, 2023
1 parent 0d4cbd6 commit d6e3086
Show file tree
Hide file tree
Showing 115 changed files with 1,425 additions and 164 deletions.
5 changes: 3 additions & 2 deletions cnf/build.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# Gecko EMF OSGi - geckoEMF
# OSGi-Test Support - gecko-osgitest
# DIMC Github-Configuration - gecko-dimc
# Jacoco Support - gecko-jacoco
# Jacoco Support - gecko-jacoco

-library: \
geckoEMF,\
geckoOSGi-Test,\
Expand All @@ -14,7 +15,7 @@

# Needed because we enabled library 'gecko-dimc'
github-project: org.gecko.playground
base-version: 1.0.0.SNAPSHOT
base-version: 1.0.0

# Maven Central Group-Id
-groupid: org.gecko.playground
Expand Down
2 changes: 1 addition & 1 deletion org.gecko.playground.config/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Bundle-Name: Runtime Configuration
Bundle-Name: Playground Runtime Configuration
Bundle-Version: 1.0.0.SNAPSHOT

-includeresource: \
Expand Down
7 changes: 7 additions & 0 deletions org.gecko.playground.ds.simple/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="aQute.bnd.classpath.container"/>
<classpathentry kind="src" output="bin" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions org.gecko.playground.ds.simple/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
23 changes: 23 additions & 0 deletions org.gecko.playground.ds.simple/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.gecko.playground.ds.simple</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>bndtools.core.bndbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>bndtools.core.bndnature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
encoding/bnd.bnd=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
Empty file.
15 changes: 15 additions & 0 deletions org.gecko.playground.ds.simple/hello-component.bndrun
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-runfw: org.apache.felix.framework;version='[7.0.5,7.0.5]'
-runee: JavaSE-17
-runrequires: \
bnd.identity;id='org.gecko.playground.ds.simple',\
bnd.identity;id='org.apache.felix.gogo.command',\
bnd.identity;id='org.apache.felix.gogo.shell'
-runbundles: \
org.apache.felix.scr;version='[2.2.6,2.2.7)',\
org.gecko.playground.ds.simple;version=snapshot,\
org.osgi.service.component;version='[1.5.1,1.5.2)',\
org.osgi.util.function;version='[1.2.0,1.2.1)',\
org.osgi.util.promise;version='[1.3.0,1.3.1)',\
org.apache.felix.gogo.command;version='[1.1.2,1.1.3)',\
org.apache.felix.gogo.runtime;version='[1.1.6,1.1.7)',\
org.apache.felix.gogo.shell;version='[1.1.4,1.1.5)'
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.gecko.playground.ds.simple;

import org.gecko.playground.ds.simple.logging.Log;
import org.osgi.service.component.annotations.Component;

@Component
public class ConsoleLog implements Log {

public ConsoleLog () {
System.out.println("ConsoleLog created");
}

@Override
public void logMessage(String message) {
System.out.println("LOG : " + message);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.gecko.playground.ds.simple;

import org.osgi.service.component.annotations.Component;

@Component
public class HelloComponent {

public HelloComponent () {
System.out.println("HelloComponent created");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.gecko.playground.ds.simple.logging;

public interface Log {

void logMessage(String message);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@org.osgi.annotation.bundle.Export
@org.osgi.annotation.versioning.Version("1.0.0")
package org.gecko.playground.ds.simple.logging;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.gecko.playground.ds.simple.properties;

import org.gecko.playground.ds.simple.logging.Log;
import org.osgi.service.component.annotations.Component;

//@Component(property = "fizz=buzz")
@MyServiceProp(foo = "bar")
public class AnotherLog implements Log {

@Override
public void logMessage(String message) {
System.out.println("ANOTHER LOG : " + message);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.gecko.playground.ds.simple.properties;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.osgi.service.component.annotations.ComponentPropertyType;

@ComponentPropertyType
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
public @interface MyServiceProp {

String foo();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.gecko.playground.ds.simple.references;

import org.gecko.playground.ds.simple.logging.Log;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

//@Component
public class ReferencedComponent {

public ReferencedComponent () {
System.out.println("ReferencedComponent created");
}

@Reference
void setLog(Log log) {
System.out.println("set Log " + log.getClass().getName());
}

void unsetLog(Log log) {
System.out.println("set Log " + log.getClass().getName());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.gecko.playground.ds.simple.services;

public interface MyService {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.gecko.playground.ds.simple.services;

public interface MyService1 {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.gecko.playground.ds.simple.services;

public interface MyService2 {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.gecko.playground.ds.simple.services;

import org.osgi.service.component.annotations.Component;

//@Component(service = MyService.class)
//@Component(service = {MyService1.class, MyService2.class})
//@Component(service = {})
public class MyServiceImpl implements MyService, MyService1, MyService2 {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package org.gecko.playground.ds.simple.services;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.gecko.playground.ds.simple.shell;

import org.osgi.service.component.annotations.Component;

//@Component (service = Object.class ,
// property = { "osgi.command.scope=hello",
// "osgi.command.function=sagHallo",
// "osgi.command.function=sayHello"})
public class HelloCommand {

public void sayHello () {
System.out.println("I wanted to say Hello!");
}

// public void sagHallo () {
// System.out.println("Ich wollte nur Hallo sagen!");
// }

}
2 changes: 1 addition & 1 deletion org.gecko.playground.ds/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
{
"name": "Happy",
"year": 2010,
"description": "I wanna be happy"
"description": "I wanna be shappy"
}
}
2 changes: 2 additions & 0 deletions org.gecko.playground.ds/configurator.config.bnd
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-includeresource: \
OSGI-INF/configurator/=config/

-resourceonly: true

Require-Capability: osgi.extender;filter:='(osgi.extender=osgi.configurator)'
3 changes: 2 additions & 1 deletion org.gecko.playground.ds/factory.bnd
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-privatepackage: \
org.gecko.playground.ds.factory,\
org.gecko.playground.ds.factory.cmd
org.gecko.playground.ds.factory.cmd
Export-Package: org.gecko.playground.ds.factory.api
1 change: 1 addition & 0 deletions org.gecko.playground.ds/factory.garden.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-privatepackage: org.gecko.playground.ds.factory.garden
1 change: 1 addition & 0 deletions org.gecko.playground.ds/factory.home.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-privatepackage: org.gecko.playground.ds.factory.home
8 changes: 7 additions & 1 deletion org.gecko.playground.ds/launch_config.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,10 @@
-runproperties: \
osgi.console.enable.builtin=false,\
osgi.console=
-runblacklist: bnd.identity;id='org.osgi.service.cm'
-runblacklist: \
bnd.identity;id='org.osgi.service.cm',\
bnd.identity;id='org.gecko.playground.ds.factory',\
bnd.identity;id='org.gecko.playground.ds.greedy',\
bnd.identity;id='org.gecko.playground.ds.greedy.very',\
bnd.identity;id='org.gecko.playground.ds.prototype',\
bnd.identity;id='org.gecko.playground.ds.simple'
8 changes: 6 additions & 2 deletions org.gecko.playground.ds/launch_factory.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
-runrequires: \
bnd.identity;id='org.apache.felix.gogo.command',\
bnd.identity;id='org.apache.felix.gogo.shell',\
bnd.identity;id='org.gecko.playground.ds.factory'
bnd.identity;id='org.gecko.playground.ds.factory',\
bnd.identity;id='org.gecko.playground.ds.factory.garden',\
bnd.identity;id='org.gecko.playground.ds.factory.home'
-runbundles: \
org.apache.felix.gogo.command;version='[1.1.2,1.1.3)',\
org.apache.felix.gogo.runtime;version='[1.1.6,1.1.7)',\
Expand All @@ -13,7 +15,9 @@
org.apache.felix.scr;version='[2.2.6,2.2.7)',\
org.osgi.service.component;version='[1.5.1,1.5.2)',\
org.osgi.util.function;version='[1.2.0,1.2.1)',\
org.osgi.util.promise;version='[1.3.0,1.3.1)'
org.osgi.util.promise;version='[1.3.0,1.3.1)',\
org.gecko.playground.ds.factory.garden;version=snapshot,\
org.gecko.playground.ds.factory.home;version=snapshot

-runproperties: \
osgi.console.enable.builtin=false,\
Expand Down
2 changes: 1 addition & 1 deletion org.gecko.playground.ds/launch_greedy.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
org.osgi.util.function;version='[1.2.0,1.2.1)',\
org.osgi.util.promise;version='[1.3.0,1.3.1)'

-runproperties: \
-runproperties: \
osgi.console.enable.builtin=false,\
osgi.console=
-runblacklist: bnd.identity;id='org.osgi.service.cm'
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Modified;

/**
*
* @author mark
* @since 29.04.2022
*/
@Component(name = "MyFancyConfig", configurationPolicy = ConfigurationPolicy.REQUIRE)
public class ConfigComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
*/
package org.gecko.playground.ds.config;

/**
*
* @author mark
* @since 29.04.2022
*/
public @interface MyFancyConfig {

String name();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,15 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.gecko.playground.ds.factory.api.Device;
import org.gecko.playground.ds.factory.api.DeviceHandler;
import org.osgi.service.component.ComponentFactory;
import org.osgi.service.component.ComponentInstance;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;

/**
*
* @author mark
* @since 29.04.2022
*/
@Component(immediate = true)
public class DeviceHandlerService implements DeviceHandler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@
* Contributors:
* Data In Motion - initial API and implementation
*/
package org.gecko.playground.ds.factory;
package org.gecko.playground.ds.factory.api;

/**
*
* @author mark
* @since 29.04.2022
*/
public interface Device {

String getType();
Expand Down
Loading

0 comments on commit d6e3086

Please sign in to comment.