org.netbeans.modules.j2eeserver/4 1.55.0 1

org.netbeans.modules.j2ee.deployment.devmodules.spi
Interface J2eeModuleProvider.ConfigSupport

Enclosing class:
J2eeModuleProvider

public static interface J2eeModuleProvider.ConfigSupport

Configuration support to allow development module code to access well-known configuration propeties, such as web context root, cmp mapping info... The setters and getters work with server specific data on the server returned by J2eeModuleProvider.getServerID() method.


Method Summary
 void bindDatasourceReference(String referenceName, String jndiName)
          Binds the data source reference name with the corresponding data source which is identified by the given JNDI name.
 void bindDatasourceReferenceForEjb(String ejbName, String ejbType, String referenceName, String jndiName)
          Binds the data source reference name with the corresponding data source which is identified by the given JNDI name.
 void bindEjbReference(String referenceName, String jndiName)
          Binds EJB reference name with EJB name.
 void bindEjbReferenceForEjb(String ejbName, String ejbType, String referenceName, String jndiName)
          Binds EJB reference name with EJB name within the EJB scope.
 void bindMdbToMessageDestination(String mdbName, String name, MessageDestination.Type type)
          Binds the message destination name with message-driven bean.
 void bindMessageDestinationReference(String referenceName, String connectionFactoryName, String destName, MessageDestination.Type type)
          Binds the message destination reference name with the corresponding message destination which is identified by the given name.
 void bindMessageDestinationReferenceForEjb(String ejbName, String ejbType, String referenceName, String connectionFactoryName, String destName, MessageDestination.Type type)
          Binds the message destination reference name with the corresponding message destination which is identified by the given name.
 Datasource createDatasource(String jndiName, String url, String username, String password, String driver)
          Creates and saves data source in the module if it does not exist yet in the module.
 boolean createInitialConfiguration()
          Create an initial fresh configuration for the current module.
 MessageDestination createMessageDestination(String name, MessageDestination.Type type)
          Creates and saves a message destination in the module if it does not exist in the module yet.
 boolean ensureConfigurationReady()
          Ensure configuration is ready to respond to any editing to the module.
 Datasource findDatasource(String jndiName)
          Finds data source with the given JNDI name.
 String findDatasourceJndiName(String referenceName)
          Finds JNDI name of data source which is mapped to the given reference name of a data source
 String findDatasourceJndiNameForEjb(String ejbName, String referenceName)
          Finds JNDI name of data source which is mapped to the given reference name in the scope of the EJB.
 String findJndiNameForEjb(String ejbName)
          Returns a JNDI name for the given EJB or null if the EJB has no JNDI name assigned.
 MessageDestination findMessageDestination(String name)
          Finds message destination with the given name.
 String findMessageDestinationName(String mdbName)
          Finds name of message destination which the given MDB listens to
 String getContentRelativePath(String deploymentConfigurationFileName)
          Return relative path within the archive or distribution content for the given server specific deployment descriptor file.
 Set<Datasource> getDatasources()
          Gets the data sources saved in the module.
 String[] getDeploymentConfigurationFileNames()
          Return a list of file names for current server specific deployment descriptor used in this module.
 Set<MessageDestination> getMessageDestinations()
          Retrieves message destinations stored in the module.
 Set<MessageDestination> getServerMessageDestinations()
          Retrieves message destinations configured on the target server instance.
 String getWebContextRoot()
          Get web module context root.
 boolean isDatasourceCreationSupported()
          Tests whether data source creation is supported.
 void setCMPMappingInfo(OriginalCMPMapping[] mappings)
          Push the CMP and CMR mapping info to the server configuraion.
 void setCMPResource(String ejbName, String jndiName)
          Sets the resource for the specified CMP bean.
 void setWebContextRoot(String contextRoot)
          Set web module context root.
 boolean supportsCreateMessageDestination()
          Tests whether a message destination creation is supported.
 

Method Detail

createInitialConfiguration

boolean createInitialConfiguration()
Create an initial fresh configuration for the current module. Do nothing if configuration already exists.

Returns:
true if there is no existing configuration, false if there is exsisting configuration.

ensureConfigurationReady

boolean ensureConfigurationReady()
Ensure configuration is ready to respond to any editing to the module.

Returns:
true if the configuration is ready, else false.

setWebContextRoot

void setWebContextRoot(String contextRoot)
                       throws ConfigurationException
Set web module context root.

Parameters:
contextRoot - web module context root.
Throws:
ConfigurationException - reports errors in setting the web context root.

getWebContextRoot

String getWebContextRoot()
                         throws ConfigurationException
Get web module context root.

Returns:
web module context root.
Throws:
ConfigurationException - reports errors in setting the web context root.

getDeploymentConfigurationFileNames

String[] getDeploymentConfigurationFileNames()
Return a list of file names for current server specific deployment descriptor used in this module.


getContentRelativePath

String getContentRelativePath(String deploymentConfigurationFileName)
Return relative path within the archive or distribution content for the given server specific deployment descriptor file.

Parameters:
deploymentConfigurationFileName - server specific descriptor file name
Returns:
relative path inside distribution content.

setCMPMappingInfo

void setCMPMappingInfo(OriginalCMPMapping[] mappings)
                       throws ConfigurationException
Push the CMP and CMR mapping info to the server configuraion. This call is typically used by CMP mapping wizard.

Throws:
ConfigurationException - reports errors in setting the CMP mapping.

setCMPResource

void setCMPResource(String ejbName,
                    String jndiName)
                    throws ConfigurationException
Sets the resource for the specified CMP bean. Some containers may not support fine-grained per bean resource definition, in which case global EJB module CMP resource is set.

Parameters:
ejbName - name of the CMP bean.
jndiName - the JNDI name of the resource.
Throws:
ConfigurationException - reports errors in setting the CMP resource.
NullPointerException - if any of the parameters is null.
Since:
1.30

isDatasourceCreationSupported

boolean isDatasourceCreationSupported()
Tests whether data source creation is supported.

Returns:
true if data source creation is supported, false otherwise.
Since:
1.15

getDatasources

Set<Datasource> getDatasources()
                               throws ConfigurationException
Gets the data sources saved in the module.

Returns:
set of data sources
Throws:
ConfigurationException - reports errors in retrieving the data sources.
Since:
1.15

createDatasource

Datasource createDatasource(String jndiName,
                            String url,
                            String username,
                            String password,
                            String driver)
                            throws UnsupportedOperationException,
                                   DatasourceAlreadyExistsException,
                                   ConfigurationException
Creates and saves data source in the module if it does not exist yet in the module. Data source is considered to be existing when JNDI name of the found data source and the one just created equal.

Parameters:
jndiName - name of data source
url - database URL
username - database user
password - user's password
driver - fully qualified name of database driver class
Returns:
created data source
Throws:
UnsupportedOperationException - if operation is not supported
DatasourceAlreadyExistsException - if conflicting data source is found
ConfigurationException - reports errors in creating the data source.
Since:
1.15

bindDatasourceReference

void bindDatasourceReference(String referenceName,
                             String jndiName)
                             throws ConfigurationException
Binds the data source reference name with the corresponding data source which is identified by the given JNDI name.

Parameters:
referenceName - name used to identify the data source
jndiName - JNDI name of the data source
Throws:
NullPointerException - if any of parameters is null
ConfigurationException - if there is some problem with data source configuration
Since:
1.25

bindDatasourceReferenceForEjb

void bindDatasourceReferenceForEjb(String ejbName,
                                   String ejbType,
                                   String referenceName,
                                   String jndiName)
                                   throws ConfigurationException
Binds the data source reference name with the corresponding data source which is identified by the given JNDI name. The reference is used within the scope of the EJB.

Parameters:
ejbName - EJB name
ejbType - EJB type - the possible values are org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.SESSION, org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.ENTITY and org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.MESSAGE_DRIVEN
referenceName - name used to identify the data source
jndiName - JNDI name of the data source
Throws:
NullPointerException - if any of parameters is null
ConfigurationException - if there is some problem with data source configuration
IllegalArgumentException - if ejbType doesn't have one of allowed values
Since:
1.25

findDatasourceJndiName

String findDatasourceJndiName(String referenceName)
                              throws ConfigurationException
Finds JNDI name of data source which is mapped to the given reference name of a data source

Parameters:
referenceName - reference name of data source
Returns:
JNDI name which is mapped to the given JNDI name
Throws:
NullPointerException - if reference name is null
ConfigurationException - if there is some problem with data source configuration
Since:
1.25

findDatasourceJndiNameForEjb

String findDatasourceJndiNameForEjb(String ejbName,
                                    String referenceName)
                                    throws ConfigurationException
Finds JNDI name of data source which is mapped to the given reference name in the scope of the EJB.

Parameters:
ejbName - EJB name
referenceName - reference name of data source
Returns:
data source if it exists, null otherwise
Throws:
NullPointerException - if any of parameters is null
ConfigurationException - if there is some problem with data source configuration
Since:
1.25

findDatasource

Datasource findDatasource(String jndiName)
                          throws ConfigurationException
Finds data source with the given JNDI name.

Parameters:
jndiName - JNDI name of a data source
Returns:
data source if it exists, null otherwise
Throws:
NullPointerException - if JNDI name is null
ConfigurationException - if there is some problem with data source configuration
Since:
1.25

getMessageDestinations

Set<MessageDestination> getMessageDestinations()
                                               throws ConfigurationException
Retrieves message destinations stored in the module.

Returns:
set of message destinations
Throws:
ConfigurationException - if there is some problem with message destination configuration
Since:
1.25

getServerMessageDestinations

Set<MessageDestination> getServerMessageDestinations()
                                                     throws ConfigurationException
Retrieves message destinations configured on the target server instance.

Returns:
set of message destinations
Throws:
ConfigurationException - if there is some problem with message destination configuration
Since:
1.25

supportsCreateMessageDestination

boolean supportsCreateMessageDestination()
Tests whether a message destination creation is supported.

Returns:
true if message destination creation is supported, false otherwise.
Since:
1.25

createMessageDestination

MessageDestination createMessageDestination(String name,
                                            MessageDestination.Type type)
                                            throws UnsupportedOperationException,
                                                   ConfigurationException
Creates and saves a message destination in the module if it does not exist in the module yet. Message destinations are considered to be equal if their JNDI names are equal.

Parameters:
name - name of the message destination
type - message destination type
Returns:
created message destination
Throws:
NullPointerException - if any of parameters is null
UnsupportedOperationException - if this opearation is not supported
ConfigurationException - if there is some problem with message destination configuration
Since:
1.25

bindMdbToMessageDestination

void bindMdbToMessageDestination(String mdbName,
                                 String name,
                                 MessageDestination.Type type)
                                 throws ConfigurationException
Binds the message destination name with message-driven bean.

Parameters:
mdbName - MDB name
name - name of the message destination
type - message destination type
Throws:
NullPointerException - if any of parameters is null
ConfigurationException - if there is some problem with message destination configuration
Since:
1.25

findMessageDestinationName

String findMessageDestinationName(String mdbName)
                                  throws ConfigurationException
Finds name of message destination which the given MDB listens to

Parameters:
mdbName - MDB name
Returns:
message destination name
Throws:
NullPointerException - if MDB name is null
ConfigurationException - if there is some problem with message destination configuration
Since:
1.25

findMessageDestination

MessageDestination findMessageDestination(String name)
                                          throws ConfigurationException
Finds message destination with the given name.

Parameters:
name - message destination name
Returns:
message destination if it exists, null otherwise
Throws:
NullPointerException - if name is null
ConfigurationException - if there is some problem with message destination configuration
Since:
1.25

bindMessageDestinationReference

void bindMessageDestinationReference(String referenceName,
                                     String connectionFactoryName,
                                     String destName,
                                     MessageDestination.Type type)
                                     throws ConfigurationException
Binds the message destination reference name with the corresponding message destination which is identified by the given name.

Parameters:
referenceName - reference name used to identify the message destination
connectionFactoryName - connection factory name
destName - name of the message destination
type - message destination type
Throws:
NullPointerException - if any of parameters is null
ConfigurationException - if there is some problem with message destination configuration
Since:
1.25

bindMessageDestinationReferenceForEjb

void bindMessageDestinationReferenceForEjb(String ejbName,
                                           String ejbType,
                                           String referenceName,
                                           String connectionFactoryName,
                                           String destName,
                                           MessageDestination.Type type)
                                           throws ConfigurationException
Binds the message destination reference name with the corresponding message destination which is identified by the given name. The reference is used within the EJB scope.

Parameters:
ejbName - EJB name
ejbType - EJB type - the possible values are org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.SESSION, org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.ENTITY and org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.MESSAGE_DRIVEN
referenceName - reference name used to identify the message destination
connectionFactoryName - connection factory name
destName - name of the message destination
type - message destination type
Throws:
NullPointerException - if any of parameters is null
ConfigurationException - if there is some problem with message destination configuration
IllegalArgumentException - if ejbType doesn't have one of allowed values
Since:
1.25

findJndiNameForEjb

String findJndiNameForEjb(String ejbName)
                          throws ConfigurationException
Returns a JNDI name for the given EJB or null if the EJB has no JNDI name assigned.

Parameters:
ejbName - EJB name
Returns:
JNDI name bound to the EJB or null if the EJB has no JNDI name assigned.
Throws:
ConfigurationException - if there is some problem with EJB configuration.
Since:
1.33

bindEjbReference

void bindEjbReference(String referenceName,
                      String jndiName)
                      throws ConfigurationException
Binds EJB reference name with EJB name.

Parameters:
referenceName - name used to identify the EJB
jndiName - JNDI name of the referenced EJB
Throws:
NullPointerException - if any of parameters is null
ConfigurationException - if there is some problem with EJB configuration
Since:
1.26

bindEjbReferenceForEjb

void bindEjbReferenceForEjb(String ejbName,
                            String ejbType,
                            String referenceName,
                            String jndiName)
                            throws ConfigurationException
Binds EJB reference name with EJB name within the EJB scope.

Parameters:
ejbName - EJB name
ejbType - EJB type - the possible values are org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.SESSION, org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.ENTITY and org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.MESSAGE_DRIVEN
referenceName - name used to identify the referenced EJB
jndiName - JNDI name of the referenced EJB
Throws:
NullPointerException - if any of parameters is null
ConfigurationException - if there is some problem with EJB configuration
IllegalArgumentException - if ejbType doesn't have one of allowed values
Since:
1.26

org.netbeans.modules.j2eeserver/4 1.55.0 1

Built on December 1 2008.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.