com.ibm.websphere.ant.tasks
Class DefaultBindings
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- com.ibm.websphere.ant.tasks.DefaultBindings
-
- All Implemented Interfaces:
- java.lang.Cloneable
public class DefaultBindings extends org.apache.tools.ant.Task
The wsDefaultBindings task enables you to generate default IBM WebSphere Bindings for the specified EAR file. This tasks provides options to control how the bindings are generated and mimics the options provided by the WebSphere Application Install wizards. The structure of the wsDefaultBindings task is shown below:
The outputFile attribute is required and contains the path of the bound ear.
The defaultDataSource attribute is optional. It specifies a default data source JNDI name to be used for all EJB 1.x CMPs.
The dbUser attribute is optional. It specifies the user associated with the default data source.
The dbPassword attribute is optional. It specifies the password associated with the default data source.
The defaultConnectionFactory attribute is optional. It specifies the default connection factory to be used for all EJB 2.x CMPs.
The resAuth attribute is optional. It specifies the resource authorization on the connection factory for EJB 2.x CMPs.
The ejbJndiPrefix attribute is optional. It specifies a prefix that is prepended to any generated EJB JNDI names. The default is "ejb".
The virtualHost attribute is optional. It specifies the virtual host for all wars in the application.
The forceBindings attribute is optional. When false, any pre-existing bindings will not be altered. When true, new bindings are completely generated. The default is false.
The strategy attribute is optional. When specified, this attribute points to a custom strategy file that further affects the bindings. See the properties/dfltbndngs.dtd of your WebSphere installation for more details.
The failonerror attribute is optional. When this is specified the build will fail if any exception is thrown. The default is true.
The exportFile attribute is optional. When specified, it points to a file that will be generated containing the bindings information. This file is in the custom strategy format.
To use this task, add the following to your Ant build.xml
-
-
Constructor Summary
Constructors Constructor and Description DefaultBindings()
The default constructor.
-
Method Summary
Methods Modifier and Type Method and Description void
execute()
Executes the ant task, i.e. opens the ear file, populates it with bindings and writes out to the output ear.java.lang.String
getDbPassword()
Gets the password associated with the default data source.java.lang.String
getDbUser()
Gets the userid associated with the default data source.java.lang.String
getDefaultConnectionFactory()
Gets the JNDI name of defaultConnectionFactory.java.lang.String
getDefaultDataSource()
Gets the JNDI name of the default data source.java.lang.String
getEar()
Gets the ear.java.lang.String
getEjbJndiPrefix()
Gets the ejbJndiPrefix.java.lang.String
getExportFile()
Returns the exportFile.boolean
getForceBindings()
Gets the forceBindings flag.java.lang.String
getOutputFile()
Gets the outputFile.java.lang.String
getResAuth()
Gets the resAuth.java.lang.String
getStrategy()
Gets the strategy.java.lang.String
getVirtualHost()
Gets the virtualHost.void
setDbPassword(java.lang.String dbPassword)
Sets the password associated with the default data source.void
setDbUser(java.lang.String dbUser)
Sets userid associated with the default data source.void
setDefaultConnectionFactory(java.lang.String defaultConnectionFactory)
Sets the JNDI name of defaultConnectionFactory.void
setDefaultDataSource(java.lang.String defaultDataSource)
Sets thethe JNDI name of the default data source.void
setEar(java.lang.String ear)
Sets the ear.void
setEjbJndiPrefix(java.lang.String ejbJndiPrefix)
Sets the ejbJndiPrefix.void
setExportFile(java.lang.String exportFile)
Sets the exportFile.void
setFailonerror(boolean failonerror)
Sets the failonerror flag.void
setForceBindings(boolean forceBindings)
Sets the forceBindingsflagvoid
setOutputFile(java.lang.String outputFile)
Sets the outputFile.void
setResAuth(java.lang.String resAuth)
Sets the resAuth.void
setStrategy(java.lang.String strategy)
Sets the strategy.void
setVirtualHost(java.lang.String virtualHost)
Sets the virtualHost.-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Method Detail
-
execute
public void execute() throws org.apache.tools.ant.BuildException
Executes the ant task, i.e. opens the ear file, populates it with bindings and writes out to the output ear.- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
- See Also:
getEar()
,getOutputFile()
-
getDbPassword
public java.lang.String getDbPassword()
Gets the password associated with the default data source.- Returns:
- Returns a String
- See Also:
getDefaultDataSource()
-
setDbPassword
public void setDbPassword(java.lang.String dbPassword)
Sets the password associated with the default data source.- Parameters:
dbPassword
- The password to be set- See Also:
setDefaultDataSource(String)
-
getDbUser
public java.lang.String getDbUser()
Gets the userid associated with the default data source.- Returns:
- Returns a String
- See Also:
getDefaultDataSource()
-
setDbUser
public void setDbUser(java.lang.String dbUser)
Sets userid associated with the default data source.- Parameters:
dbUser
- The dbUser to set- See Also:
setDefaultDataSource(String)
-
getDefaultConnectionFactory
public java.lang.String getDefaultConnectionFactory()
Gets the JNDI name of defaultConnectionFactory. Note that this is meaningful for EJB jars containing EJB 2.x CMPs.- Returns:
- Returns a String
-
setDefaultConnectionFactory
public void setDefaultConnectionFactory(java.lang.String defaultConnectionFactory)
Sets the JNDI name of defaultConnectionFactory. Note that this is meaningful for EJB jars containing EJB 2.x CMPs.- Parameters:
defaultConnectionFactory
- The defaultConnectionFactory to set
-
getDefaultDataSource
public java.lang.String getDefaultDataSource()
Gets the JNDI name of the default data source. Note that this is meaningful for EJB jars containing EJB 1.x CMPs.- Returns:
- Returns a String
-
setDefaultDataSource
public void setDefaultDataSource(java.lang.String defaultDataSource)
Sets thethe JNDI name of the default data source. Note that this is meaningful for EJB jars containing EJB 1.x CMPs.- Parameters:
defaultDataSource
- The defaultDataSource to set
-
getEar
public java.lang.String getEar()
Gets the ear.- Returns:
- Returns a String
-
setEar
public void setEar(java.lang.String ear)
Sets the ear.- Parameters:
ear
- The ear to set
-
getEjbJndiPrefix
public java.lang.String getEjbJndiPrefix()
Gets the ejbJndiPrefix.- Returns:
- Returns a String
-
setEjbJndiPrefix
public void setEjbJndiPrefix(java.lang.String ejbJndiPrefix)
Sets the ejbJndiPrefix.- Parameters:
ejbJndiPrefix
- The ejbJndiPrefix to set
-
getForceBindings
public boolean getForceBindings()
Gets the forceBindings flag.- Returns:
- Returns a boolean
-
setForceBindings
public void setForceBindings(boolean forceBindings)
Sets the forceBindingsflag- Parameters:
orceBindings
- The forceBindings to set
-
getOutputFile
public java.lang.String getOutputFile()
Gets the outputFile.- Returns:
- Returns a String
-
setOutputFile
public void setOutputFile(java.lang.String outputFile)
Sets the outputFile.- Parameters:
outputFile
- The outputFile to set
-
getResAuth
public java.lang.String getResAuth()
Gets the resAuth.- Returns:
- Returns a String
-
setResAuth
public void setResAuth(java.lang.String resAuth)
Sets the resAuth.- Parameters:
resAuth
- The resAuth to set
-
getStrategy
public java.lang.String getStrategy()
Gets the strategy.- Returns:
- Returns a String
-
setStrategy
public void setStrategy(java.lang.String strategy)
Sets the strategy.- Parameters:
strategy
- The strategy to set
-
getVirtualHost
public java.lang.String getVirtualHost()
Gets the virtualHost.- Returns:
- Returns a String
-
setVirtualHost
public void setVirtualHost(java.lang.String virtualHost)
Sets the virtualHost.- Parameters:
virtualHost
- The virtualHost to set
-
getExportFile
public java.lang.String getExportFile()
Returns the exportFile.- Returns:
- String
-
setExportFile
public void setExportFile(java.lang.String exportFile)
Sets the exportFile.- Parameters:
exportFile
- The exportFile to set
-
setFailonerror
public void setFailonerror(boolean failonerror)
Sets the failonerror flag.- Parameters:
failonerror
- The failonerror to set
-
-