public class CmNamespaceHandler extends Object implements NamespaceHandler
CmManagedProperties
,
CmManagedServiceFactory
,
CmProperties
,
CmPropertyPlaceholder
Constructor and Description |
---|
CmNamespaceHandler() |
Modifier and Type | Method and Description |
---|---|
ComponentMetadata |
decorate(Node node,
ComponentMetadata component,
ParserContext context)
Process a child node of an enclosing blueprint component.
|
void |
generateIdIfNeeded(ParserContext context,
MutableComponentMetadata metadata) |
static org.osgi.service.cm.ConfigurationAdmin |
getConfigAdmin() |
String |
getId(ParserContext context,
Element element) |
int |
getIdCounter() |
Set<Class> |
getManagedClasses()
Specify a set of classes that must be consistent between a blueprint bundle and this namespace handler
The blueprint extender will not invoke a namespace handler if any of the managed classes are inconsistent
with the class space of the blueprint bundle (i.e.
|
URL |
getSchemaLocation(String namespace)
Retrieve a URL from where the schema for a given namespace can be retrieved
|
static boolean |
isBlueprintNamespace(String ns) |
Metadata |
parse(Element element,
ParserContext context)
Parse a stand-alone blueprint component
Given an
Element node as a root, this method parses the stand-alone component and returns its
metadata. |
List<String> |
parseInterfaceNames(Element element) |
void |
setConfigAdmin(org.osgi.service.cm.ConfigurationAdmin configAdmin) |
void |
setIdCounter(int idCounter) |
public static final String BLUEPRINT_NAMESPACE
public static final String BLUEPRINT_CM_NAMESPACE_1_0
public static final String BLUEPRINT_CM_NAMESPACE_1_1
public static final String PROPERTY_PLACEHOLDER_ELEMENT
public static final String MANAGED_PROPERTIES_ELEMENT
public static final String MANAGED_SERVICE_FACTORY_ELEMENT
public static final String CM_PROPERTIES_ELEMENT
public static final String DEFAULT_PROPERTIES_ELEMENT
public static final String PROPERTY_ELEMENT
public static final String INTERFACES_ELEMENT
public static final String VALUE_ELEMENT
public static final String MANAGED_COMPONENT_ELEMENT
public static final String ID_ATTRIBUTE
public static final String PERSISTENT_ID_ATTRIBUTE
public static final String PLACEHOLDER_PREFIX_ATTRIBUTE
public static final String PLACEHOLDER_SUFFIX_ATTRIBUTE
public static final String DEFAULTS_REF_ATTRIBUTE
public static final String UPDATE_STRATEGY_ATTRIBUTE
public static final String UPDATE_METHOD_ATTRIBUTE
public static final String FACTORY_PID_ATTRIBUTE
public static final String AUTO_EXPORT_ATTRIBUTE
public static final String RANKING_ATTRIBUTE
public static final String INTERFACE_ATTRIBUTE
public static final String UPDATE_ATTRIBUTE
public static final String AUTO_EXPORT_DISABLED
public static final String AUTO_EXPORT_INTERFACES
public static final String AUTO_EXPORT_CLASS_HIERARCHY
public static final String AUTO_EXPORT_ALL
public static final String AUTO_EXPORT_DEFAULT
public static final String RANKING_DEFAULT
public int getIdCounter()
public void setIdCounter(int idCounter)
public static org.osgi.service.cm.ConfigurationAdmin getConfigAdmin()
public void setConfigAdmin(org.osgi.service.cm.ConfigurationAdmin configAdmin)
public URL getSchemaLocation(String namespace)
NamespaceHandler
getSchemaLocation
in interface NamespaceHandler
namespace
- The schema's namespacepublic Set<Class> getManagedClasses()
NamespaceHandler
getManagedClasses
in interface NamespaceHandler
Set
of classes that must be compatible with any blueprint bundle for which this namespace
handler is to apply or null
if no compatibility checks are to be performedpublic Metadata parse(Element element, ParserContext context)
NamespaceHandler
Element
node as a root, this method parses the stand-alone component and returns its
metadata. The supplied ParserContext
should be used to parse embedded blueprint elements as well
as creating metadata.parse
in interface NamespaceHandler
element
- The DOM element representing the custom componentcontext
- The ParserContext
for parsing sub-components and creating metadata objectsMutableMetadata
type to enable further decoration by other namespace handlerspublic ComponentMetadata decorate(Node node, ComponentMetadata component, ParserContext context)
NamespaceHandler
ComponentMetadata
instance, this will replace the argument
ComponentMetadata
in subsequent parsing and namespace handler invocations. A namespace
handler that elects to return a new ComponentMetadata
instance should
ensure that existing interceptors are registered against the new instance if appropriate.
Due to the interaction with interceptors, a namespace handler should prefer to change a component metadata
instead of returning a new instance wherever possible. This can be achieved by casting a
ComponentMetadata
to its corresponding MutabableComponentMetadata
instance.
Note however that a given ComponentMetadata
instance cannot be guaranteed to implement
the mutable interface if it was constructed by an agent other than the blueprint extender.decorate
in interface NamespaceHandler
node
- The node associated with this NamespaceHandler that should be used to decorate the enclosing
componentcomponent
- The enclosing blueprint componentcontext
- The parser contextpublic static boolean isBlueprintNamespace(String ns)
public String getId(ParserContext context, Element element)
public void generateIdIfNeeded(ParserContext context, MutableComponentMetadata metadata)
Copyright © 2016. All rights reserved.