Hi JMS,

I do know what you mean clearly. I attach my Java FiboBean.java as the following. By 
this with XDoclet generation, Fibo.java and FiboHome.java were made automatically.

/*
 * Created on 2004/4/10
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package tutorial.ejb;

import java.rmi.RemoteException;

import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;

/**
 * @author cs_cwt
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 * 
 * @ejb.bean name = "Fibo"
 *           display-name = "Fibo EJB"
 *           description = "EJB that computes Fibonacci suite"
 *           view-type = "remote"
 *           jndi-name = "ejb/tutorial/Fibo"
 */
public class FiboBean implements SessionBean {

        /**
         * 
         */
        public FiboBean() {
                super();
                // TODO Auto-generated constructor stub
        }

        /**
         * @author Teki Chan
         * @name ejbCreate
         * 
         * This method is without parameter as this EJB is stateless
         * 
         * @throws CreateException
         * @ejb.create-method
         */
        public void ejbCreate() 
                throws CreateException {
        }

        /* (non-Javadoc)
         * @see javax.ejb.SessionBean#ejbActivate()
         */
        public void ejbActivate() throws EJBException, RemoteException {
                // TODO Auto-generated method stub

        }

        /* (non-Javadoc)
         * @see javax.ejb.SessionBean#ejbPassivate()
         */
        public void ejbPassivate() throws EJBException, RemoteException {
                // TODO Auto-generated method stub

        }

        /* (non-Javadoc)
         * @see javax.ejb.SessionBean#ejbRemove()
         */
        public void ejbRemove() throws EJBException, RemoteException {
                // TODO Auto-generated method stub

        }

        /* (non-Javadoc)
         * @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
         */
        public void setSessionContext(SessionContext arg0)
                throws EJBException, RemoteException {
                // TODO Auto-generated method stub

        }
        
        /**
         * @author Teki Chan
         * @name compute
         * @param number
         * @return double[]
         * @ejb.interface-method view-type = "remote"
         * 
         * The business method of computing a Fibonacci suite
         */
        public double[] compute(int number) {
                if (number < 0) {
                        throw new EJBException("Argument should be positive");
                }
                
                double[] suite = new double[number+1];
                suite[0] = 0;
                if (number == 0) {
                        return suite;
                }
                
                suite[1] = 1;
                for(int i=2; i<=number; i++) {
                        suite = suite[i-1] + suite[i-2];
                }
                
                return suite;
        }
}

while ejb-jar.xml is 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" 
"http://java.sun.com/dtd/ejb-jar_2_0.dtd";>

<ejb-jar >

   <![CDATA[No Description.]]>
   <display-name>Generated by XDoclet</display-name>

   <enterprise-beans>

      <!-- Session Beans -->
      
         <![CDATA[EJB that computes Fibonacci suite]]>
         <display-name>Fibo EJB</display-name>

         <ejb-name>Fibo</ejb-name>

         tutorial.interfaces.FiboHome
         tutorial.interfaces.Fibo
         <ejb-class>tutorial.ejb.FiboBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>

      

     <!--
       To add session beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called session-beans.xml that contains
       the  markup for those beans.
     -->

      <!-- Entity Beans -->
     <!--
       To add entity beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called entity-beans.xml that contains
       the  markup for those beans.
     -->

      <!-- Message Driven Beans -->
     <!--
       To add message driven beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called message-driven-beans.xml that 
contains
       the <message-driven></message-driven> markup for those beans.
     -->

   </enterprise-beans>

   <!-- Relationships -->

   <!-- Assembly Descriptor -->
   <assembly-descriptor >
     <!--
       To add additional assembly descriptor info here, add a file to your
       XDoclet merge directory called assembly-descriptor.xml that contains
       the <assembly-descriptor></assembly-descriptor> markup.
     -->

   <!-- finder permissions -->

   <!-- transactions -->

   <!-- finder transactions -->
   </assembly-descriptor>

</ejb-jar>

Please help. Thanks.

-stan


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3830157#3830157

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3830157


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to