attrib4j.examples
Class TransactionExample

java.lang.Object
  |
  +--attrib4j.examples.TransactionExample

public class TransactionExample
extends java.lang.Object

A simple example class that demonstrates the use of custom attributes. The idea is to associate EJB like transaction attributes to a method, much like would be described in the deployment descriptor.

Author:
Mark Pollack

Constructor Summary
TransactionExample()
          Create an instance.
 
Method Summary
 void doDatabaseWork(java.util.Vector inputData)
           
 void extractAttributes()
          Show how attributes can be extracted at runtime.
static void main(java.lang.String[] args)
          Run the example program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionExample

public TransactionExample()
Create an instance.

Method Detail

doDatabaseWork

public void doDatabaseWork(java.util.Vector inputData)
Parameters:
inputData - represents information to use in a transaction.

extractAttributes

public void extractAttributes()
                       throws java.lang.NoSuchMethodException
Show how attributes can be extracted at runtime.

Throws:
java.lang.NoSuchMethodException - if cannot find declared method on class.

main

public static void main(java.lang.String[] args)
Run the example program. It will execute a method that has been decorated with an attribute, just to show that the functionality has not been altered. Then it will extract the attributes from the class.

Parameters:
args - The command line arguments, not used.


Copyright © 2002-2003 Mark Pollack. All Rights Reserved.