org.glassfish.admin.cli.resources
Class ResourcesXMLParser

java.lang.Object
  extended by org.glassfish.admin.cli.resources.ResourcesXMLParser
All Implemented Interfaces:
org.xml.sax.EntityResolver

public class ResourcesXMLParser
extends java.lang.Object
implements org.xml.sax.EntityResolver

This Class reads the Properties (resources) from the xml file supplied to constructor


Field Summary
static java.lang.String JAVA_APP_SCOPE_PREFIX
           
static java.lang.String JAVA_COMP_SCOPE_PREFIX
           
static java.lang.String JAVA_GLOBAL_SCOPE_PREFIX
           
static java.lang.String JAVA_MODULE_SCOPE_PREFIX
           
static java.util.List<java.lang.String> namingScopes
          List of naming scopes
 
Constructor Summary
ResourcesXMLParser(java.io.File resourceFile)
          Creates new ResourcesXMLParser
ResourcesXMLParser(java.io.File resourceFile, java.lang.String scope)
          Creates new ResourcesXMLParser
 
Method Summary
static java.util.List getConnectorResourcesList(java.util.List<Resource> resources, boolean isResourceCreation, boolean ignoreDuplicates)
          Returns an Iterator of Resource objects that correspond to connector resources that needs to be created post module deployment.
static java.util.List getNonConnectorResourcesList(java.util.List<Resource> resources, boolean isResourceCreation, boolean ignoreDuplicates)
          Returns an List of Resourceobjects that needs to be created prior to module deployment.
 java.util.Iterator<Resource> getResources()
          Returns an Iterator of Resourceobjects in the order as defined in the resources XML configuration file.
 java.util.List<Resource> getResourcesList()
           
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVA_APP_SCOPE_PREFIX

public static final java.lang.String JAVA_APP_SCOPE_PREFIX
See Also:
Constant Field Values

JAVA_COMP_SCOPE_PREFIX

public static final java.lang.String JAVA_COMP_SCOPE_PREFIX
See Also:
Constant Field Values

JAVA_MODULE_SCOPE_PREFIX

public static final java.lang.String JAVA_MODULE_SCOPE_PREFIX
See Also:
Constant Field Values

JAVA_GLOBAL_SCOPE_PREFIX

public static final java.lang.String JAVA_GLOBAL_SCOPE_PREFIX
See Also:
Constant Field Values

namingScopes

public static final java.util.List<java.lang.String> namingScopes
List of naming scopes

Constructor Detail

ResourcesXMLParser

public ResourcesXMLParser(java.io.File resourceFile)
                   throws java.lang.Exception
Creates new ResourcesXMLParser

Throws:
java.lang.Exception

ResourcesXMLParser

public ResourcesXMLParser(java.io.File resourceFile,
                          java.lang.String scope)
                   throws java.lang.Exception
Creates new ResourcesXMLParser

Throws:
java.lang.Exception
Method Detail

getResources

public java.util.Iterator<Resource> getResources()
Returns an Iterator of Resourceobjects in the order as defined in the resources XML configuration file. Maintained for backward compat purposes only.


getResourcesList

public java.util.List<Resource> getResourcesList()

getNonConnectorResourcesList

public static java.util.List getNonConnectorResourcesList(java.util.List<Resource> resources,
                                                          boolean isResourceCreation,
                                                          boolean ignoreDuplicates)
Returns an List of Resourceobjects that needs to be created prior to module deployment. This includes all non-Connector resources and resource-adapter-config

Parameters:
resources - List of resources, from which the non connector resources need to be obtained.
isResourceCreation - indicates if this determination needs to be done during the PreResCreationPhase. In the PreResCreationPhase, RA config is added to the non connector list, so that the RA config is created prior to the RA deployment. For all other purpose, this flag needs to be set to false.

getConnectorResourcesList

public static java.util.List getConnectorResourcesList(java.util.List<Resource> resources,
                                                       boolean isResourceCreation,
                                                       boolean ignoreDuplicates)
Returns an Iterator of Resource objects that correspond to connector resources that needs to be created post module deployment. They are arranged in the order in which the resources needs to be created

Parameters:
resources - List of resources, from which the non connector resources need to be obtained.
isResourceCreation - indicates if this determination needs to be done during the PreResCreationPhase. In the PreResCreationPhase, RA config is added to the non connector list, so that the RA config is created prior to the RA deployment. For all other purpose, this flag needs to be set to false.

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException
Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
Throws:
org.xml.sax.SAXException


Copyright © 2012 GlassFish Community. All Rights Reserved.