// If a non-null domain name is provided make the node available to the model
// this causes the runtime to start registering binding-sca service endpoints
// with the domain so only makes sense if we know we have a domain to talk to
if (domainURI != null) {
ModelFactoryExtensionPoint factories = nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
NodeFactoryImpl nodeFactory = new NodeFactoryImpl(this);
factories.addFactory(nodeFactory);
}
// Configure the default server port
int port = URI.create(nodeName).getPort();
if (port != -1) {
ServletHostExtensionPoint servletHosts = nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ServletHostExtensionPoint.class);
for (ServletHost servletHost: servletHosts.getServletHosts()) {
servletHost.setDefaultPort(port);
}
}
// Create an in-memory domain level composite
AssemblyFactory assemblyFactory = nodeRuntime.getAssemblyFactory();
nodeComposite = assemblyFactory.createComposite();
nodeComposite.setName(new QName(Constants.SCA10_NS, "domain"));
nodeComposite.setURI(domainURI);
// add the top level composite into the composite activator
nodeRuntime.getCompositeActivator().setDomainComposite(nodeComposite);
// make the domain available to the model.
ModelFactoryExtensionPoint factories = nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
NodeFactoryImpl domainFactory = new NodeFactoryImpl(this);
factories.addFactory(domainFactory);
// add a contribution to the domain
ContributionService contributionService = nodeRuntime.getContributionService();
// find the current directory as a URL. This is where our contribution