Methods Summary |
---|
private void | cleanUpResources(java.lang.String name)Removes all entries that correspond to the same connection factory name.
synchronized(pmf_listSyncObject) {
for (Iterator it = pmf_list.iterator(); it.hasNext(); ) {
PersistenceManagerFactory pmf = (PersistenceManagerFactory)it.next();
if (pmf.getConnectionFactoryName().equals(name)) {
it.remove();
}
}
}
|
public void | connectorNamingEventPerformed(com.sun.enterprise.connectors.ConnectorNamingEvent event)
if(event.getEventType() == ConnectorNamingEvent.EVENT_OBJECT_REBIND){
String dsName = ResourceInstaller.getPMJndiName(event.getJndiName());
cleanUpResources(dsName);
} // Ignore all other events.
|
public java.lang.String | getDDLNamePrefix(java.lang.Object info)Returns name prefix for DDL files extracted from the info instance by the
application server specific code.
SunTransactionHelper specific code. Delegates the actual implementation
to DeploymentHelper#getDDLNamePrefix(Object);
return DeploymentHelper.getDDLNamePrefix(info);
|
public javax.transaction.TransactionManager | getLocalTransactionManager()SunTransactionHelper specific code
try {
return TransactionManagerFinder.appserverTM;
} catch (ExceptionInInitializerError err) {
throw new JDOFatalInternalException(err.getMessage());
}
|
public java.sql.Connection | getNonTransactionalConnection(java.lang.Object resource, java.lang.String username, java.lang.String password)Called in a managed environment to get a Connection from the application
server specific resource. In a non-managed environment returns null as
it should not be called.
SunTransactionHelper specific code uses com.sun.appserv.jdbc.DataSource
to get a Connection.
java.sql.Connection rc = null;
// resource is expected to be com.sun.appserv.jdbc.DataSource
if (resource instanceof DataSource) {
DataSource ds = (DataSource)resource;
if (username == null) {
rc = ds.getNonTxConnection();
} else {
rc = ds.getNonTxConnection(username, password);
}
} else {
throw new JDOFatalInternalException(I18NHelper.getMessage(
messages, "ejb.SunTransactionHelper.wrongdatasourcetype", //NOI18N
resource.getClass().getName()));
}
return rc;
|
public javax.transaction.Transaction | getTransaction()SunTransactionHelper specific code
try {
tm = (TransactionManager) (new InitialContext()).lookup(PM_TM_NAME);
appserverTM = (TransactionManager) (new InitialContext()).lookup(AS_TM_NAME);
} catch (Exception e) {
throw new JDOFatalInternalException(e.getMessage());
}
try{
return TransactionManagerFinder.tm.getTransaction();
} catch (Exception e) {
throw new JDOFatalInternalException(e.getMessage());
} catch (ExceptionInInitializerError err) {
throw new JDOFatalInternalException(err.getMessage());
}
|
public javax.transaction.UserTransaction | getUserTransaction()SunTransactionHelper specific code
try {
InitialContext ctx =
(InitialContext) Class.forName("javax.naming.InitialContext").newInstance(); //NOI18N
return (UserTransaction)ctx.lookup("java:comp/UserTransaction"); //NOI18N
} catch (Exception e) {
throw new JDOFatalInternalException(e.getMessage());
}
|
public void | handleApplicationEvent(com.sun.enterprise.server.event.ApplicationEvent event)
// Change to switch-case if handling more than one events.
if(ApplicationEvent.AFTER_APPLICATION_UNLOAD == event.getEventType() ) {
ClassLoader classLoader = event.getClassLoader();
for (Iterator iterator = applicationLifeCycleEventListeners.iterator();
iterator.hasNext();) {
ApplicationLifeCycleEventListener applicationLifeCycleEventListener =
(ApplicationLifeCycleEventListener) iterator.next();
applicationLifeCycleEventListener.notifyApplicationUnloaded(classLoader);
}
}
|
public void | handleEjbContainerEvent(com.sun.enterprise.server.event.EjbContainerEvent event)
//Ignore EjbContainerEvents
|
public void | registerApplicationLifeCycleEventListener(ApplicationLifeCycleEventListener listener)
synchronized(applicationLifeCycleEventListeners) {
applicationLifeCycleEventListeners.add(listener);
}
|
public com.sun.jdo.api.persistence.support.PersistenceManagerFactory | replaceInternalPersistenceManagerFactory(com.sun.jdo.api.persistence.support.PersistenceManagerFactory pmf)SunTransactionHelper specific code
synchronized(pmf_listSyncObject) {
int i = pmf_list.indexOf(pmf);
if (i == -1) {
// New PersistenceManagerFactory. Remember it.
pmf_list.add(pmf);
return pmf;
}
return (PersistenceManagerFactory)pmf_list.get(i);
}
|