if ( serviceArray != null )
{
for ( int i = 0; i < serviceArray.length; i++ )
{
ServiceDocument.Service service = serviceArray[i];
ConfigContext context = new ConfigContext( );
context.setName( service.getName( ) );
Environment[] environmentArray = getEnvironmentArray( service.getEnvironmentArray( ) );
for ( int j = 0; j < environmentArray.length; j++ )
{
context.addEnvironment( environmentArray[j] );
}
Resource[] resourceArray =
getResourceArray( service.getResourceArray( ),
service.getName( ),
namingContext );
for ( int j = 0; j < resourceArray.length; j++ )
{
Resource resource = resourceArray[j];
ResourceParameters params = resource.getParameters( );
setDefaultParameterValues( params );
validateParameterValues( params );
}
for ( int j = 0; j < resourceArray.length; j++ )
{
context.addResource( resourceArray[j] );
}
ResourceLink[] resourceLinkArray = getResourceLinkArray( service.getResourceLinkArray( ) );
for ( int j = 0; j < resourceLinkArray.length; j++ )
{
context.addResourceLink( resourceLinkArray[j] );
}
services.add( context );
}
}