3 Replies Latest reply on Oct 28, 2004 11:18 AM by cartola

    Exposing remote methods

    cartola

      Hello
      I have just started working with jboss-net.
      I'm sending this email to ask if there is a way to publish a view-type="remote" method
      using jboss-net.
      My code:

      package teste;
      import java.rmi.RemoteException;
      
      import javax.ejb.CreateException;
      import javax.ejb.EJBException;
      import javax.ejb.SessionBean;
      import javax.ejb.SessionContext;
      /**
       * @ejb.bean name="Add"
       * jndi-name="AddBean"
       * type="Stateless"
       *
       *
       * @jboss-net.web-service urn="Adder"
       *
       * */
      public class AddBean implements SessionBean {
       /**
       * @ejb.interface-method view-type="remote"
       * @jboss-net.web-method
       *
       * @param x
       * @param y
       * @return
       **/
       public int makeAdd (int x,int y){return x+y;}
      
       public void ejbCreate() throws CreateException {}
      
       public void setSessionContext( SessionContext sessionContext ) {
       System.out.println("ejbSet") ;
       }
       public void ejbActivate() throws EJBException, RemoteException {
       System.out.println("ejbActivate") ;
       }
       public void ejbPassivate() throws EJBException, RemoteException {
       System.out.println("ejbPassive") ;
       }
       public void ejbRemove() throws EJBException, RemoteException {
       System.out.println("ejbRemove") ;
       }
      
      }


      Thanks a lot for your time


      Pedro Reis