Created
May 6, 2013 12:37
-
-
Save cescoffier/5524848 to your computer and use it in GitHub Desktop.
Component using static properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.apache.felix.ipojo.runtime.core.test.components.components; | |
import org.apache.felix.ipojo.annotations.Component; | |
import org.apache.felix.ipojo.annotations.Instantiate; | |
import org.apache.felix.ipojo.annotations.Provides; | |
import org.apache.felix.ipojo.annotations.StaticServiceProperty; | |
import org.apache.felix.ipojo.runtime.core.test.services.FooService; | |
import java.util.Properties; | |
/** | |
* A component publishing a service with a static service property. | |
*/ | |
@Component | |
@Provides(properties = { | |
@StaticServiceProperty(name="property", value="value", type = "java.lang.String") | |
}) | |
@Instantiate(name="instanceWithProperties") | |
public class ComponentWithProperties implements FooService{ | |
// The implementation is meaningless. | |
@Override | |
public boolean foo() { | |
return false; | |
} | |
@Override | |
public Properties fooProps() { | |
return null; | |
} | |
@Override | |
public Boolean getObject() { | |
return null; | |
} | |
@Override | |
public boolean getBoolean() { | |
return false; | |
} | |
@Override | |
public int getInt() { | |
return 0; | |
} | |
@Override | |
public long getLong() { | |
return 0; | |
} | |
@Override | |
public double getDouble() { | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment