WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

examples.xml.xslt
Class ContentBean

java.lang.Object
  |
  +--examples.xml.xslt.ContentBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean

public class ContentBean
extends java.lang.Object
implements javax.ejb.SessionBean

This stateless Session Bean generates XML content that is later displayed to various client types. Since the point of this example is to demonstrate the separation of content generation and presentation, this EJB generates static content.

Author:
Copyright (c) 2002 by BEA Systems, Inc. All Rights Reserved.

Constructor Summary
ContentBean()
           
 
Method Summary
 void ejbActivate()
          This method is required by the EJB Specification, but is not used by this example.
 void ejbCreate()
          This method corresponds to the create method in the home interface ContentHome.
 void ejbPassivate()
          This method is required by the EJB Specification, but is not used by this example.
 void ejbRemove()
          This method is required by the EJB Specification, but is not used by this example.
 java.lang.String generateContent()
          Generates XML content to be displayed to various client types.
 void setSessionContext(javax.ejb.SessionContext ctx)
          Sets the session context.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentBean

public ContentBean()
Method Detail

ejbActivate

public void ejbActivate()
This method is required by the EJB Specification, but is not used by this example.
Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
This method corresponds to the create method in the home interface ContentHome. The parameter sets of the two methods are identical. When the client calls ContentHome.create, the container allocates an instance of the EJBean and calls ejbCreate.
Throws:
javax.ejb.CreateException - if there is a communications or systems failure
See Also:
ContentHome

ejbPassivate

public void ejbPassivate()
This method is required by the EJB Specification, but is not used by this example.
Specified by:
ejbPassivate in interface javax.ejb.SessionBean

ejbRemove

public void ejbRemove()
This method is required by the EJB Specification, but is not used by this example.
Specified by:
ejbRemove in interface javax.ejb.SessionBean

generateContent

public java.lang.String generateContent()
Generates XML content to be displayed to various client types.
Returns:
String content in the form of XML
Throws:
RemoteException - if there is a communications or systems failure

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
Sets the session context.
Specified by:
setSessionContext in interface javax.ejb.SessionBean
Parameters:
ctx - SessionContext Context for session

Documentation is available at
http://e-docs.bea.com/wls/docs70

Copyright © 2002 BEA Systems, Inc. All Rights Reserved.