org.netbeans.modules.j2eeserver/4 1.55.0 1

org.netbeans.modules.j2ee.deployment.devmodules.spi
Class J2eeModuleProvider

java.lang.Object
  extended by org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider
Direct Known Subclasses:
J2eeApplicationProvider

public abstract class J2eeModuleProvider
extends Object

This object must be implemented by J2EE module support and an instance added into project lookup.


Nested Class Summary
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...
static interface J2eeModuleProvider.DeployOnSaveSupport
           
 
Constructor Summary
J2eeModuleProvider()
           
 
Method Summary
 void addConfigurationFilesListener(ConfigurationFilesListener l)
           
 void addInstanceListener(InstanceListener l)
          Register an instance listener that will listen to server instances changes.
 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 on the target server or in the module.
 void deployDatasources()
          Deploys data sources saved in the module.
protected  void fireServerChange(String oldServerID, String newServerID)
           
 J2eeModuleProvider.ConfigSupport getConfigSupport()
           
 FileObject[] getConfigurationFiles()
          Returns all configuration files known to this J2EE Module.
 FileObject[] getConfigurationFiles(boolean refresh)
           
 String getDeploymentName()
          Return name to be used in deployment of the module.
 J2eeModuleProvider.DeployOnSaveSupport getDeployOnSaveSupport()
           
 InstanceProperties getInstanceProperties()
          Return InstanceProperties of the server instance
abstract  J2eeModule getJ2eeModule()
           
abstract  ModuleChangeReporter getModuleChangeReporter()
           
 Set<Datasource> getModuleDatasources()
          Gets the data sources saved in the module.
 Set<Datasource> getServerDatasources()
          Gets the data sources deployed on the target server instance.
 ServerDebugInfo getServerDebugInfo()
          Return server debug info.
abstract  String getServerID()
          This method is used to determin type of target server.
abstract  String getServerInstanceID()
          Id of server instance for deployment or null if the module has no server instance set.
 SourceFileMap getSourceFileMap()
          Return destination path-to-source file mappings.
 FileObject[] getSourceRoots()
          Returns list of root directories for source files including configuration files.
 boolean hasVerifierSupport()
          Returns true if the current target platform provide verifier support for this module.
 boolean isDatasourceCreationSupported()
          Tests whether data source creation is supported.
 void removeConfigurationFilesListener(ConfigurationFilesListener l)
           
 void removeInstanceListener(InstanceListener l)
          Remove an instance listener which has been registered previously.
abstract  void setServerInstanceID(String severInstanceID)
          Set ID of the server instance that will be used for deployment.
 void verify(FileObject target, OutputStream logger)
          Invoke verifier from current platform on the provided target file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

J2eeModuleProvider

public J2eeModuleProvider()
Method Detail

getJ2eeModule

public abstract J2eeModule getJ2eeModule()

getModuleChangeReporter

public abstract ModuleChangeReporter getModuleChangeReporter()

getConfigSupport

public final J2eeModuleProvider.ConfigSupport getConfigSupport()

getServerDebugInfo

public final ServerDebugInfo getServerDebugInfo()
Return server debug info. Note: if server is not running and needs to be up for retrieving debug info, this call will return null. This call is also used by UI so it should not try to ping or start the server.


getServerDatasources

public Set<Datasource> getServerDatasources()
                                     throws ConfigurationException
Gets the data sources deployed on the target server instance.

Returns:
set of data sources
Throws:
ConfigurationException - reports problems in retrieving data source definitions.
Since:
1.15

getModuleDatasources

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

Returns:
set of data sources
Throws:
ConfigurationException - reports problems in retrieving data source definitions.
Since:
1.15

isDatasourceCreationSupported

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

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

createDatasource

public final Datasource createDatasource(String jndiName,
                                         String url,
                                         String username,
                                         String password,
                                         String driver)
                                  throws DatasourceAlreadyExistsException,
                                         ConfigurationException
Creates and saves data source in the module if it does not exist yet on the target server or 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:
DatasourceAlreadyExistsException - if conflicting data source is found
ConfigurationException
Since:
1.15

deployDatasources

public void deployDatasources()
                       throws ConfigurationException,
                              DatasourceAlreadyExistsException
Deploys data sources saved in the module.

Throws:
ConfigurationException - if there is some problem with data source configuration
DatasourceAlreadyExistsException - if module data source(s) are conflicting with data source(s) already deployed on the server
Since:
1.15

getSourceRoots

public FileObject[] getSourceRoots()
Returns list of root directories for source files including configuration files. Examples: file objects for src/java, src/conf. Note: If there is a standard configuration root, it should be the first one in the returned list.


getSourceFileMap

public SourceFileMap getSourceFileMap()
Return destination path-to-source file mappings. Default returns config file mapping with straight mapping from the configuration directory to distribution directory.


setServerInstanceID

public abstract void setServerInstanceID(String severInstanceID)
Set ID of the server instance that will be used for deployment.

Parameters:
severInstanceID - server instance ID.
Since:
1.6

getServerInstanceID

public abstract String getServerInstanceID()
Id of server instance for deployment or null if the module has no server instance set.

Returns:
Id of server instance for deployment or null if the module has no server instance set.

getDeployOnSaveSupport

public J2eeModuleProvider.DeployOnSaveSupport getDeployOnSaveSupport()
Returns:
Since:
1.48

getInstanceProperties

public InstanceProperties getInstanceProperties()
Return InstanceProperties of the server instance


getServerID

public abstract String getServerID()
This method is used to determin type of target server. The return value must correspond to the value returned from getServerInstanceID.

Returns:
the target server type or null if the module has no target server type set.

getDeploymentName

public String getDeploymentName()
Return name to be used in deployment of the module.


hasVerifierSupport

public boolean hasVerifierSupport()
Returns true if the current target platform provide verifier support for this module.


verify

public void verify(FileObject target,
                   OutputStream logger)
            throws ValidationException
Invoke verifier from current platform on the provided target file.

Parameters:
target - File to run verifier against.
logger - output stream to write verification resutl to.
Throws:
ValidationException

fireServerChange

protected final void fireServerChange(String oldServerID,
                                      String newServerID)

getConfigurationFiles

public final FileObject[] getConfigurationFiles()
Returns all configuration files known to this J2EE Module.


getConfigurationFiles

public final FileObject[] getConfigurationFiles(boolean refresh)

addConfigurationFilesListener

public final void addConfigurationFilesListener(ConfigurationFilesListener l)

removeConfigurationFilesListener

public final void removeConfigurationFilesListener(ConfigurationFilesListener l)

addInstanceListener

public final void addInstanceListener(InstanceListener l)
Register an instance listener that will listen to server instances changes.

Parameters:
l - listener which should be added.
Since:
1.6

removeInstanceListener

public final void removeInstanceListener(InstanceListener l)
Remove an instance listener which has been registered previously.

Parameters:
l - listener which should be removed.
Since:
1.6

org.netbeans.modules.j2eeserver/4 1.55.0 1

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