connectionDefinitionInstance.getConfigPropertySetting().add(configPropertySetting);
connectionDefinition.getConnectiondefinitionInstance().add(connectionDefinitionInstance);
outboundResourceadapter.getConnectionDefinition().add(connectionDefinition);
resourceadapter.setOutboundResourceadapter(outboundResourceadapter);
connector.getResourceadapter().add(resourceadapter);
Gbean gbean = deploymentFactory.createGbean();
gbean.setClazz("resource-connector-gbean-class");
gbean.setName("resource-connector-gbean-name");
connector.getService().add(deploymentFactory.createGbean(gbean));
resource.setConnector(connector);
org.apache.geronimo.jee.deployment.Pattern deploymentPattern = deploymentFactory.createPattern();
deploymentPattern.setArtifactId("resource-externalrar-artifactid");
deploymentPattern.setGroupId("resource-externalrar-groupid");
deploymentPattern.setModule("resource-externalrar-module");
deploymentPattern.setVersion("resource-externalrar-version");
deploymentPattern.setCustomFoo("resource-externalrar-customfoo");
deploymentPattern.setType("resource-externalrar-type");
resource.setExternalRar(deploymentPattern);
applicationClient.getResource().add(resource);
// set the resource env ref
ResourceEnvRef resourceEnvRef = namingFactory.createResourceEnvRef();
resourceEnvRef.setAdminObjectLink("resourceenvref-adminobjectlink");
resourceEnvRef.setAdminObjectModule("resourceenvref-adminobjectmodule");
resourceEnvRef.setMessageDestinationLink("resourceenvref-messagedestinationlink");
resourceEnvRef.setRefName("resourceenvref-refname");
namingPattern = namingFactory.createPattern();
namingPattern.setArtifactId("resourceenvref-pattern-artifactid");
namingPattern.setGroupId("resourceenvref-pattern-groupid");
namingPattern.setModule("resourceenvref-pattern-module");
namingPattern.setName("resourceenvref-pattern-name");
namingPattern.setVersion("resourceenvref-pattern-version");
resourceEnvRef.setPattern(namingPattern);
applicationClient.getResourceEnvRef().add(resourceEnvRef);
// set the resource ref
ResourceRef resourceRef = namingFactory.createResourceRef();
resourceRef.setRefName("resourceref-refname");
resourceRef.setResourceLink("resourceref-resourcelink");
resourceRef.setUrl("resourceref-url");
namingPattern = namingFactory.createPattern();
namingPattern.setArtifactId("resourceref-pattern-artifactid");
namingPattern.setGroupId("resourceref-pattern-groupid");
namingPattern.setModule("resourcref-pattern-module");
namingPattern.setName("resourceref-pattern-name");
namingPattern.setVersion("resourceref-pattern-version");
resourceRef.setPattern(namingPattern);
applicationClient.getResourceRef().add(resourceRef);
// set the Server Environment
environment = deploymentFactory.createEnvironment();
artifact = deploymentFactory.createArtifact();
artifact.setGroupId("org.apache.geronimo.testsuite");
artifact.setArtifactId("agent-ear");
artifact.setVersion("2.2-SNAPSHOT");
artifact.setType("ear");
environment.setModuleId(artifact);
dependencies = deploymentFactory.createDependencies();
dependency = deploymentFactory.createDependency();
dependency.setGroupId("org.apache.geronimo.testsuite");
dependency.setArtifactId("agent-ds");
dependency.setVersion("2.2-SNAPSHOT");
dependency.setType("car");
dependencies.getDependency().add(dependency);
environment.setDependencies(dependencies);
applicationClient.setServerEnvironment(environment);
// add the service
gbean = deploymentFactory.createGbean();
gbean.setClazz("service-gbean-class");
gbean.setName("service-gbean-name");
applicationClient.getService().add(deploymentFactory.createGbean(gbean));
// add the service ref
ServiceRef serviceRef = namingFactory.createServiceRef();
serviceRef.setServiceRefName("serviceref-refname");