User: mnf999  
  Date: 01/06/18 08:36:52

  Modified:    src/etc  class.java interface.java
  Log:
  Guidelines for coders in JB3.0
  
  Revision  Changes    Path
  1.4       +106 -32   jboss/src/etc/class.java
  
  Index: class.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/etc/class.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- class.java        2001/01/12 05:30:04     1.3
  +++ class.java        2001/06/18 15:36:52     1.4
  @@ -1,41 +1,115 @@
   /*
  - * JBoss, the OpenSource EJB server
  - *
  - * Distributable under LGPL license.
  - * See terms of license at gnu.org.
  - */
  +* JBoss, the OpenSource EJB server
  +*
  +* Distributable under LGPL license.
  +* See terms of license at gnu.org.
  +*/
   package x;
   
  -/**
  - *   <description> 
  - *
  - *   @see <related>
  - *   @author <firstname> <lastname> (<email>)
  - *   @version $Revision: 1.3 $
  - */
  -public class X
  -   extends Y
  -   implements Z
  -{
  -   // Constants -----------------------------------------------------
  -
  -   // Attributes ----------------------------------------------------
  -
  -   // Static --------------------------------------------------------
  -
  -   // Constructors --------------------------------------------------
  +//EXPLICIT IMPORTS
  +import a.b.C1; // GOOD
  +import a.b.C2;
  +import a.b.C3;
   
  -   // Public --------------------------------------------------------
  +// DO NOT WRITE
  +import a.b.*;  // BAD
   
  -   // Z implementation ----------------------------------------------
  -
  -   // Y overrides ---------------------------------------------------
  -
  -   // Package protected ---------------------------------------------
  +/**
  +*   <description> 
  +*
  +*   @see <related>
  +*   @author  <a href="mailto:{email}";>{full name}</a>.
  +*   @author  <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  +*   @version $Revision: 1.4 $
  +*   
  +*   Revisions:
  +*
  +*   yyyymmdd author: explicit fix description (no line numbers but methods) go 
beyond the cvs commit message
  +*   eg: 
  +*   20010516 marc fleury: Ask all developers to clearly document the Revision, 
changed the header.  
  +* 
  +*/
   
  -   // Protected -----------------------------------------------------
   
  -   // Private -------------------------------------------------------
  +// DO NOT USE "TAB" TO INDENT CODE USE *2* SPACES FOR PORTABILITY AMONG EDITORS
   
  -   // Inner classes -------------------------------------------------
  +public class X
  +extends Y
  +implements Z
  +{
  +  // Constants -----------------------------------------------------
  +  
  +  // Attributes ----------------------------------------------------
  +  
  +  // Static --------------------------------------------------------
  +  
  +  // Constructors --------------------------------------------------
  +  
  +  // Public --------------------------------------------------------
  +  
  +  public void startService() throws Exception
  +  { // Use the newline for the opening bracket so we can match top and bottom 
bracket visually
  +    
  +    Class cls = Class.forName(dataSourceClass);
  +    vendorSource = (XADataSource)cls.newInstance();
  +    
  +    // JUMP A LINE BETWEEN LOGICALLY DISCTINT **STEPS** AND ADD A LINE OF COMMENT 
TO IT
  +    cls = vendorSource.getClass();
  +    
  +    if(properties != null && properties.length() > 0)
  +    {
  +      
  +      try
  +      {
  +      }
  +      catch (IOException ioe)
  +      {
  +      }
  +      for (Iterator i = props.entrySet().iterator(); i.hasNext();)
  +      {
  +        
  +        // Get the name and value for the attributes
  +        Map.Entry entry = (Map.Entry) i.next();
  +        String attributeName = (String) entry.getKey();
  +        String attributeValue = (String) entry.getValue();
  +        
  +        // Print the debug message
  +        log.debug("Setting attribute '" + attributeName + "' to '" +
  +          attributeValue + "'");
  +        
  +        // get the attribute 
  +        Method setAttribute =
  +        cls.getMethod("set" + attributeName,
  +          new Class[] { String.class });
  +        
  +        // And set the value  
  +        setAttribute.invoke(vendorSource,
  +          new Object[] { attributeValue });
  +      }
  +    }
  +    
  +    
  +    // Test database
  +    vendorSource.getXAConnection().close();
  +    
  +    // Bind in JNDI
  +    bind(new InitialContext(), "java:/"+getPoolName(),
  +      new Reference(vendorSource.getClass().getName(),
  +        getClass().getName(), null));
  +    
  +    // We are done
  +    log.log("XA Data source "+getPoolName()+" bound to java:/"+getPoolName());
  +  }
  +  // Z implementation ----------------------------------------------
  +  
  +  // Y overrides ---------------------------------------------------
  +  
  +  // Package protected ---------------------------------------------
  +  
  +  // Protected -----------------------------------------------------
  +  
  +  // Private -------------------------------------------------------
  +  
  +  // Inner classes -------------------------------------------------
   }
  +
  
  
  
  1.3       +36 -17    jboss/src/etc/interface.java
  
  Index: interface.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/etc/interface.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- interface.java    2000/12/12 09:57:19     1.2
  +++ interface.java    2001/06/18 15:36:52     1.3
  @@ -1,24 +1,43 @@
   /*
  - * JBoss, the OpenSource EJB server
  - *
  - * Distributable under LGPL license.
  - * See terms of license at gnu.org.
  - */
  +* JBoss, the OpenSource EJB server
  +*
  +* Distributable under LGPL license.
  +* See terms of license at gnu.org.
  +*/
   package x;
   
  +//EXPLICIT IMPORTS
  +import a.b.C1; // GOOD
  +import a.b.C2;
  +import a.b.C3;
  +
  +// DO NOT WRITE
  +import a.b.*;  // BAD
  +
  +
   /**
  - *   <description>
  - *
  - *   @see <related>
  - *   @author <firstname> <lastname> (<email>)
  - *   @version $Revision: 1.2 $
  - */
  +*   <description>
  +*
  +*   @see <related>
  +*   @author  <a href="mailto:{email}";>{full name}</a>.
  +*   @author  <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  +*   @version $Revision: 1.3 $
  +*   Revisions:
  +*
  +*   yyyymmdd author: explicit fix description (no line numbers but methods) go 
beyond the cvs commit message
  +*   eg: 
  +*   20010516 marc fleury: Ask all developers to clearly document the Revisions, 
changed the header.  
  +*/
   public interface X
  -   extends Y
  +extends Y
   {
  -   // Constants -----------------------------------------------------
  -
  -   // Static --------------------------------------------------------
  -
  -   // Public --------------------------------------------------------
  +  // Constants -----------------------------------------------------
  +  
  +  // Static --------------------------------------------------------
  +  
  +  // Public --------------------------------------------------------
  +  public ReturnClass doSomething()
  +  throws ExceptionA, ExceptionB;
  +  
  +  // DO NOT USE "TAB" USE 2 SPACES FOR PORTABILITY AMONG EDITORS
   }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to