Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Templates fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pkriens committed May 9, 2017
1 parent eeb9f7f commit db18d2e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@org.osgi.annotation.versioning.Version("1.0.0")
package {{basePackageName}}.api;
package {{basePackageName}};
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package {{basePackageName}}.api;
package {{basePackageName}};

import org.osgi.annotation.versioning.ProviderType;

/**
* This is an example enroute bundle that has a component that implements a
* simple API.
* This is an example OSGi enRoute bundle that has a component that implements an
* API.
*/

@ProviderType
public interface ExampleApi {
public interface {{service}} {

/**
* The interface is a minimal method.
*
*
* @param message the message to say
* @return true if the message could be spoken
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@RequireWebServerExtender
@RequireConfigurerExtender
@Component(name="{{projectName}}")
public class ExampleApplication implements REST {
public class {{primaryName}} implements REST {

public String getUpper(String string) {
return string.toUpperCase();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
package {{basePackageName}}.provider;
package {{basePackageName}};

import java.util.Map;

import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.metatype.annotations.ObjectClassDefinition;
import org.osgi.service.metatype.annotations.Designate;

import {{basePackageName}}.api.Provider;

/**
* This is the implementation.It registers a Provider service.
*/
@Component(immediate=true, name="{{projectName}}")
public class ProviderImpl implements Provider {
@Designate( ocd=ProviderImpl.Config.class, factory=true)
@Component(name="{{projectName}}")
public class ProviderImpl /* implements SomeApi */ {

@ObjectClassDefinition
@interface Config {
String name() default "World";
}

private String name;

@Activate
void activate(Map<String, Object> map) {
name = map.containsKey("name") ? (String) map.get("name") : "World";
say("Hello");
void activate(Config config) {
this.name = config.name();
}

@Deactivate
void deactivate(Map<String, Object> map) {
say("Goodbye");
}

@Override
public boolean say(String message) {
System.out.println(name + ":" + message);
return false;
void deactivate() {
}

}

0 comments on commit db18d2e

Please sign in to comment.