au.gov.tas.dpiwe.mr.bean
Class DebugBean

java.lang.Object
  extended by au.gov.tas.dpiwe.mr.bean.NullBean
      extended by au.gov.tas.dpiwe.mr.bean.DebugBean
All Implemented Interfaces:
SimpleValidator, WrappedBean, ContainerChangeListener, Serializable, EventListener, EnterpriseBean, EntityBean
Direct Known Subclasses:
ExampleBean

public abstract class DebugBean
extends NullBean

All the methods herein (except containerChanged(), getBeanObject(), throwEJBException() and simpleValidate()) must be provided to implement an entity bean.

Debugging implementations are provided by this class- they write to standard output on a client, or call logOnServer() in a server context.

Since:
Mr Architecture 2.0
Version:
1.0.0.0
Author:
Kade Hansson
See Also:
Serialized Form

Field Summary
protected  Container container
          The container associated with this bean.
protected  EntityContext context
          The entity context associated with this bean.
protected  Class type
          The type of this bean.
protected  BeanWrapper wrapper
          For a cloned bean, contains a reference to the bean wrapper.
 
Constructor Summary
DebugBean()
          All entity beans must provide a public no-argument constructor.
 
Method Summary
 Object clone()
          Produces a shallow copy of this bean.
 void containerChanged(ContainerChangeEvent event)
          Event handler called when the ownership of this bean has changed from ClientContainer to ServerContainer or vice versa.
 void ejbActivate()
          Callback issued upon resurrecting a serialized bean.
 void ejbLoad()
          Callback issued prior to refreshing a bean with its persistent storage.
 void ejbPassivate()
          Callback issued prior to serializing a bean.
 void ejbRemove()
          Callback issued prior to removing a bean from persistent storage.
 void ejbStore()
          Callback issued prior to committing a bean to persistent storage.
 BeanWrapper getBeanObject()
          Internal method to determine the bean wrapper associated with this entity bean.
 void setEntityContext(EntityContext context)
          Callback issued when a bean is placed in a container.
 void simpleValidate()
          Makes simple data validity checks for this bean based on the MetaData associated with the home.
 void unsetEntityContext()
          Callback issued when a bean is removed from a container.
 
Methods inherited from class au.gov.tas.dpiwe.mr.bean.NullBean
throwEJBException
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected transient EntityContext context
The entity context associated with this bean. The entity context provides access to the bean's environment.


container

protected transient Container container
The container associated with this bean. Use of this field by beans may impair their operation with containers other than the Mr Architecture Container.


wrapper

protected transient BeanWrapper wrapper
For a cloned bean, contains a reference to the bean wrapper.


type

protected Class type
The type of this bean.

Constructor Detail

DebugBean

public DebugBean()
All entity beans must provide a public no-argument constructor.

Method Detail

ejbActivate

public void ejbActivate()
                 throws RemoteException
Callback issued upon resurrecting a serialized bean.

Specified by:
ejbActivate in interface EntityBean
Overrides:
ejbActivate in class NullBean
Throws:
RemoteException - never.

ejbPassivate

public void ejbPassivate()
                  throws RemoteException
Callback issued prior to serializing a bean.

Specified by:
ejbPassivate in interface EntityBean
Overrides:
ejbPassivate in class NullBean
Throws:
RemoteException - never.

ejbLoad

public void ejbLoad()
Callback issued prior to refreshing a bean with its persistent storage.

Specified by:
ejbLoad in interface EntityBean
Overrides:
ejbLoad in class NullBean

ejbStore

public void ejbStore()
Callback issued prior to committing a bean to persistent storage.

Specified by:
ejbStore in interface EntityBean
Overrides:
ejbStore in class NullBean

ejbRemove

public void ejbRemove()
Callback issued prior to removing a bean from persistent storage.

Specified by:
ejbRemove in interface EntityBean
Overrides:
ejbRemove in class NullBean

setEntityContext

public void setEntityContext(EntityContext context)
Callback issued when a bean is placed in a container.

Specified by:
setEntityContext in interface EntityBean
Overrides:
setEntityContext in class NullBean
Parameters:
context - provides access to the bean's environment.

unsetEntityContext

public void unsetEntityContext()
Callback issued when a bean is removed from a container.

Specified by:
unsetEntityContext in interface EntityBean
Overrides:
unsetEntityContext in class NullBean

containerChanged

public void containerChanged(ContainerChangeEvent event)
Event handler called when the ownership of this bean has changed from ClientContainer to ServerContainer or vice versa.

Specified by:
containerChanged in interface ContainerChangeListener
Overrides:
containerChanged in class NullBean
Parameters:
event - the event which describes the new container.

getBeanObject

public BeanWrapper getBeanObject()
Internal method to determine the bean wrapper associated with this entity bean.

Specified by:
getBeanObject in interface WrappedBean
Overrides:
getBeanObject in class NullBean
Returns:
the bean wrapper, if this bean was originally cloned and has such a wrapper, otherwise null.

simpleValidate

public void simpleValidate()
                    throws ValidateException
Makes simple data validity checks for this bean based on the MetaData associated with the home.

Specified by:
simpleValidate in interface SimpleValidator
Overrides:
simpleValidate in class NullBean
Throws:
ValidateException - if the data in this bean is invalid under these checks.

clone

public Object clone()
             throws CloneNotSupportedException
Produces a shallow copy of this bean.

Overrides:
clone in class NullBean
Returns:
a shallow copy of this bean.
Throws:
CloneNotSupportedException - if this bean does not allow itself to be cloned.