此内容没有您所选择的语言版本。
Chapter 33. Working with Fabric Profiles
Profiles are applied to fabric containers, and they determine the function and behavior of their containers. A profile consists of code and configurations, which specify the type of service or application a container runs. The code may come from OSGi bundles and Karaf features pulled from repositories, also specified in the profile. Defined hierarchically, profiles can be set up to inherit from other profiles, building on their parents' definitions.
33.1. Creating a new profile
Overview
The tooling provides access to numerous profiles, each of which imparts specific functionality and behaviors to the containers to which it's assigned. But you may want to create new profiles that inherit from these base profiles, so you can override, for example, configuration details. You may also want to create your own profiles to deploy your own code. To do so, you create a new profile based on an existing one, and then change its configuration and properties to generate the specific behaviors you want to deploy to the target containers.
Note
This procedure creates a brand new profile. If you want to create a new version of an existing profile to incrementally test changes to deployed containers, see Chapter 34, Working with Versions
Procedure
To create a new profile:
- In Fabric Explorer, expand the fabric in which you want to create a new profile.
- Expand the fabric's tree to the level of the profiles, as shown in Figure 33.1.
Figure 33.1. Accessing the profiles
- Select the profile on which you want to base the new profile, and right-click it to open the context menu.ImportantBecause the selected profile is the parent of the new profile, the new profile inherits the selected profile's configurations, properties, features, repositories and bundles as well as those of the selected profile's ancestors. However, a child's configurations override an ancestor's when their configuration files have the same name.NoteNeither configuration files nor properties are visible within the tooling, but you can view them in the Red Hat JBoss Fuse Management Console. For details, see the Red Hat JBoss Fuse Management Console documentation at https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/.
- Select.
Figure 33.2. Create Profile dialog
- In Profile name, enter a name for the new profile.Use a name that is descriptive of the new profile's function.
- Clickto create and save the new profile.The new profile is added to the list of profiles in Fabric Explorer, under its parent profile.
- In Fabric Explorer, select the new profile to populate the Properties editor with the new profile's properties information and profile details.
- In the Properties editor, click the Details tab.
Figure 33.3. Profiles page
On the Profiles page, you can add, delete, or edit features, the repositories from which features are downloaded, and bundles. You can also add or remove parent profiles. Profiles can have multiple parents, and they inherit the qualities of eachFeatures are files that aggregate references to interdependent or related bundles that together define a feature. Typically, you'd use bundles only if the feature they define is not already included in a features file. For more information on bundles and features, see Deploying Features.Child profiles inherit everything (configurations, properties, features, repositories, and bundles) from their immediate parents and from all of their parents' ancestors. When the child's and any ancestor's configuration file have the same name, the child's configuration file replaces the ancestor's file. Otherwise, configurations are cumulative.NoteThe Profiles page displays only the features, repositories, and bundles added by the child profile, not those contributed by the profile's parents or other ancestors. The Parents pane shows (highlighted) the profile's immediate parents only. - Make the changes you want to the new profile to configure it.Changes are automatically saved as you make them.NoteIn Fuse Integration perspective, you can easily add a Fuse project to the new profile by dragging it from Project Explorer and dropping it onto the new profile in Fabric Explorer. When you do, the fabric tooling builds the project, runs all tests, installs the project in the new profile, and uploads the profile into the fabric's internal Maven repository. Because profiles are stored in a fabric's internal repository, they cannot be shared across other fabrics.ImportantIf you drop your project on a fabric container, rather than on a profile, the next time that container is provisioned, your project is wiped out.You can now assign the new profile to a container.
- In Fabric Explorer, select the container to which you want to assign the new profile.The fabric tooling populates the Properties editor with the container's properties information and profile details.
- Open the container's Details tab, and then select the new profile in the Profiles list.
Related topics
Section 34.1, “Creating a new version of a profile” |