org.apache.geronimo.ews.ws4j2ee.toWs.ejb
Class SessionBeanWriter

java.lang.Object
  extended byorg.apache.geronimo.ews.ws4j2ee.toWs.AbstractWriter
      extended byorg.apache.geronimo.ews.ws4j2ee.toWs.JavaClassWriter
          extended byorg.apache.geronimo.ews.ws4j2ee.toWs.ejb.SessionBeanWriter
All Implemented Interfaces:
Writer

public class SessionBeanWriter
extends JavaClassWriter

This class can be used to write the appropriate SessionBean class for the given port type. A Stateless Session Bean, as defined by the Enterprise JavaBeans specification, can be used to implement a Web service to be deployed in the EJB container. A Stateless Session Bean does not have to worry about multi-threaded access. The EJB container is required to serialize request flow through any particular instance of a Service Implementation Bean. The requirements for creating a Service Implementation Bean as a Stateless Session EJB are repeated in part here.

  1. The Service Implementation Bean must have a default public constructor.
  2. The Service Implementation Bean may implement the Service Endpoint Interface, but it is not required to do so. The bean must implement all the method signatures of the SEI.
  3. The Service Implementation Bean methods are not required to throw javax.rmi.RemoteException. The business methods of the bean must be public and must not be final or static. It may implement other methods in addition to those defined by the SEI.
  4. A Service Implementation Bean must be a stateless object. A Service Implementation Bean must not save client specific state across method calls either within the bean instance?s data members or external to the instance.
  5. The class must be public, must not be final and must not be abstract.
  6. The class must not define the finalize() method.
  7. Currently, it must implement the ejbCreate() and ejbRemove() methods which take no arguments. This is a requirement of the EJB container, but generally can be stubbed out with an empty implementation.
  8. Currently, a Stateless Session Bean must implement the javax.ejb.SessionBean interface either directly or indirectly. This interface allows the container to notify the Service Implementation Bean of impending changes in its state. The full requirements of this interface are defined in the Enterprise JavaBeans specification section 7.5.1.
  9. The Enterprise JavaBeans specification section 7.8.2 defines the allowed container service access requirements.
Exposing an existing EJB

An existing Enterprise JavaBean may be used as a Service Implementation Bean if it meets the following requirements:

  1. The business methods of the EJB bean class that are exposed on the SEI must meet the Service
  2. Implementation Bean requirements defined in section 5.3.1.
  3. The SEI must meet the requirements described in the JAX-RPC specification for Service Endpoint Interfaces.
  4. The transaction attributes of the SEI methods must not include Mandatory.
  5. The developer must package the Web service as described in section 5.4 and must specify an ejb-link from the port in the Web services deployment descriptor to the existing EJB.
    1. Author:
      Rajith Priyanga, Srinath Perera

      Field Summary
      protected  EJBContext ejbcontext
                 
       
      Fields inherited from class org.apache.geronimo.ews.ws4j2ee.toWs.JavaClassWriter
      classname, packageName, qulifiedName
       
      Fields inherited from class org.apache.geronimo.ews.ws4j2ee.toWs.AbstractWriter
      j2eewscontext, log, out
       
      Constructor Summary
      SessionBeanWriter(J2EEWebServiceContext context, EJBContext ejbcontext)
                Constructs a SessionBeanWriter.
       
      Method Summary
      protected  java.lang.String getimplementsPart()
                 
      protected  boolean isOverWrite()
                 
      protected  void writeAttributes()
                 
      protected  void writeConstructors()
                 
      protected  void writeMethods()
                 
       
      Methods inherited from class org.apache.geronimo.ews.ws4j2ee.toWs.JavaClassWriter
      getExtendsPart, writeClassComment, writeCode, writeImportStatements
       
      Methods inherited from class org.apache.geronimo.ews.ws4j2ee.toWs.AbstractWriter
      cleanUp, prepare, write
       
      Methods inherited from class java.lang.Object
      clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
       

      Field Detail

      ejbcontext

      protected EJBContext ejbcontext
      Constructor Detail

      SessionBeanWriter

      public SessionBeanWriter(J2EEWebServiceContext context,
                               EJBContext ejbcontext)
                        throws GenerationFault
      Constructs a SessionBeanWriter.

      Throws:
      GenerationFault
      Method Detail

      writeAttributes

      protected void writeAttributes()
                              throws GenerationFault
      Specified by:
      writeAttributes in class JavaClassWriter
      Throws:
      GenerationFault

      writeConstructors

      protected void writeConstructors()
                                throws GenerationFault
      Specified by:
      writeConstructors in class JavaClassWriter
      Throws:
      GenerationFault

      writeMethods

      protected void writeMethods()
                           throws GenerationFault
      Specified by:
      writeMethods in class JavaClassWriter
      Throws:
      GenerationFault

      getimplementsPart

      protected java.lang.String getimplementsPart()
      Overrides:
      getimplementsPart in class JavaClassWriter

      isOverWrite

      protected boolean isOverWrite()
      Overrides:
      isOverWrite in class AbstractWriter


      Copyright © 2003-2005 Apache Software Foundation. All Rights Reserved.