namingPattern.setVersion("ejbref-pattern-version");
ejbRef.setPattern(namingPattern);
webApp.getEjbRef().add(ejbRef);
// set the Message Destination
MessageDestination messageDestination = namingFactory.createMessageDestination();
messageDestination.setAdminObjectLink("messagedestination-adminobjectlink");
messageDestination.setAdminObjectModule("messagedestination-adminobjectmodule");
messageDestination.setMessageDestinationName("messagedestination-name");
namingPattern = namingFactory.createPattern();
namingPattern.setArtifactId("messagedestination-pattern-artifactid");
namingPattern.setGroupId("messagedestination-pattern-groupid");
namingPattern.setModule("messagedestination-pattern-module");
namingPattern.setName("messagedestination-pattern-name");
namingPattern.setVersion("messagedestination-pattern-version");
messageDestination.setPattern(namingPattern);
webApp.getMessageDestination().add(messageDestination);
// set the Resource Env Ref
ResourceEnvRef resourceEnvRef = namingFactory.createResourceEnvRef();
resourceEnvRef.setAdminObjectLink("resourceenvref-adminobjectlink");