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)
InstanceBuilder
name
in interface InstanceBuilder
name
- instance name or nullpublic InstanceBuilder type(java.lang.String type)
InstanceBuilder
type
in interface InstanceBuilder
type
- type of the instance (cannot be null).public InstanceBuilder type(java.lang.Class<?> type)
InstanceBuilder
type
in interface InstanceBuilder
type
- type of the instance (cannot be null).public InstanceBuilder version(java.lang.String version)
InstanceBuilder
version
in interface InstanceBuilder
version
- component's version (can be null).public InstanceBuilder context(org.osgi.framework.BundleContext context)
InstanceBuilder
org.apache.felix.ipojo.extender
package, declarations may not be
linked and activated properly.context
in interface InstanceBuilder
context
- new context to be used.public ConfigurationBuilder configure()
InstanceBuilder
ConfigurationBuilder.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 InstanceBuilder
public DeclarationHandle build(java.util.Dictionary<java.lang.String,java.lang.Object> configuration)
configuration
- public DeclarationHandle build()
InstanceBuilder
DeclarationHandle.publish()
build
in interface InstanceBuilder
Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.