}
// Build the realm GBean
GbeanType realm = GbeanType.Factory.newInstance();
realm.setName(data.getName());
realm.setClass1("org.apache.geronimo.security.realm.GenericSecurityRealm");
AttributeType realmName = realm.addNewAttribute();
realmName.setName("realmName");
realmName.setStringValue(data.getName());
AttributeType global = realm.addNewAttribute();
global.setName("global");
global.setStringValue(data.getGlobal());
ReferenceType serverInfo = realm.addNewReference();
serverInfo.setName2("ServerInfo");
serverInfo.setName((String) PortletManager.getNameFor(request, PortletManager.getCurrentServer(request).getServerInfo()).getName().get("name"));
XmlAttributeType config = realm.addNewXmlReference();
// Construct the content to put in the XmlAttributeType