@ Override public Object createResource ( ResourceInfo info ) throws Exception { Properties propertyNames = createPropertyNames ( ) ; Properties props = createProperties ( propertyNames ) ; // The listOfPropMap is how the nested properties (name, value pairs) are // pulled from the Nester class. This iterates the map and stores them in the // props object if ( listOfPropMap != null ) { for ( Map < String , Object > nestedProperties : listOfPropMap ) { props . put ( nestedProperties . get ( NAME ) , nestedProperties . get ( VALUE ) ) ; } } Session session = createSession ( props ) ; return session ; }
The createResource uses the sessionProperties to create a javax . mail . Session object and return it to the caller . The caller uses JNDI look up with the JNDI name defined in the server . xml .