use of com.sun.enterprise.config.serverbeans.Domain in project Payara by payara.
the class GeneratorResource method get.
@GET
@Produces({ "text/plain" })
public String get(@QueryParam("outputDir") String outputDir) {
if (outputDir == null) {
outputDir = DEFAULT_OUTPUT_DIR;
}
String retVal = "Code Generation done at : " + outputDir;
try {
LocatorBridge locatorBridge = habitat.getService(LocatorBridge.class);
Dom dom = Dom.unwrap(locatorBridge.getRemoteLocator().<Domain>getService(Domain.class));
DomDocument document = dom.document;
ConfigModel rootModel = dom.document.getRoot().model;
ResourcesGenerator resourcesGenerator = new TextResourcesGenerator(outputDir, habitat);
resourcesGenerator.generateSingle(rootModel, document);
resourcesGenerator.endGeneration();
} catch (Exception ex) {
RestLogging.restLogger.log(Level.SEVERE, null, ex);
retVal = "Exception encountered during generation process: " + ex.toString() + "\nPlease look at server.log for more information.";
}
return retVal;
}
use of com.sun.enterprise.config.serverbeans.Domain in project Payara by payara.
the class UniqueResourceNameValidator method initialize.
@Override
public void initialize(final UniqueResourceNameConstraint constraint) {
ServiceLocator habitat = Globals.getDefaultHabitat();
// due to: http://java.net/jira/browse/GLASSFISH-19043
if (habitat == null)
return;
domain = habitat.getService(Domain.class);
}
use of com.sun.enterprise.config.serverbeans.Domain in project Payara by payara.
the class DomainTest method domainExist.
@Test
public void domainExist() {
Domain domain = getHabitat().getService(Domain.class);
assertTrue(domain != null);
}
use of com.sun.enterprise.config.serverbeans.Domain in project Payara by payara.
the class DGTest method testThereAreTwo.
@Test
public void testThereAreTwo() {
Domain d = habitat.getService(Domain.class);
DeploymentGroups dgs = d.getDeploymentGroups();
assertNotNull("Deployment Groups should not be null", dgs);
List<DeploymentGroup> ldg = dgs.getDeploymentGroup();
assertNotNull("Deployment Groups List should not be null", ldg);
assertEquals("List should have 2 deployment groups", 2L, ldg.size());
}
use of com.sun.enterprise.config.serverbeans.Domain in project Payara by payara.
the class DGTest method getDeploymentGroupFromServerTest.
@Test
public void getDeploymentGroupFromServerTest() {
Domain d = habitat.getService(Domain.class);
Server server = d.getServerNamed("server2");
assertTrue(server != null);
List<DeploymentGroup> dgs = server.getDeploymentGroup();
assertEquals("List should have 1 element", 1L, dgs.size());
}
Aggregations