org.objectweb.jonas_client.deployment.api
Class ClientContainerDeploymentDesc

java.lang.Object
  extended byorg.objectweb.jonas_lib.deployment.api.DescriptionGroupDesc
      extended byorg.objectweb.jonas_lib.deployment.api.JndiEnvRefsGroupDesc
          extended byorg.objectweb.jonas_client.deployment.api.ClientContainerDeploymentDesc
All Implemented Interfaces:
DescriptionGroup, JndiEnvRefsGroup

public class ClientContainerDeploymentDesc
extends JndiEnvRefsGroupDesc

This class do the parsing of the application-client.xml file and jonas-client.xml files and contruct a data structure associated to these two files.

Author:
Florent Benoit, Philippe Coq

Field Summary
static java.lang.String CLIENT_FILE_NAME
          The path to the application-client.xml file.
static java.lang.String JONAS_CLIENT_FILE_NAME
          The path to the jonas-client.xml file.
 
Fields inherited from class org.objectweb.jonas_lib.deployment.api.DescriptionGroupDesc
description, displayName, largeIcon, smallIcon
 
Method Summary
 java.lang.String getCallbackHandler()
          Get the callback handler of this client application.
static org.xml.sax.EntityResolver getEntityResolver()
          Get the current EntityResolver.
static org.xml.sax.ErrorHandler getErrorHandler()
          Get the current ErrorHandler.
static ClientContainerDeploymentDesc getInstance(java.lang.String clientFileName, java.lang.ClassLoader classLoaderForCls)
          Get an instance of a Client deployment descriptor by parsing the application-client.xml and jonas-client.xml deployment descriptors.
static ClientContainerDeploymentDesc getInstance(java.lang.String clientFileName, java.lang.ClassLoader classLoaderForCls, java.lang.String altClientXmlFilename)
          Get an instance of a Client deployment descriptor by parsing the application-client.xml and jonas-client.xml deployment descriptors.
 java.lang.String getJaasEntry()
          Get the entry in the jaas configuration file
 java.lang.String getJaasFile()
          Get the name of the jaas configuration file
static boolean getParsingWithValidation()
          Controls whether the parser is reporting all validity errors.
 java.lang.String getPassword()
          Get the password used for a callback handler
 java.lang.String getUsername()
          Get the username used for a callback handler
static ApplicationClient loadApplicationClient(java.io.Reader reader, java.lang.String fileName)
          Load the application-client.xml file.
static JonasClient loadJonasClient(java.io.Reader reader, java.lang.String fileName)
          Load the jonas-client.xml file.
static void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
          Set the specified EntityResolver.
static void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
          Set the specified ErrorHandler.
static void setParsingWithValidation(boolean validation)
          Controls whether the parser is reporting all validity errors.
 java.lang.String toString()
          Return a String representation of the ClientContainerDeploymentDesc.
 
Methods inherited from class org.objectweb.jonas_lib.deployment.api.JndiEnvRefsGroupDesc
getEjbLocalRefDesc, getEjbRefDesc, getEnvEntryDesc, getResourceEnvRefDesc, getResourceRefDesc, getServiceRefDesc
 
Methods inherited from class org.objectweb.jonas_lib.deployment.api.DescriptionGroupDesc
getDescription, getDisplayName, getLargeIcon, getSAXMsg, getSmallIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLIENT_FILE_NAME

public static final java.lang.String CLIENT_FILE_NAME
The path to the application-client.xml file.

See Also:
Constant Field Values

JONAS_CLIENT_FILE_NAME

public static final java.lang.String JONAS_CLIENT_FILE_NAME
The path to the jonas-client.xml file.

See Also:
Constant Field Values
Method Detail

getInstance

public static ClientContainerDeploymentDesc getInstance(java.lang.String clientFileName,
                                                        java.lang.ClassLoader classLoaderForCls)
                                                 throws DeploymentDescException
Get an instance of a Client deployment descriptor by parsing the application-client.xml and jonas-client.xml deployment descriptors.

Parameters:
clientFileName - the fileName of the client file for the deployment descriptors.
classLoaderForCls - the classloader for the classes.
Returns:
a Client deployment descriptor by parsing the application-client.xml and jonas-client.xml deployment descriptors.
Throws:
ClientContainerDeploymentDescException - if the deployment descriptors are corrupted.
DeploymentDescException

getInstance

public static ClientContainerDeploymentDesc getInstance(java.lang.String clientFileName,
                                                        java.lang.ClassLoader classLoaderForCls,
                                                        java.lang.String altClientXmlFilename)
                                                 throws DeploymentDescException
Get an instance of a Client deployment descriptor by parsing the application-client.xml and jonas-client.xml deployment descriptors.

Parameters:
clientFileName - the fileName of the client file for the deployment descriptors.
classLoaderForCls - the classloader for the classes.
altClientXmlFilename - the fileName to the application-client.xml for the alt-dd tag in the Ear Case. This is used for specify an alternate DDesc file.
Returns:
a Client deployment descriptor by parsing the application-client.xml and jonas-client.xml deployment descriptors.
Throws:
ClientContainerDeploymentDescException - if the deployment descriptors are corrupted.
DeploymentDescException

loadApplicationClient

public static ApplicationClient loadApplicationClient(java.io.Reader reader,
                                                      java.lang.String fileName)
                                               throws DeploymentDescException
Load the application-client.xml file.

Parameters:
reader - the reader of the XML file.
fileName - the name of the file (application-client.xml).
Returns:
a structure containing the result of the application-client.xml parsing.
Throws:
ClientContainerDeploymentDescException - if the deployment descriptor is corrupted.
DeploymentDescException

loadJonasClient

public static JonasClient loadJonasClient(java.io.Reader reader,
                                          java.lang.String fileName)
                                   throws DeploymentDescException
Load the jonas-client.xml file.

Parameters:
fileName - the name of the file (jonas-client.xml).
Returns:
a structure containing the result of the jonas-client.xml parsing.
Throws:
ClientContainerDeploymentDescException - if the deployment descriptor is corrupted.
DeploymentDescException

getJaasFile

public java.lang.String getJaasFile()
Get the name of the jaas configuration file

Returns:
the name of the jaas configuration file

getJaasEntry

public java.lang.String getJaasEntry()
Get the entry in the jaas configuration file

Returns:
the entry in the jaas configuration file

getUsername

public java.lang.String getUsername()
Get the username used for a callback handler

Returns:
the username used for a callback handler

getPassword

public java.lang.String getPassword()
Get the password used for a callback handler

Returns:
the password used for a callback handler

getCallbackHandler

public java.lang.String getCallbackHandler()
Get the callback handler of this client application.

Returns:
the callback handler of this client application.

toString

public java.lang.String toString()
Return a String representation of the ClientContainerDeploymentDesc.

Specified by:
toString in interface DescriptionGroup
Specified by:
toString in class DescriptionGroupDesc
Returns:
a String representation of the ClientContainerDeploymentDesc.

getErrorHandler

public static org.xml.sax.ErrorHandler getErrorHandler()
Get the current ErrorHandler.

Returns:
the current ErrorHandler.

getEntityResolver

public static org.xml.sax.EntityResolver getEntityResolver()
Get the current EntityResolver.

Returns:
the current EntityResolver.

getParsingWithValidation

public static boolean getParsingWithValidation()
Controls whether the parser is reporting all validity errors.

Returns:
if true, all external entities will be read.

setErrorHandler

public static void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
Set the specified ErrorHandler. If the application does not register an ErrorHandler, all error events reported by the reader are ignored.

Parameters:
errorHandler - the Error Handler to set.

setEntityResolver

public static void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
Set the specified EntityResolver.

Parameters:
entityResolver - the Entity Resolver to set.

setParsingWithValidation

public static void setParsingWithValidation(boolean validation)
Controls whether the parser is reporting all validity errors.

Parameters:
validation - if true, all external entities will be read.