if (pooling != null) {
for (String name : pooling.keySet()) {
Object pool = pooling.get( name );
PoolMetaData poolMetaData = new PoolMetaData( name );
if (name.equals( "web" )) {
// Web runtimes default to eager
poolMetaData.setDeferUntilRequested( false );
}
if (pool instanceof Map) {
Map<String, Object> poolMap = (Map<String, Object>) pool;
if (poolMap.get( "type" ) != null) {
String type = poolMap.get( "type" ).toString();
if (type.equals( "shared" )) {
poolMetaData.setShared();
} else if (type.equals( "global" )) {
poolMetaData.setGlobal();
}
}
if (poolMap.get( "min" ) != null) {
poolMetaData.setMinimumSize( ((Number) poolMap.get( "min" )).intValue() );
}
if (poolMap.get( "max" ) != null) {
poolMetaData.setMaximumSize( ((Number) poolMap.get( "max" )).intValue() );
}
if (poolMap.get( "lazy" ) != null) {
poolMetaData.setDeferUntilRequested( (Boolean) poolMap.get( "lazy" ) );
}
} else if (pool instanceof String) {
if (pool.toString().equals( "shared" )) {
poolMetaData.setShared();
} else if (pool.toString().equals( "global" )) {
poolMetaData.setGlobal();
}
}
unit.addToAttachmentList( PoolMetaData.ATTACHMENTS_KEY, poolMetaData );
}
}