Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.solarmetric.kodo.ee
Class JDOBean

    java.lang.Object
      |
      +--com.solarmetric.kodo.ee.JDOBean

All Implemented Interfaces:
  javax.ejb.EnterpriseBean, Serializable

Direct Known Subclasses:
  JDOEntityBean, JDOSessionBean

public abstract class JDOBean
extends Object
implements javax.ejb.EnterpriseBean

Base JDO-aware EnterpriseBean class. Its behaviour is discussed in chapter 16 of the JDO 1.0 specification.

See Also:
  `JDOEntityBean`, `JDOSessionBean`, Serialized Form

Field Summary
`static String` | `CM_JNDI_SUFFIX`

Constructor Summary
`JDOBean()`

Method Summary
`void` | `bindConnectionFactory(String name, javax.resource.cci.ConnectionFactory cm, Context context)`
`javax.ejb.EJBException` | `ejbException(Exception e)` Since JDO Exceptions' throwable list is transient, and since some application servers don't send the entire exception back to the client, it is very useful for debugging if the client can have the entire exception message.
`void` | `ejbLog(String msg)`
`abstract void` | `ejbLog(String msg, Throwable t, PrintWriter writer)` Allows the implementor to log messages.
`Object` | `getById(Object id)`
`javax.resource.cci.ConnectionFactory` | `getConnectionFactory()` Obtain a ConnectionFactory.
`javax.resource.cci.ConnectionFactory` | `getConnectionFactory(String jndi)`
`Context` | `getContext()` Return a lazily cached Context.
`String` | `getJNDIName()` Returns the name that we should check in JNDI for the bound ConnectionFactory.
`PersistenceManager` | `getPersistenceManager()` Obtain a PersistenceManagerFactory from JNDI.
`Object` | `lookup(String name, Class narrow)` Utility method to lookup and narrow a name in JNDI.
`javax.resource.cci.ConnectionFactory` | `lookupConnectionFactory(Context ctx)`
`void` | `setConnectionFactory()`
`void` | `setLogWriter(PrintWriter writer)` Set the PrintWriter for debug messages.
`void` | `setPropertiesResource(String propertiesResource)` In a typical EJB application, the ConnectionFactory will be already bound externally (using its resource adaptor, a startup class, or an MBean).
`void` | `unsetConnectionFactory()`

Methods inherited from class java.lang.Object
`, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### CM_JNDI_SUFFIX

    public static final String CM_JNDI_SUFFIX

Constructor Detail

### JDOBean

    public JDOBean()

Method Detail

### setConnectionFactory

    public void setConnectionFactory()
                              throws NamingException

### unsetConnectionFactory

    public void unsetConnectionFactory()

### getConnectionFactory

    public javax.resource.cci.ConnectionFactory getConnectionFactory()
                                                              throws JDOException,
                                                                     javax.ejb.EJBException,
                                                                     NamingException

  Obtain a ConnectionFactory. This method can be overridden if the default lookup of "java:comp/env/jdo/PersistenceManagerFactory" should not be used. See section 16.1 of the JDO specification.
  Throws:
    `NamingException` - Whan a JNDI exception occures
    `javax.ejb.EJBException` - For an EJB-related exception
    `JDOException` - For a JDO-related exception

### getJNDIName

    public String getJNDIName()

  Returns the name that we should check in JNDI for the bound ConnectionFactory.

### setPropertiesResource

    public void setPropertiesResource(String propertiesResource)

  In a typical EJB application, the ConnectionFactory will be already bound externally (using its resource adaptor, a startup class, or an MBean). However, for rapid application development, it is often useful to just have the bean manually bind the PMF into JNDI if it does not find it so that JDO debugging does not need to be complicated by EJB container debugging. This method sets the properties resource that will be looked up in order to create a new PMF and bind it into JNDI.

### setLogWriter

    public void setLogWriter(PrintWriter writer)

  Set the PrintWriter for debug messages.
  Parameters:
    `writer` - The PrintWriter to use for logging debugging messages

### getContext

    public Context getContext()
                       throws NamingException

  Return a lazily cached Context.

### getConnectionFactory

    public javax.resource.cci.ConnectionFactory getConnectionFactory(String jndi)
                                                              throws JDOException,
                                                                     javax.ejb.EJBException,
                                                                     NamingException

### lookupConnectionFactory

    public javax.resource.cci.ConnectionFactory lookupConnectionFactory(Context ctx)
                                                                 throws NamingException

### bindConnectionFactory

    public void bindConnectionFactory(String name,
                                      javax.resource.cci.ConnectionFactory cm,
                                      Context context)
                               throws NamingException

### getPersistenceManager

    public PersistenceManager getPersistenceManager()
                                             throws javax.ejb.EJBException

  Obtain a PersistenceManagerFactory from JNDI. Per the JDO specification, the PersistenceManagerFactory will be synchronized with the container's global transaction, such that in the context of a single transaction the same PersistenceManager will always be returned by the `PersistenceManagerFactory.getPersistenceManager()` method.

### getById

    public Object getById(Object id)
                   throws javax.ejb.EJBException,
                          JDOException

### lookup

    public Object lookup(String name,
                         Class narrow)
                  throws javax.ejb.EJBException

  Utility method to lookup and narrow a name in JNDI.
  Parameters:
    `name` - the name to look up
    `narrow` - the class to narrow the reference to
  Throws:
    `javax.ejb.EJBException` - Wraps a NamingException.

### ejbException

    public javax.ejb.EJBException ejbException(Exception e)

  Since JDO Exceptions' throwable list is transient, and since some application servers don't send the entire exception back to the client, it is very useful for debugging if the client can have the entire exception message. This, we will embed the entire nested stack trace in the message of a new EJB Exception.

### ejbLog

    public void ejbLog(String msg)

### ejbLog

    public abstract void ejbLog(String msg,
                                Throwable t,
                                PrintWriter writer)

  Allows the implementor to log messages.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.