WildFly Paths: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 9: Line 9:


WildFly uses logical names for filesystem paths. All top-level configuration files <tt>standalone.xml</tt>, <tt>domain.xml</tt> and <tt>host.xml</tt> include a <tt><paths></tt> section for declaring paths. Closer declaration to the server take precedence.
WildFly uses logical names for filesystem paths. All top-level configuration files <tt>standalone.xml</tt>, <tt>domain.xml</tt> and <tt>host.xml</tt> include a <tt><paths></tt> section for declaring paths. Closer declaration to the server take precedence.
For <tt>domain.xml</tt>, the <paths> element must occur between <system-properties> and <management>.


=WildFly Standard Paths=
=WildFly Standard Paths=
Line 16: Line 18:
</blockquote>
</blockquote>


=Adding Custom Paths=
=relative-to=


"<tt>relative-to</tt>" attribute references a global path name in the domain model.


=Adding Custom Paths=


<font color=red>
We can add more named paths, so we can use them as "relative-to". They are added as follows:
Example:


{{{
<pre>
}}}
<server ...>
</font>
  <extensions>
      ...
  </extensions>
  <paths>
      <path name="hornetq.shared.dir" path="C:/tmp/hqd"/>
  </paths>
  ...
</server>
</pre>


"relative-to" attribute references a global path name in the domain model. <font color=red>If "relative-to" is not explicitly specified ...</font>
In the above example, "<tt>hornetq.shared.dir</tt>" can be used as path name for "<tt>relative-to</tt>" used in HornetQ configuration.


Available "relative-to" roots - they are referred to as "path names":
=Adding Custom Paths within the WildFly Layout=


A custom path that lives within the WildFly layout can be declared in two ways - either as an absolute path, or a path relative to one of the WildFly "known" locations:


* "user.home"
<pre>
* "user.dir"
* "java.home"
 
!!!Adding more named paths
 
We can add more named paths, so we can use them as "relative-to". They are added as follows:
 
{{{
 
<server xmlns="urn:jboss:domain:1.3">
    <extensions>
        ...
    </extensions>
 
     <paths>
     <paths>
         <path name="hornetq.shared.dir" path="C:/tmp/hqd"/>
         <path name="hornetq.active.dir" path="${jboss.server.data.dir}/hornetq-active"/>
     </paths>
     </paths>
 
</pre>
  ...
 
}}}
 
In the above example, "hornetq.shared.dir" can be used as path name for "relative-to" used in HornetQ configuration.
 
 
!!!PathManagerService and HornetQ
 
 
PathManagerService is used to resolve configuration entries specified in the format:
 
{{{
 
  ...
  <bindings-directory path="./bindings" relative-to="jboss.server.base.dir"/>
  ...
 
}}}


or
or


<pre>
    <paths>
        <path name="hornetq.active.dir" path="hornetq-active" relative-to="jboss.server.data.dir"/>
    </paths>
</pre>


{{{
=Manipulating Paths with CLI=


  ...
<blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;">
  <bindings-directory path="./bindings" relative-to="hornetq.shared.dir"/>
:[[WildFly CLI - Manipulating Paths|Manipulating Paths with CLI]]
  ...
</blockquote>


}}}
=Directory Grouping=


 
<font color=red>
HornetQ configuration does its own path processing, and supplies default values for "relative-to" if that is not specified. That default value is "jboss.server.data.dir" (HornetQServerAdd.DEFAULT_RELATIVE_TO). It does not really matter if the "path" attribute value is relative or absolute, it will be always be considered relative to "relative-to".
'''TODO''': https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/sect-Filesystem_Paths.html#Directory_Grouping
 
</font>
!!!PathManagerService Implementation
 
The path roots are added at boot within ServerPathManagerService (that extends PathManagerService). This is where the "path names" and their absolute values are added.
 
 
__Referenced by:__\\
[{INSERT com.ecyrd.jspwiki.plugin.ReferringPagesPlugin WHERE max=20, maxwidth=50}]

Latest revision as of 21:11, 5 September 2017

External

Internal

Overview

WildFly uses logical names for filesystem paths. All top-level configuration files standalone.xml, domain.xml and host.xml include a <paths> section for declaring paths. Closer declaration to the server take precedence.

For domain.xml, the <paths> element must occur between <system-properties> and <management>.

WildFly Standard Paths

WildFly Standard Paths

relative-to

"relative-to" attribute references a global path name in the domain model.

Adding Custom Paths

We can add more named paths, so we can use them as "relative-to". They are added as follows:

<server ...>
   <extensions>
      ...
   </extensions>
   <paths>
      <path name="hornetq.shared.dir" path="C:/tmp/hqd"/>
   </paths>
   ...
</server>

In the above example, "hornetq.shared.dir" can be used as path name for "relative-to" used in HornetQ configuration.

Adding Custom Paths within the WildFly Layout

A custom path that lives within the WildFly layout can be declared in two ways - either as an absolute path, or a path relative to one of the WildFly "known" locations:

    <paths>
        <path name="hornetq.active.dir" path="${jboss.server.data.dir}/hornetq-active"/>
    </paths>

or

    <paths>
        <path name="hornetq.active.dir" path="hornetq-active" relative-to="jboss.server.data.dir"/>
    </paths>

Manipulating Paths with CLI

Manipulating Paths with CLI

Directory Grouping

TODO: https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/sect-Filesystem_Paths.html#Directory_Grouping