Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source.
   * Copyright 2006, Red Hat Middleware LLC, and individual contributors
   * as indicated by the @author tags. See the copyright.txt file in the
   * distribution for a full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
 package org.jboss.resource.metadata.mcf;
 
 import java.util.List;
 
 
A DataSourceDeploymentMetaData.

Author(s):
Weston Price
Version:
$Revision: 1.1 $
 
 {
   
The serialVersionUID
 
    private static final long serialVersionUID = 1440129014410015366L;
    
    private static final String CONNECTION_DEFINITION = "javax.sql.DataSource";
    
    private static final String RAR_NAME = "jboss-local-jdbc.rar";
 
    @XmlElement(name="transaction-isolation")
    private String transactionIsolation;
    
    @XmlElement(name="user-name")
    private String userName;
    
    @XmlElement(name="password")
    private String passWord;
    
    @XmlElement(name="new-connection-sql")
    private String newConnectionSQL;
    
    @XmlElement(name="check-valid-connection-sql")
    
    @XmlElement(name="valid-connection-checker-class-name")
    
    @XmlElement(name="exception-sorter-class-name")
    
    @XmlElement(name="stale-connection-checker-class-name")
    
    @XmlElement(name="track-statements")
    private String trackStatements;
    
    @XmlElement(name="prepared-statement-cache-size")
    private int preparedStatementCacheSize = 0;
    
    @XmlElement(name="share-prepared-statements")
    private boolean sharePreparedStatements;
    
    @XmlElement(name="set-tx-query-timeout")
    private boolean useQueryTimeout;
    
    @XmlElement(name="query-timeout")
    private int queryTimeout;
    
    @XmlElement(name="use-try-lock")
    private long useTryLock;
   
   @XmlElement(name="url-delimiter")
   private String urlDelimiter;
   
   @XmlElement(name="url-selector-strategy-class-name")
   
   {
      setRarName();
      
   }
   @ManagementProperty(name="transaction-isolation",
         description="The DataSource transaction isolation level",
         includeInTemplate=true)
   {
      return ;
   }
   public void setTransactionIsolation(String transactionIsolation)
   {
      this. = transactionIsolation;
   }
   @ManagementProperty(name="password", description="The DataSource password",
         includeInTemplate=true)
   public String getPassWord()
   {
      return ;
   }
   public void setPassWord(String passWord)
   {
      this. = passWord;
   }
   @ManagementProperty(name="user-name", description="The DataSource username",
         includeInTemplate=true)
   public String getUserName()
   {
      return ;
   }
   public void setUserName(String userName)
   {
      this. = userName;
   }
   
      
   @ManagementProperty(name="check-valid-connection-sql",
         description="The SQL statement to validate a connection",
         includeInTemplate=true)
   {
      return ;
   }
   public void setCheckValidConnectionSQL(String checkValidConnectionSQL)
   {
      this. = checkValidConnectionSQL;
   }
   @ManagementProperty(name="exception-sorter-class-name",
         description="The exception sorter class name",
         includeInTemplate=true)
   {
      return ;
   }
   public void setExceptionSorterClassName(String exceptionSorterClassName)
   {
      this. = exceptionSorterClassName;
   }
   @ManagementProperty(name="new-connection-sql", description="The new connection SQL",
         includeInTemplate=true)
   {
      return ;
   }
   public void setNewConnectionSQL(String newConnectionSQL)
   {
      this. = newConnectionSQL;
   }
   @ManagementProperty(name="valid-connection-checker-class-name",
         description="The DataSource connection checker class name",
         includeInTemplate=true)
   {
   }
   public void setValidConnectionCheckerClassName(String validConnectionCheckerClassName)
   {
      this. = validConnectionCheckerClassName;
   }
   @ManagementProperty(name="stale-connection-checker-class-name",
         description="The DataSource stale connection checker class name",
         includeInTemplate=true)
   {
   }
   public void setStaleConnectionCheckerClassName(String staleConnectionCheckerClassName)
   {
      this. = staleConnectionCheckerClassName;
   }
   @ManagementProperty(name="url-delimiter", description="The DataSource url delimiter",
         includeInTemplate=true)
   public String getURLDelimiter()
   {
      return ;
   }
   public void setURLDelimiter(String urlDelimiter)
   {
      this. = urlDelimiter;
   }
   @ManagementProperty(name="url-selector-strategy-class-name",
         description="The DataSource url selector strategy class name",
         includeInTemplate=true)
   {
      return ;
   }
   public void setURLSelectorStrategyClassName(String urlSelectorStrategyClassName)
   {
      this. = urlSelectorStrategyClassName;
   }
      
   @ManagementProperty(name="prepared-statement-cache-size",
         description="The DataSource prepared statement cache size",
         includeInTemplate=true)
   {
      return ;
   }
   public void setPreparedStatementCacheSize(int preparedStatementCacheSize)
   {
      this. = preparedStatementCacheSize;
   }
   @ManagementProperty(name="query-timeout", description="The query timeout",
         includeInTemplate=true)
   public int getQueryTimeout()
   {
      return ;
   }
   public void setQueryTimeout(int queryTimeout)
   {
      this. = queryTimeout;
   }
   @ManagementProperty(name="use-try-lock", description="The internal lock timeout",
         includeInTemplate=true)
   public long getUseTryLock()
   {
      return ;
   }
   public void setUseTryLock(long useTryLock)
   {
      this. = useTryLock;
   }
   @ManagementProperty(name="share-prepared-statements",
         description="Should prepared statements be shared",
         includeInTemplate=true)
   public boolean isSharePreparedStatements()
   {
      return ;
   }
   public void setSharePreparedStatements(boolean sharePreparedStatements)
   {
      this. = sharePreparedStatements;
   }
   @ManagementProperty(name="track-statements", description="The track statements method",
         includeInTemplate=true)
   public String getTrackStatements()
   {
      return ;
   }
   public void setTrackStatements(String trackStatements)
   {
      this. = trackStatements;
   }
   @ManagementProperty(name="set-tx-query-timeout", description="Should query timeout be enabled",
         includeInTemplate=true)
   public boolean isUseQueryTimeout()
   {
      return ;
   }
   public void setUseQueryTimeout(boolean useQueryTimeout)
   {
      this. = useQueryTimeout;
   }
   @ManagementProperty(name="config-property",
         description="The connection factory property info", managed=true,
         includeInTemplate=true)
   {
      ManagedConnectionFactoryPropertyMetaData property = null;
            
      if(getUserName() != null)
      {
         property = new ManagedConnectionFactoryPropertyMetaData();
         property.setName("UserName");
         property.setValue(getUserName());
         properties.add(property);
      }
      
      if(getPassWord() != null)
      {
         property = new ManagedConnectionFactoryPropertyMetaData();
         property.setName("Password");
         property.setValue(getPassWord());
         properties.add(property);
         
      }
      
      if(getTransactionIsolation() != null)
      {
         property = new ManagedConnectionFactoryPropertyMetaData();
         property.setName("TransactionIsolation");
         property.setValue(getTransactionIsolation());
         properties.add(property);
         
      }
      
      if(getNewConnectionSQL() != null)
      {
         property = new ManagedConnectionFactoryPropertyMetaData();
         property.setName("NewConnectionSQL");
         property.setValue(getNewConnectionSQL());         
         properties.add(property);
      }
      
      if(getCheckValidConnectionSQL() != null)
      {
         property = new ManagedConnectionFactoryPropertyMetaData();
         property.setName("CheckValidConnectionSQL");
         property.setValue(getCheckValidConnectionSQL());                  
         properties.add(property);
      }
      
      if(getValidConnectionCheckerClassName() != null)
      {
         property = new ManagedConnectionFactoryPropertyMetaData();
         property.setName("ValidConnectionCheckerClassName");
         property.setValue(getValidConnectionCheckerClassName());                           
         properties.add(property);
      }
      
      if(getExceptionSorterClassName() != null)
      {
         property = new ManagedConnectionFactoryPropertyMetaData();
         property.setName("ExceptionSorterClassName");
         property.setValue(getExceptionSorterClassName());                           
         properties.add(property);         
      }
      
      if(getStaleConnectionCheckerClassName() != null)
      {
         property = new ManagedConnectionFactoryPropertyMetaData();
         property.setName("StaleConnectionCheckerClassName");
         property.setValue(getStaleConnectionCheckerClassName());                           
         properties.add(property);         
      }
      
      if(getURLSelectorStrategyClassName() != null)
      {
         property = new ManagedConnectionFactoryPropertyMetaData();
         property.setName("URLSelectorStrategyClassName");
         property.setValue(getURLSelectorStrategyClassName());                           
         properties.add(property);         
      }
      
      if(getURLDelimiter() != null)
      {
         property = new ManagedConnectionFactoryPropertyMetaData();
         property.setName("URLDelimiter");
         property.setValue(getURLDelimiter());                           
         properties.add(property);         
      }
      
      property = new ManagedConnectionFactoryPropertyMetaData();
      property.setName("PreparedStatementCacheSize");
      property.setType("int");
      property.setValue(String.valueOf(getPreparedStatementCacheSize()));
      properties.add(property);
      
      property = new ManagedConnectionFactoryPropertyMetaData();
      property.setName("SharePreparedStatements");
      property.setType("boolean");
      property.setValue(String.valueOf(isSharePreparedStatements()));
      properties.add(property);
      
      property = new ManagedConnectionFactoryPropertyMetaData();
      property.setName("QueryTimeout");
      property.setType("int");
      property.setValue(String.valueOf(getQueryTimeout()));
      properties.add(property);
      
      property = new ManagedConnectionFactoryPropertyMetaData();
      property.setName("UseTryLock");
      property.setType("long");
      property.setValue(String.valueOf(getUseTryLock()));
      properties.add(property);
      
      property = new ManagedConnectionFactoryPropertyMetaData();
      property.setName("TransactionQueryTimeout");
      property.setType("boolean");
      property.setValue(String.valueOf(isUseQueryTimeout()));
      properties.add(property);
      
      property = new ManagedConnectionFactoryPropertyMetaData();
      property.setName("ValidateOnMatch");
      property.setType("boolean");
      property.setValue(String.valueOf(isValidateOnMatch()));
      properties.add(property);
      
      if (getTrackStatements() != null)
      {
         property = new ManagedConnectionFactoryPropertyMetaData();
         property.setName("TrackStatements");
         property.setType("java.lang.String");
         property.setValue(String.valueOf(getTrackStatements()));
         properties.add(property);
      }
      
      return properties;
   }
New to GrepCode? Check out our FAQ X