public class DefaultInstanceBuilder extends java.lang.Object implements InstanceBuilder
| Constructor and Description |
|---|
DefaultInstanceBuilder(org.osgi.framework.BundleContext context,
java.lang.String type) |
| Modifier and Type | Method and Description |
|---|---|
DeclarationHandle |
build()
Build the declaration handle (never contains any configuration).
|
DeclarationHandle |
build(java.util.Dictionary<java.lang.String,java.lang.Object> configuration)
Only called through ConfigurationBuilder to apply the created configuration to this instance
|
ConfigurationBuilder |
configure()
Access the dedicated builder for configuration (properties).
|
InstanceBuilder |
context(org.osgi.framework.BundleContext context)
Override the default BundleContext used for declaration service registration.
|
InstanceBuilder |
name(java.lang.String name)
Specify the instance name.
|
InstanceBuilder |
type(java.lang.Class<?> type)
Specify the component's type of this instance.
|
InstanceBuilder |
type(java.lang.String type)
Specify the component's type of this instance.
|
InstanceBuilder |
version(java.lang.String version)
Specify the component's version of this instance.
|
public DefaultInstanceBuilder(org.osgi.framework.BundleContext context,
java.lang.String type)
public InstanceBuilder name(java.lang.String name)
InstanceBuildername in interface InstanceBuildername - instance name or nullpublic InstanceBuilder type(java.lang.String type)
InstanceBuildertype in interface InstanceBuildertype - type of the instance (cannot be null).public InstanceBuilder type(java.lang.Class<?> type)
InstanceBuildertype in interface InstanceBuildertype - type of the instance (cannot be null).public InstanceBuilder version(java.lang.String version)
InstanceBuilderversion in interface InstanceBuilderversion - component's version (can be null).public InstanceBuilder context(org.osgi.framework.BundleContext context)
InstanceBuilderorg.apache.felix.ipojo.extender package, declarations may not be
linked and activated properly.context in interface InstanceBuildercontext - new context to be used.public ConfigurationBuilder configure()
InstanceBuilderConfigurationBuilder.build()
to build the instance declaration configured with the right set of properties. Any attempt
to use InstanceBuilder.build() will result in a new declaration with no properties associated.
Good usage (produced declaration has the associated properties):
DeclarationHandle handle = builder.configure()
.property("hello", "world")
.build();
Bad usage (produced declaration does not have the associated properties):
builder.configure()
.property("hello", "world");
DeclarationHandle handle = builder.build();
configure in interface InstanceBuilderpublic DeclarationHandle build(java.util.Dictionary<java.lang.String,java.lang.Object> configuration)
configuration - public DeclarationHandle build()
InstanceBuilderDeclarationHandle.publish()build in interface InstanceBuilderCopyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.