|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.tutorial.config.key.MultiConfigurationKeyTutorial
@Document(title="Multiple Nodes", sortKey="basics1010") @DocCategory(value="basics") public class MultiConfigurationKeyTutorial
This tutorial shows how configurations for one environment with multiple nodes can be bundled. This may not be for everyone's taste since it implies that configurations not required by one node are nonetheless deployed. If you like to deploy only configurations specific to one node, you simply have to provide one project / artifact per node.
Constructor Summary | |
---|---|
MultiConfigurationKeyTutorial() |
Method Summary | |
---|---|
void |
accessConfigurationByHardcodedKey() In this example we assume that the test-module-announce module is deployed on the main server while test-module-mail is part of a mail server. |
void |
setUp() |
void |
theMailServerConfiguration() Basically access information is purely a matter of creating the correct configuration key. |
void |
theMainServerConfiguration() The main server simply changes the name of the node and the name of the application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiConfigurationKeyTutorial()
Method Detail |
---|
public void setUp()
@DocChapter public void accessConfigurationByHardcodedKey()
In this example we assume that the test-module-announce
module is deployed on the main server while test-module-mail
is part of a mail server. Both servers are part of the same environment and deployed to their own nodes.
We simulate the two nodes in one project. In real life both will have their own projects and use only one of the following dependencies:
de.smartics.sandbox test-module-mail de.smartics.sandbox test-module-announce
The definition for these properties is provided by a dependency like this:
de.smartics.sandbox test-application-config-multinode
Now let's have a look how we can access information on the two nodes.
@DocSection public void theMailServerConfiguration()
Basically access information is purely a matter of creating the correct configuration key. This key identifies the application and the factory provides access to this information.
In
@DocSection public void theMainServerConfiguration()
The main server simply changes the name of the node and the name of the application. This would allow the same application be deployed on multiple nodes. Note that a node is not required to be a physical instance. A node may refer to an EAR deployable that is deployed side by side to other EARs on the same application server.
In
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |