Skip to content
Permalink
Browse files
Merge remote-tracking branch 'apache-git/master'
  • Loading branch information
ahgittin committed Mar 2, 2022
2 parents 37219d3 + 7d0c88e commit 016861ce5e739d934be46c42eab16df4b3990afd
Showing 3 changed files with 24 additions and 22 deletions.
@@ -5,6 +5,7 @@ layout: website-normal
children:
- { section: Memory Usage }
- { section: Authentication and Security }
- { section: Catalog in OSGi }
- brooklyn_cfg.md
- https.md
- cors.md
@@ -76,19 +77,12 @@ Users and passwords for Brooklyn can be configured in the brooklyn.cfg as detail
See [HTTPS Configuration](https.md) for general information on configuring HTTPS.


<!--
----------
-- NOTE: comment out this section on catalog as the behaviour described is not enabled by default since
-- https://github.com/apache/brooklyn-server/pull/233; re-enable this when that changes
----------
## Catalog in OSGi
With the traditional launcher, Brooklyn loads the initial contents of the catalog from a `default.catalog.bom` file
as described in the section on [installation](/guide/ops/production-installation.md). Brooklyn finds Java
implementations to provide for certain things in blueprints (entities, enrichers etc.) by scanning the classpath.

In the OSGI world this approach is not used, as each bundle only has visibility of its own and its imported Java packages.
Instead, in the Karaf OSGi container, each bundle can declare its own `catalog.bom` file, in the root of the bundle,
with the catalog declarations for any entities etc. that the bundle contains.
OSGi bundles may include a `catalog.bom` file at root, defining the elements to be added to the Apache Brooklyn catalog
when the bundle is installed. These bundles may be installed using the API or as part of the initial catalog.
The initial catalog is loaded from `etc/default.catalog.bom` which typically references files in `catalog/*`,
as described in the section on [installation](/guide/ops/production-installation.md).

For example, the `catalog.bom` file for Brooklyn's Webapp bundle looks like (abbreviated):

@@ -116,6 +110,12 @@ In the above YAML the first item declares that the bundle provides an entity who
item declares that the bundle provides a template application, with id `resilient-bash-web-cluster-template`, and
includes a description for what this is.

Note: the `type` argument can only refer to unqualified class names where the bundle is in scope,
such as contained in the same bundle as one containing the `catalog.bom` (in some cases),
or a bundle specified in the `org.apache.brooklyn.classloader.fallback.bundles` list supplied at startup;
to reference a type in another bundle, the syntax `osgi-bundle:org.package.Class` is supported in most places.


### Configuring applications in the Catalog

When running some particular deployment of Brooklyn it may not be desirable for the sample applications to appear in
@@ -202,13 +202,3 @@ to ensure any OSGi services they provide are available to other bundles,
for any of the bundle installation techniques listed above.)


### Caveats
In the OSGi world specifying class names by string in Brooklyn's configuration will work only
for classes living in Brooklyn's core modules. Raise an issue or ping us on IRC if you find
a case where this doesn't work for you. For custom SecurityProvider implementations refer to the
documentation of BrooklynLoginModule.
END Catalog in Karaf comment -->


@@ -12,8 +12,8 @@ children:
- configuration/
- persistence/
- high-availability/
- logging/
- externalized-configuration.md
- logging/
- requirements.md
- paths.md
- upgrades/
@@ -144,6 +144,18 @@ jstack-active $BROOKLYN_PID
{% endhighlight %}


#### OSGi Resolution

The Karaf OSGi subsystem can in some cases spend a lot of energy identifying which bundles should provide packages.
Often this can be resolved by removing redundant bundles.
To observe this, add the following to `etc/org.ops4j.pax.logging.cfg` (no restart normally needed):

log4j2.logger.felix.name = org.apache.felix
log4j2.logger.felix.level = DEBUG

To get a unique list of duplicate packages: `grep chains data/log/*.debug.log | sed 's/.*exposed to //' | sed 's/from .*//' | sort | uniq`


#### Profiling

If an in-depth investigation of the CPU usage (and/or object creation) of a Brooklyn Server is

0 comments on commit 016861c

Please sign in to comment.