*
*/
public static JavaEEResource toMailJavaEEResource(
com.sun.enterprise.config.serverbeans.MailResource mailResourceConfig, ResourceInfo resourceInfo) {
com.sun.enterprise.resource.beans.MailResource mailResource = new MailResource(resourceInfo);
//jr.setDescription(rbean.getDescription()); // FIXME: getting error
mailResource.setEnabled(ConnectorsUtil.parseBoolean(mailResourceConfig.getEnabled()));
mailResource.setStoreProtocol(mailResourceConfig.getStoreProtocol());
mailResource.setStoreProtocolClass(mailResourceConfig.getStoreProtocolClass());
mailResource.setTransportProtocol(mailResourceConfig.getTransportProtocol());
mailResource.setTransportProtocolClass(mailResourceConfig.getTransportProtocolClass());
mailResource.setMailHost(mailResourceConfig.getHost());
mailResource.setUsername(mailResourceConfig.getUser());
mailResource.setMailFrom(mailResourceConfig.getFrom());
mailResource.setDebug(ConnectorsUtil.parseBoolean(mailResourceConfig.getDebug()));
// sets the properties
List<Property> properties = mailResourceConfig.getProperty();
if (properties != null) {
for(Property property : properties){
ResourceProperty rp = new ResourcePropertyImpl(property.getName(), property.getValue());
mailResource.addProperty(rp);
}
}
return mailResource;
}