| Modifier and Type | Class and Description |
|---|---|
| public class | XMLSessionConfigLoader.XMLSessionConfigLoaderErrorHandler
INTERNAL: Purpose: Provide a mechanism to swallow all parsing errors |
| Modifier and Type | Field and Description |
|---|---|
| protected ClassLoader | classLoader
Define the class loader that should be used to find the resource. |
| protected static final String | |
| protected static final String | |
| public static final String | |
| protected PersistenceEntityResolver | entityResolver
Used to store the entity resolver to validate the XML schema when parsing. |
| protected Vector | exceptionStore
Stores any exceptions that occurred to provide all the exceptions up front if the load fails. |
| protected static final Project | project
Cache the creation and initialization of the Session XML mapping project. |
| protected String | |
| protected String | resourcePath
Stores the resource path to provide a better error message if the load fails. |
| protected String | sessionName
Stores the name of the Session in the sessions XML file desired to be loaded. |
| protected boolean | shouldCheckClassLoader
Defines if the session will be refreshed from the file if the class loader requesting the load is different than the loaded session's class loader. |
| protected boolean | shouldLogin
Define if the loaded session should be connected, default true. |
| protected boolean | shouldRefresh
Define if the loaded session should be refreshed from the file. |
| Access | Constructor and Description |
|---|---|
| public | XMLSessionConfigLoader()
PUBLIC: This constructor is used when the file resource named 'sessions.xml' will be parsed for configuration. |
| public | XMLSessionConfigLoader(String resourceName)
PUBLIC: This constructor is used when passing in the resource name of the configuration file that should be parsed |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | buildSessionConfigs(SessionManager sessionManager, ClassLoader loader, Document document, Project project)
|
| public ClassLoader | |
| public Vector | |
| protected static Project | |
| public String | |
| public String | |
| public String | getSessionName()
PUBLIC: Returns the name of the Session in the sessions XML file desired to be loaded. |
| public boolean | load(SessionManager sessionManager, ClassLoader loader)
INTERNAL: This method instantiates the parser and builds the document based on the schema. |
| public SessionConfigs | loadConfigsForMappingWorkbench(ClassLoader loader)
INTERNAL: This method is to be used to load config objects for the Mapping Workbench only. |
| public SessionConfigs | loadConfigsForMappingWorkbench(ClassLoader loader, boolean validate)
INTERNAL: This method is to be used to load config objects for the Mapping Workbench only. |
| protected Document | |
| protected Document | |
| public void | setClassLoader(ClassLoader classLoader)
PUBLIC: Set the class loader that should be used to find the resource. |
| public void | |
| public void | setSessionName(String sessionName)
PUBLIC: Set the name of the Session in the sessions XML file desired to be loaded. |
| public void | setShouldCheckClassLoader(boolean shouldCheckClassLoader)
PUBLIC: Set if the session will be refreshed from the file if the class loader requesting the load is different than the loaded session's class loader. |
| public void | |
| public void | setShouldRefresh(boolean shouldRefresh)
PUBLIC: Set if the loaded session should be refreshed from the file. |
| public boolean | shouldCheckClassLoader()
PUBLIC: Return if the session will be refreshed from the file if the class loader requesting the load is different than the loaded session's class loader. |
| public boolean | |
| public boolean |
| classLoader | back to summary |
|---|---|
| protected ClassLoader classLoader Define the class loader that should be used to find the resource. | |
| DEFAULT_RESOURCE_NAME | back to summary |
|---|---|
| protected static final String DEFAULT_RESOURCE_NAME | |
| DEFAULT_RESOURCE_NAME_IN_META_INF | back to summary |
|---|---|
| protected static final String DEFAULT_RESOURCE_NAME_IN_META_INF | |
| ECLIPSELINK_SESSIONS_SCHEMA | back to summary |
|---|---|
| public static final String ECLIPSELINK_SESSIONS_SCHEMA | |
| entityResolver | back to summary |
|---|---|
| protected PersistenceEntityResolver entityResolver Used to store the entity resolver to validate the XML schema when parsing. | |
| exceptionStore | back to summary |
|---|---|
| protected Vector<Throwable> exceptionStore Stores any exceptions that occurred to provide all the exceptions up front if the load fails. | |
| project | back to summary |
|---|---|
| protected static final Project project Cache the creation and initialization of the Session XML mapping project. | |
| resourceName | back to summary |
|---|---|
| protected String resourceName | |
| resourcePath | back to summary |
|---|---|
| protected String resourcePath Stores the resource path to provide a better error message if the load fails. | |
| sessionName | back to summary |
|---|---|
| protected String sessionName Stores the name of the Session in the sessions XML file desired to be loaded. | |
| shouldCheckClassLoader | back to summary |
|---|---|
| protected boolean shouldCheckClassLoader Defines if the session will be refreshed from the file if the class loader requesting the load is different than the loaded session's class loader. | |
| shouldLogin | back to summary |
|---|---|
| protected boolean shouldLogin Define if the loaded session should be connected, default true. | |
| shouldRefresh | back to summary |
|---|---|
| protected boolean shouldRefresh Define if the loaded session should be refreshed from the file. | |
| XMLSessionConfigLoader | back to summary |
|---|---|
| public XMLSessionConfigLoader() PUBLIC: This constructor is used when the file resource named 'sessions.xml' will be parsed for configuration. | |
| XMLSessionConfigLoader | back to summary |
|---|---|
| public XMLSessionConfigLoader(String resourceName) PUBLIC: This constructor is used when passing in the resource name of the configuration file that should be parsed | |
| buildSessionConfigs | back to summary |
|---|---|
| private boolean buildSessionConfigs(SessionManager sessionManager, ClassLoader loader, Document document, Project project) | |
| getClassLoader | back to summary |
|---|---|
| public ClassLoader getClassLoader() PUBLIC: Return the class loader that should be used to find the resource. | |
| getExceptionStore | back to summary |
|---|---|
| public Vector INTERNAL: | |
| getProject | back to summary |
|---|---|
| protected static Project getProject() Cache the creation and initialization of the Session XML mapping project. | |
| getResourceName | back to summary |
|---|---|
| public String getResourceName() PUBLIC: Returns the resource name we are trying to load. | |
| getResourcePath | back to summary |
|---|---|
| public String getResourcePath() INTERNAL: Will return the the resource name with full path of the resource file. | |
| getSessionName | back to summary |
|---|---|
| public String getSessionName() PUBLIC: Returns the name of the Session in the sessions XML file desired to be loaded. | |
| load | back to summary |
|---|---|
| public boolean load(SessionManager sessionManager, ClassLoader loader) INTERNAL: This method instantiates the parser and builds the document based on the schema. If the document is loaded without errors, then the configs are converted to sessions and stored on the session manager and true is returned to indicate success. | |
| loadConfigsForMappingWorkbench | back to summary |
|---|---|
| public SessionConfigs loadConfigsForMappingWorkbench(ClassLoader loader) INTERNAL: This method is to be used to load config objects for the Mapping Workbench only. Do not call this method. | |
| loadConfigsForMappingWorkbench | back to summary |
|---|---|
| public SessionConfigs loadConfigsForMappingWorkbench(ClassLoader loader, boolean validate) INTERNAL: This method is to be used to load config objects for the Mapping Workbench only. Do not call this method. | |
| loadDocument | back to summary |
|---|---|
| protected Document loadDocument(ClassLoader loader) INTERNAL: Load a session.xml document. The error handler will capture all the errors and allow for a document to be returned. | |
| loadDocument | back to summary |
|---|---|
| protected Document loadDocument(ClassLoader loader, boolean validate) INTERNAL: Load a session.xml document. The error handler will capture all the errors and allow for a document to be returned. | |
| setClassLoader | back to summary |
|---|---|
| public void setClassLoader(ClassLoader classLoader) PUBLIC: Set the class loader that should be used to find the resource. | |
| setResourceName | back to summary |
|---|---|
| public void setResourceName(String resourceName) PUBLIC: Set the resource name we are trying to load. | |
| setSessionName | back to summary |
|---|---|
| public void setSessionName(String sessionName) PUBLIC: Set the name of the Session in the sessions XML file desired to be loaded. | |
| setShouldCheckClassLoader | back to summary |
|---|---|
| public void setShouldCheckClassLoader(boolean shouldCheckClassLoader) PUBLIC: Set if the session will be refreshed from the file if the class loader requesting the load is different than the loaded session's class loader. | |
| setShouldLogin | back to summary |
|---|---|
| public void setShouldLogin(boolean shouldLogin) PUBLIC: Set if the loaded session should be connected. | |
| setShouldRefresh | back to summary |
|---|---|
| public void setShouldRefresh(boolean shouldRefresh) PUBLIC: Set if the loaded session should be refreshed from the file. | |
| shouldCheckClassLoader | back to summary |
|---|---|
| public boolean shouldCheckClassLoader() PUBLIC: Return if the session will be refreshed from the file if the class loader requesting the load is different than the loaded session's class loader. | |
| shouldLogin | back to summary |
|---|---|
| public boolean shouldLogin() PUBLIC: Return if the loaded session should be connected. | |
| shouldRefresh | back to summary |
|---|---|
| public boolean shouldRefresh() PUBLIC: Return if the loaded session should be refreshed from the file. | |
Purpose: Provide a mechanism to swallow all parsing errors
ErrorHandler
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | error(SAXParseException
The error information encapsulated in a
SAX parse exception. e)Implements org. |
| public void | fatalError(SAXParseException
The error information encapsulated in a
e)SAXParseException.Implements org. |
| public void | warning(SAXParseException
The warning information encapsulated in a
SAX parse exception. e)Implements org. |
| XMLSessionConfigLoaderErrorHandler | back to summary |
|---|---|
| public XMLSessionConfigLoaderErrorHandler() Default constructor. | |
| error | back to summary |
|---|---|
| public void error(SAXParseException e) throws SAXException Implements org. Doc from org. Receive notification of a recoverable error. This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a validating parser would use this callback to report the violation of a validity constraint. The default behaviour is to take no action. The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. If the application cannot do so, then the parser should report a fatal error even if the XML recommendation does not require it to do so. Filters may use this method to report other, non-XML errors as well.
| |
| fatalError | back to summary |
|---|---|
| public void fatalError(SAXParseException e) throws SAXException Implements org. Doc from org. Receive notification of a non-recoverable, fatal error. As defined in section 1.2 of the W3C XML 1.0 Recommendation, fatal errors are those that would make it impossible for a parser to continue normal processing. These include violation of a well-formedness constraint, invalid encoding, and forbidden structural errors as described in the W3C XML 1.0 Recommendation.
| |
| warning | back to summary |
|---|---|
| public void warning(SAXParseException e) throws SAXException Implements org. Doc from org. Receive notification of a warning. SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the XML recommendation. The default behaviour is to take no action. The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. Filters may use this method to report other, non-XML warnings as well.
| |