com.ibm.websphere.ant.tasks

Class DefaultBindings

  1. java.lang.Object
  2. extended byTask
  3. extended bycom.ibm.websphere.ant.tasks.DefaultBindings

  1. public class DefaultBindings
  2. extends 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: <wsdefaultbindings ear="the ear file you wish to install" outputfile="output ear to generate" defaultdatasource="jndi name of the default datasource to use for the application" dbuser="Database user id" dbpassword="datebase password" defaultconnectionfactory="JNDI name of the default connection factory to be used by the application" resauth="perconnfact | container" ejbjndiprefix="String to prefix to the front of all generated EJB JNDI Names" virtualhost="virtual host name for the application to execute on" forcebindings="true | false" strategy="generation strategy" failonerror="true | false" exportfile="exported strategy file"/> The ear attribute is required and contains the path of the ear for which you wish to generate bindings.
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 <taskdef name="wsDefaultBindings" classname="com.ibm.websphere.ant.tasks.DefaultBindings"/>

Constructor Summary

Constructor and Description
DefaultBindings()
The default constructor.

Method Summary

Modifier and Type Method and Description
  1. void
execute()
Executes the ant task, i.e. opens the ear file, populates it with bindings and writes out to the output ear.
  1. java.lang.String
getDbPassword()
Gets the password associated with the default data source.
  1. java.lang.String
getDbUser()
Gets the userid associated with the default data source.
  1. java.lang.String
getDefaultConnectionFactory()
Gets the JNDI name of defaultConnectionFactory.
  1. java.lang.String
getDefaultDataSource()
Gets the JNDI name of the default data source.
  1. java.lang.String
getEar()
Gets the ear.
  1. java.lang.String
getEjbJndiPrefix()
Gets the ejbJndiPrefix.
  1. java.lang.String
getExportFile()
Returns the exportFile.
  1. boolean
getForceBindings()
Gets the forceBindings flag.
  1. java.lang.String
getOutputFile()
Gets the outputFile.
  1. java.lang.String
getResAuth()
Gets the resAuth.
  1. java.lang.String
getStrategy()
Gets the strategy.
  1. java.lang.String
getVirtualHost()
Gets the virtualHost.
  1. void
setDbPassword(java.lang.String dbPassword)
Sets the password associated with the default data source.
  1. void
setDbUser(java.lang.String dbUser)
Sets userid associated with the default data source.
  1. void
setDefaultConnectionFactory(java.lang.String defaultConnectionFactory)
Sets the JNDI name of defaultConnectionFactory.
  1. void
setDefaultDataSource(java.lang.String defaultDataSource)
Sets thethe JNDI name of the default data source.
  1. void
setEar(java.lang.String ear)
Sets the ear.
  1. void
setEjbJndiPrefix(java.lang.String ejbJndiPrefix)
Sets the ejbJndiPrefix.
  1. void
setExportFile(java.lang.String exportFile)
Sets the exportFile.
  1. void
setFailonerror(boolean failonerror)
Sets the failonerror flag.
  1. void
setForceBindings(boolean forceBindings)
Sets the forceBindingsflag
  1. void
setOutputFile(java.lang.String outputFile)
Sets the outputFile.
  1. void
setResAuth(java.lang.String resAuth)
Sets the resAuth.
  1. void
setStrategy(java.lang.String strategy)
Sets the strategy.
  1. void
setVirtualHost(java.lang.String virtualHost)
Sets the virtualHost.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultBindings

  1. public DefaultBindings()
The default constructor.

Method Detail

execute

  1. public void execute()
  2. throws BuildException
Executes the ant task, i.e. opens the ear file, populates it with bindings and writes out to the output ear.
Throws:
BuildException
See Also:

getDbPassword

  1. public java.lang.String getDbPassword( )
Gets the password associated with the default data source.
Returns:
Returns a String
See Also:

setDbPassword

  1. 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:

getDbUser

  1. public java.lang.String getDbUser( )
Gets the userid associated with the default data source.
Returns:
Returns a String
See Also:

setDbUser

  1. public void setDbUser(java.lang.String dbUser)
Sets userid associated with the default data source.
Parameters:
dbUser - The dbUser to set
See Also:

getDefaultConnectionFactory

  1. 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

  1. 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

  1. 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

  1. 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

  1. public java.lang.String getEar( )
Gets the ear.
Returns:
Returns a String

setEar

  1. public void setEar(java.lang.String ear)
Sets the ear.
Parameters:
ear - The ear to set

getEjbJndiPrefix

  1. public java.lang.String getEjbJndiPrefix( )
Gets the ejbJndiPrefix.
Returns:
Returns a String

setEjbJndiPrefix

  1. public void setEjbJndiPrefix(java.lang.String ejbJndiPrefix)
Sets the ejbJndiPrefix.
Parameters:
ejbJndiPrefix - The ejbJndiPrefix to set

getForceBindings

  1. public boolean getForceBindings( )
Gets the forceBindings flag.
Returns:
Returns a boolean

setForceBindings

  1. public void setForceBindings(boolean forceBindings)
Sets the forceBindingsflag

getOutputFile

  1. public java.lang.String getOutputFile( )
Gets the outputFile.
Returns:
Returns a String

setOutputFile

  1. public void setOutputFile(java.lang.String outputFile)
Sets the outputFile.
Parameters:
outputFile - The outputFile to set

getResAuth

  1. public java.lang.String getResAuth( )
Gets the resAuth.
Returns:
Returns a String

setResAuth

  1. public void setResAuth(java.lang.String resAuth)
Sets the resAuth.
Parameters:
resAuth - The resAuth to set

getStrategy

  1. public java.lang.String getStrategy( )
Gets the strategy.
Returns:
Returns a String

setStrategy

  1. public void setStrategy(java.lang.String strategy)
Sets the strategy.
Parameters:
strategy - The strategy to set

getVirtualHost

  1. public java.lang.String getVirtualHost( )
Gets the virtualHost.
Returns:
Returns a String

setVirtualHost

  1. public void setVirtualHost(java.lang.String virtualHost)
Sets the virtualHost.
Parameters:
virtualHost - The virtualHost to set

getExportFile

  1. public java.lang.String getExportFile( )
Returns the exportFile.
Returns:
String

setExportFile

  1. public void setExportFile(java.lang.String exportFile)
Sets the exportFile.
Parameters:
exportFile - The exportFile to set

setFailonerror

  1. public void setFailonerror(boolean failonerror)
Sets the failonerror flag.
Parameters:
failonerror - The failonerror to set