org.jboss.datasources.impl
Class DatasourcesDescriptorImpl

java.lang.Object
  extended by org.jboss.shrinkwrap.descriptor.spi.DescriptorImplBase<org.jboss.shrinkwrap.descriptor.spi.node.NodeDescriptor>
      extended by org.jboss.shrinkwrap.descriptor.spi.node.NodeDescriptorImplBase
          extended by org.jboss.datasources.impl.DatasourcesDescriptorImpl
All Implemented Interfaces:
DatasourcesDescriptor, Descriptor, DescriptorNamespace<DatasourcesDescriptor>, org.jboss.shrinkwrap.descriptor.spi.node.NodeDescriptor

public class DatasourcesDescriptorImpl
extends org.jboss.shrinkwrap.descriptor.spi.node.NodeDescriptorImplBase
implements DescriptorNamespace<DatasourcesDescriptor>, DatasourcesDescriptor

This deployment descriptor provides the functionalities as described in the specification

Example:

DatasourcesDescriptor descriptor = Descriptors.create(DatasourcesDescriptor.class);

Since:
Generation date :2013-01-26T19:27:02.583+01:00
Author:
Ralf Battenfeld, Andrew Lee Rubinger

Constructor Summary
DatasourcesDescriptorImpl(String descriptorName)
           
DatasourcesDescriptorImpl(String descriptorName, org.jboss.shrinkwrap.descriptor.spi.node.Node node)
           
 
Method Summary
 DatasourcesDescriptor addDefaultNamespaces()
          Adds the default namespaces as defined in the specification
 DatasourcesDescriptor addNamespace(String name, String value)
          Adds a new namespace
 DatasourceType<DatasourcesDescriptor> createDatasource()
          Creates a new datasource element
 XaDatasourceType<DatasourcesDescriptor> createXaDatasource()
          Creates a new xa-datasource element
 List<DatasourceType<DatasourcesDescriptor>> getAllDatasource()
          Returns all datasource elements
 List<XaDatasourceType<DatasourcesDescriptor>> getAllXaDatasource()
          Returns all xa-datasource elements
 List<String> getNamespaces()
          Returns all defined namespaces.
 DatasourceType<DatasourcesDescriptor> getOrCreateDatasource()
          If not already created, a new datasource element will be created and returned.
 DriversType<DatasourcesDescriptor> getOrCreateDrivers()
          If not already created, a new drivers element with the given value will be created.
 XaDatasourceType<DatasourcesDescriptor> getOrCreateXaDatasource()
          If not already created, a new xa-datasource element will be created and returned.
 org.jboss.shrinkwrap.descriptor.spi.node.Node getRootNode()
           
 DatasourcesDescriptor removeAllDatasource()
          Removes all datasource elements
 DatasourcesDescriptor removeAllNamespaces()
          Removes all existing namespaces.
 DatasourcesDescriptor removeAllXaDatasource()
          Removes all xa-datasource elements
 DatasourcesDescriptor removeDrivers()
          Removes the drivers element
 
Methods inherited from class org.jboss.shrinkwrap.descriptor.spi.node.NodeDescriptorImplBase
exportTo, getExporter
 
Methods inherited from class org.jboss.shrinkwrap.descriptor.spi.DescriptorImplBase
exportAsString, getDescriptorName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.shrinkwrap.descriptor.api.Descriptor
exportAsString, exportTo, getDescriptorName
 

Constructor Detail

DatasourcesDescriptorImpl

public DatasourcesDescriptorImpl(String descriptorName)

DatasourcesDescriptorImpl

public DatasourcesDescriptorImpl(String descriptorName,
                                 org.jboss.shrinkwrap.descriptor.spi.node.Node node)
Method Detail

getRootNode

public org.jboss.shrinkwrap.descriptor.spi.node.Node getRootNode()
Specified by:
getRootNode in interface org.jboss.shrinkwrap.descriptor.spi.node.NodeDescriptor

addDefaultNamespaces

public DatasourcesDescriptor addDefaultNamespaces()
Adds the default namespaces as defined in the specification

Specified by:
addDefaultNamespaces in interface DescriptorNamespace<DatasourcesDescriptor>
Returns:
the current instance of DatasourcesDescriptor

addNamespace

public DatasourcesDescriptor addNamespace(String name,
                                          String value)
Adds a new namespace

Specified by:
addNamespace in interface DescriptorNamespace<DatasourcesDescriptor>
Parameters:
name - the name of the namespace
value - the value of the namespace
Returns:
the current instance of DatasourcesDescriptor

getNamespaces

public List<String> getNamespaces()
Returns all defined namespaces.

Specified by:
getNamespaces in interface DescriptorNamespace<DatasourcesDescriptor>
Returns:
all defined namespaces

removeAllNamespaces

public DatasourcesDescriptor removeAllNamespaces()
Removes all existing namespaces.

Specified by:
removeAllNamespaces in interface DescriptorNamespace<DatasourcesDescriptor>
Returns:
the current instance of DatasourcesDescriptor

getOrCreateDatasource

public DatasourceType<DatasourcesDescriptor> getOrCreateDatasource()
If not already created, a new datasource element will be created and returned. Otherwise, the first existing datasource element will be returned.

Specified by:
getOrCreateDatasource in interface DatasourcesDescriptor
Returns:
the instance defined for the element datasource

createDatasource

public DatasourceType<DatasourcesDescriptor> createDatasource()
Creates a new datasource element

Specified by:
createDatasource in interface DatasourcesDescriptor
Returns:
the new created instance of DatasourceType

getAllDatasource

public List<DatasourceType<DatasourcesDescriptor>> getAllDatasource()
Returns all datasource elements

Specified by:
getAllDatasource in interface DatasourcesDescriptor
Returns:
list of datasource

removeAllDatasource

public DatasourcesDescriptor removeAllDatasource()
Removes all datasource elements

Specified by:
removeAllDatasource in interface DatasourcesDescriptor
Returns:
the current instance of DatasourceType

getOrCreateXaDatasource

public XaDatasourceType<DatasourcesDescriptor> getOrCreateXaDatasource()
If not already created, a new xa-datasource element will be created and returned. Otherwise, the first existing xa-datasource element will be returned.

Specified by:
getOrCreateXaDatasource in interface DatasourcesDescriptor
Returns:
the instance defined for the element xa-datasource

createXaDatasource

public XaDatasourceType<DatasourcesDescriptor> createXaDatasource()
Creates a new xa-datasource element

Specified by:
createXaDatasource in interface DatasourcesDescriptor
Returns:
the new created instance of XaDatasourceType

getAllXaDatasource

public List<XaDatasourceType<DatasourcesDescriptor>> getAllXaDatasource()
Returns all xa-datasource elements

Specified by:
getAllXaDatasource in interface DatasourcesDescriptor
Returns:
list of xa-datasource

removeAllXaDatasource

public DatasourcesDescriptor removeAllXaDatasource()
Removes all xa-datasource elements

Specified by:
removeAllXaDatasource in interface DatasourcesDescriptor
Returns:
the current instance of XaDatasourceType

getOrCreateDrivers

public DriversType<DatasourcesDescriptor> getOrCreateDrivers()
If not already created, a new drivers element with the given value will be created. Otherwise, the existing drivers element will be returned.

Specified by:
getOrCreateDrivers in interface DatasourcesDescriptor
Returns:
a new or existing instance of DriversType

removeDrivers

public DatasourcesDescriptor removeDrivers()
Removes the drivers element

Specified by:
removeDrivers in interface DatasourcesDescriptor
Returns:
the current instance of DatasourcesDescriptor


Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.