extModule.setJava(path);
path = applicationFactory.createPath();
path.setId("extmodule-web-path-id");
path.setValue("extmodule-web-path-value");
extModule.setWeb(path);
Pattern pattern = deploymentFactory.createPattern();
pattern.setArtifactId("extmodule-externalpath-artifactid");
pattern.setCustomFoo("extmodule-externalpath-customfoo");
pattern.setGroupId("extmodule-externalpath-groupid");
pattern.setModule("extmodule-externalpath-module");
pattern.setType("extmodule-externalpath-type");
pattern.setVersion("extmodule-externalpath-version");
extModule.setExternalPath(pattern);
application.getExtModule().add(extModule);
// set the Service
Gbean gbean = deploymentFactory.createGbean();
gbean.setClazz("gbean-class");
gbean.setName("gbean-name");
application.getService().add(deploymentFactory.createGbean(gbean));
// set the Security
Security security = securityFactory.createSecurity();
security.setDefaultRole ("security-role");
security.setDoasCurrentCaller(true);
security.setUseContextHandler(true);
pattern = deploymentFactory.createPattern();
pattern.setArtifactId("security-credentialstoreref-artifactid");
pattern.setCustomFoo("security-credentialstoreref-customfoo");
pattern.setGroupId("security-credentialstoreref-groupid");
pattern.setModule("security-credentialstoreref-module");
pattern.setType("security-credentialstoreref-type");
pattern.setVersion("security-credentialstoreref-version");
security.setCredentialStoreRef(pattern);
SubjectInfo subject = securityFactory.createSubjectInfo();
subject.setId("security-subjectinfo-id");
subject.setRealm("security-subjectinfo-realm");
Description description = securityFactory.createDescription();