SPT Core API

com.sptci.echo2
Class NonTransactionalJDOApplication

java.lang.Object
  extended by nextapp.echo2.app.ApplicationInstance
      extended by com.sptci.echo2.Application
          extended by com.sptci.echo2.NonTransactionalJDOApplication
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JDOApplication

public class NonTransactionalJDOApplication
extends Application

An application class that maintains a JDO PersistenceManager for the lifecycle of the session. This class does not provide any built in Transaction management. Use this class if you want precise control over the Transaction boundary. Use the JDOApplication subclass if you wish to avoid the semantics of Transaction boundaries.

Copyright 2007 Sans Pareil Technologies, Inc.

Version:
$Id: NonTransactionalJDOApplication.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Rakesh Vidyadharan 2007-06-03
See Also:
Serialized Form

Field Summary
protected  javax.jdo.PersistenceManager persistenceManager
          The persistence manager instance that is to be used for the current session.
 
Fields inherited from class com.sptci.echo2.Application
contentPane, dataDirectory, logger, MINIMUM_INTERVAL, pollingInterval, principal, properties, TIME_ZONES, timeZone, user, window
 
Fields inherited from class nextapp.echo2.app.ApplicationInstance
FOCUSED_COMPONENT_CHANGED_PROPERTY, ID_STRING, LOCALE_CHANGED_PROPERTY, MODAL_COMPONENTS_CHANGED_PROPERTY, WINDOWS_CHANGED_PROPERTY
 
Constructor Summary
NonTransactionalJDOApplication()
          Default constructor.
 
Method Summary
 void activate()
          Over-ridden to open a persistence manager if necessary.
protected  void closePersistenceManager()
          Close persistenceManager when it is no longer necessary.
 void dispose()
          Invoked when the application is disposed and will not be used again.
static NonTransactionalJDOApplication getApplication()
          Convenience method to return the active application as a properly typed object.
 javax.jdo.PersistenceManager getPersistenceManager()
          Returns persistenceManager.
protected  void openPersistenceManager()
          Initialiase persistenceManager if necessary.
 void passivate()
          Over-ridden to close the persistenceManager if necessary.
 
Methods inherited from class com.sptci.echo2.Application
addPane, addTask, getContentPane, getDataDirectory, getLocales, getLogger, getOffset, getParentView, getPrincipal, getProperty, getTimeZone, getUser, getWindow, getZIndex, hasQueuedTasks, init, processFatalException, processFatalException, removePane, removeTask, setContentPane, setDataDirectory, setPrincipal, setProperty, setUser, updatePollingInterval
 
Methods inherited from class nextapp.echo2.app.ApplicationInstance
activated, addPropertyChangeListener, createTaskQueue, deactivating, doInit, doValidation, enqueueCommand, enqueueTask, firePropertyChange, generateId, generateSystemId, getActive, getComponentByRenderId, getContextProperty, getDefaultWindow, getFocusedComponent, getLayoutDirection, getLocale, getModalContextRoot, getStyle, getStyleSheet, getUpdateManager, hasTaskQueues, processInput, processQueuedTasks, removePropertyChangeListener, removeTaskQueue, setActive, setContextProperty, setFocusedComponent, setLocale, setStyleSheet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

persistenceManager

protected transient javax.jdo.PersistenceManager persistenceManager
The persistence manager instance that is to be used for the current session.

Constructor Detail

NonTransactionalJDOApplication

public NonTransactionalJDOApplication()
                               throws javax.jdo.JDOException
Default constructor. Initialises persistenceManager.

Throws:
javax.jdo.JDOException - If errors are encountered while initialising persistenceManager.
Method Detail

getApplication

public static NonTransactionalJDOApplication getApplication()
Convenience method to return the active application as a properly typed object.

Returns:
The currently active Application instance.

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager()
Returns persistenceManager.

Returns:
PersistenceManager The value/reference of/to persistenceManager.

activate

public void activate()
Over-ridden to open a persistence manager if necessary.

Overrides:
activate in class ApplicationInstance

passivate

public void passivate()
Over-ridden to close the persistenceManager if necessary.

Overrides:
passivate in class ApplicationInstance
See Also:
closePersistenceManager()

dispose

public void dispose()
Invoked when the application is disposed and will not be used again. Closes persistenceManager.

Overrides:
dispose in class ApplicationInstance
See Also:
ApplicationInstance.dispose()

openPersistenceManager

protected void openPersistenceManager()
Initialiase persistenceManager if necessary.


closePersistenceManager

protected void closePersistenceManager()
Close persistenceManager when it is no longer necessary. This is usually called when the instance is being dispose()d or passivate()ed.


SPT Core API