Friday, August 31, 2007

EmbeddedNode

We've seen how to setup an EmbeddedDomain. Now we'll see the client class:
EmbeddedNode, used for a distributed node.
An EmbeddedNode has :

  1. a node name.
  2. a local domain.
  3. a distributed domain.
  4. a domain name.
  5. a managment domain, in which i load node manager components.

The first thing that it does is staring management domain (creating an EmbeddedDomain for management) and activating its components.
In order to complete an its init fase in the client class i should:
* attach a local domain this is done by:
     public SCADomain attachDomain(DistributedSCADomain distributedDomain)
97 throws ActivationException {
98 this.distributedDomain = (DistributedSCADomainImpl) distributedDomain;
99 domainName = distributedDomain.getDomainName();
100
101 try {
102 ClassLoader cl = EmbeddedNode.class.getClassLoader();
103
104 // create and start the local domain
105 domain = new EmbeddedSCADomain(cl, domainName);
106 domain.start();
107 } catch(ActivationException ex) {
108 throw ex;
109 } catch(Exception ex) {
110 throw new ActivationException(ex);
111 }
112
113 // add local information into the distributed domain
114 this.distributedDomain.setNodeName(nodeName);
115 this.distributedDomain.setManagementDomain(management);
116
117 // add domain information into the management components that need it
118
119
120 return domain;
This method attach a new local domain to the node starting it, and setting the nodename in the distributed domain and setting its management domain.
Then you should activate it and loading artifacts. We'll see it later.

No comments: