xdoclet.modules.ejb.env

Class EnvEjbRefTagsHandler


public class EnvEjbRefTagsHandler
extends EnvTagsHandler

Version:
$Revision 1.1 $
Author:
Matthias Germann
xdoclet.taghandler
namespace = "EjbEnvEjbRef"
created
April 5, 2005
To do:
refactor ejbRefId properly to account for ejb:bean - it may not be needed anymore.
refactor storeReferringClassId properly to take ejb:bean into account - may not be needed anymore.

Method Summary

String
componentInterface()
Returns the component interface for the current ejb reference
protected void
doGenerate(String template)
String
ejbRefId()
Returns unique id for the specified ejb-ref.
String
ejbRefJndiName()
Returns the global JNDI name for the current EJB ref.
protected XClass
findEjb(String ejbName)
Finds and returns the class with the specified ejbName.
void
forAllEjbRefMembers(String template, Properties attributes)
Evaluates the body block for each method- and field-level ejb reference.
void
forAllEjbRefMethods(String template, Properties attributes)
Evaluates the body block for each method-level ejb reference.
void
forAllEjbRefs(String template, Properties attributes)
Evaluates the body block for each ejb reference.
String
homeInterface()
Returns the home interface for the current ejb reference
void
ifLocalEjbRef(String template)
Generates code if the ejb-ref is local
void
ifRemoteEjbRef(String template)
Generates code if the ejb-ref is local
protected boolean
isLocalEjbRef(XTag ejbRefTag)
Return true if the ejb-ref is local
protected boolean
isRemoteEjbRef(XTag ejbRefTag)
Return true if the ejb-ref is remote
String
name(Properties attributes)
protected void
storeReferringClassId()
Stores the id of current EJB for further use by other tags in referringClassId attribute.

Method Details

componentInterface

public String componentInterface()
            throws xdoclet.XDocletException
Returns the component interface for the current ejb reference
Returns:
the fully qualified class name
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "content"

doGenerate

protected void doGenerate(String template)
            throws xdoclet.XDocletException

ejbRefId

public String ejbRefId()
            throws xdoclet.XDocletException
Returns unique id for the specified ejb-ref. It prefixes it with the referring class's id, then a _ and the id of the ejb object.
Returns:
Description of the Returned Value
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"
To do:
refactor this properly to account for ejb:bean - it may not be needed anymore.

ejbRefJndiName

public String ejbRefJndiName()
            throws xdoclet.XDocletException
Returns the global JNDI name for the current EJB ref.
Returns:
The JNDI name of current EJB ref.
Throws:
xdoclet.XDocletException -
doc.tag
type = "content"

findEjb

protected XClass findEjb(String ejbName)
            throws xdoclet.XDocletException
Finds and returns the class with the specified ejbName. An XDocletException is thrown if not found.
Parameters:
ejbName - Description of Parameter
Returns:
Description of the Returned Value
Throws:
xdoclet.XDocletException -

forAllEjbRefMembers

public void forAllEjbRefMembers(String template,
                                Properties attributes)
            throws xdoclet.XDocletException
Evaluates the body block for each method- and field-level ejb reference.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"
doc.param
name = "tagName" description = "the ejb-ref tag" default = "ejb.ejb-ref"

forAllEjbRefMethods

public void forAllEjbRefMethods(String template,
                                Properties attributes)
            throws xdoclet.XDocletException
Evaluates the body block for each method-level ejb reference.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"
doc.param
name = "tagName" description = "the ejb-ref tag" default = "ejb.ejb-ref"

forAllEjbRefs

public void forAllEjbRefs(String template,
                          Properties attributes)
            throws xdoclet.XDocletException
Evaluates the body block for each ejb reference.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"
doc.param
name = "tagName" description = "the ejb-ref tag" default = "ejb.ejb-ref"

homeInterface

public String homeInterface()
            throws xdoclet.XDocletException
Returns the home interface for the current ejb reference
Returns:
the fully qualified class name
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "content"

ifLocalEjbRef

public void ifLocalEjbRef(String template)
            throws xdoclet.XDocletException
Generates code if the ejb-ref is local
Parameters:
template -
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

ifRemoteEjbRef

public void ifRemoteEjbRef(String template)
            throws xdoclet.XDocletException
Generates code if the ejb-ref is local
Parameters:
template -
Throws:
xdoclet.XDocletException -
doc.tag
type = "block"

isLocalEjbRef

protected boolean isLocalEjbRef(XTag ejbRefTag)
            throws xdoclet.XDocletException
Return true if the ejb-ref is local
Parameters:
ejbRefTag -
Returns:
true if the ejb-ref is local otherwise false
Throws:
xdoclet.XDocletException -

isRemoteEjbRef

protected boolean isRemoteEjbRef(XTag ejbRefTag)
            throws xdoclet.XDocletException
Return true if the ejb-ref is remote
Parameters:
ejbRefTag -
Returns:
true if the ejb-ref is remote otherwise false
Throws:
xdoclet.XDocletException -

name

public String name(Properties attributes)
            throws xdoclet.XDocletException

storeReferringClassId

protected void storeReferringClassId()
            throws xdoclet.XDocletException
Stores the id of current EJB for further use by other tags in referringClassId attribute.
Throws:
xdoclet.XDocletException -
To do:
refactor this properly to take ejb:bean into account - may not be needed anymore.