User: slaboure
  Date: 01/08/15 09:45:50

  Added:       src/examples/org/jboss/docs/appletclient/ejb ejb-jar.xml
                        TestAppletBean.java
  Log:
  Simple SLSB implementation for the appletclient example.
  
  Revision  Changes    Path
  1.1                  manual/src/examples/org/jboss/docs/appletclient/ejb/ejb-jar.xml
  
  Index: ejb-jar.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 
1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
  
  <ejb-jar>
    <enterprise-beans>
      <session>
        <ejb-name>TestAppletBean</ejb-name>
        <home>org.jboss.docs.appletclient.interfaces.TestAppletHome</home>
        <remote>org.jboss.docs.appletclient.interfaces.TestApplet</remote>
        <ejb-class>org.jboss.docs.appletclient.ejb.TestAppletBean</ejb-class>
        <session-type>Stateless</session-type>
        <transaction-type>Container</transaction-type>
      </session>
    </enterprise-beans>
    <assembly-descriptor>
      <container-transaction>
        <method>
        <ejb-name>TestAppletBean</ejb-name>
        <method-intf>Remote</method-intf>
        <method-name>*</method-name>
        </method>
        <trans-attribute>Required</trans-attribute>
      </container-transaction>
    </assembly-descriptor>
  </ejb-jar>
  
  
  
  1.1                  
manual/src/examples/org/jboss/docs/appletclient/ejb/TestAppletBean.java
  
  Index: TestAppletBean.java
  ===================================================================
  /*
   * JBoss, the OpenSource J2EE WebOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.docs.appletclient.ejb;
  
  import javax.ejb.SessionBean;
  import javax.ejb.SessionContext;
  
  import org.jboss.docs.appletclient.interfaces.*;
  
  /**
   *   Example bean for testing Applet client
   *
   *   @author Sacha Labourey ([EMAIL PROTECTED])
   *
   *   @version $Revision: 1.1 $
   */
  
  
  public class TestAppletBean implements SessionBean
  {
     private SessionContext sessionContext;
  
     public void ejbCreate() {}
     public void ejbRemove() {}
     public void ejbActivate() {}
     public void ejbPassivate(){}
     public void setSessionContext(SessionContext context)
     {
        sessionContext = context;
     }
     public String getMessage()
     {
        String hostname = "Unknown host";
  
        try
        {
           hostname = java.net.InetAddress.getLocalHost ().getHostName ();
        } catch (java.net.UnknownHostException uhe) { }
  
        String now = java.text.DateFormat.getDateInstance().format (new 
java.util.Date());
  
        System.out.println ("getMessage has been called from Applet!");
  
        return "Hello from " + hostname + ", here it is: " + now + ".";
     }
  }
  
  
  

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

Reply via email to