public interface InstanceBuilder
context(org.osgi.framework.BundleContext) method can be used to override the default
BundleContext used for declaration service registration.| Modifier and Type | Method and Description |
|---|---|
DeclarationHandle |
build()
Build the declaration handle (never contains any configuration).
|
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.
|
InstanceBuilder name(java.lang.String name)
name - instance name or nullInstanceBuilder type(java.lang.String type)
type - type of the instance (cannot be null).InstanceBuilder type(java.lang.Class<?> type)
type - type of the instance (cannot be null).InstanceBuilder version(java.lang.String version)
version - component's version (can be null).InstanceBuilder context(org.osgi.framework.BundleContext context)
org.apache.felix.ipojo.extender package, declarations may not be
linked and activated properly.context - new context to be used.ConfigurationBuilder configure()
ConfigurationBuilder.build()
to build the instance declaration configured with the right set of properties. Any attempt
to use 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();
DeclarationHandle build()
DeclarationHandle.publish()Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.