Methods Summary |
---|
public void | activateEntity(org.jboss.ejb.EntityEnterpriseContext instance)
pm.activateEntity(instance);
|
public java.lang.Object | createBeanClassInstance()
return pm.createBeanClassInstance();
|
public void | createEntity(java.lang.reflect.Method m, java.lang.Object[] args, org.jboss.ejb.EntityEnterpriseContext instance)
pm.createEntity(m, args, instance);
|
public java.util.Collection | findEntities(java.lang.reflect.Method finderMethod, java.lang.Object[] args, org.jboss.ejb.EntityEnterpriseContext instance, org.jboss.ejb.GenericEntityObjectFactory factory)
return pm.findEntities(finderMethod, args, instance, factory);
|
public java.lang.Object | findEntity(java.lang.reflect.Method finderMethod, java.lang.Object[] args, org.jboss.ejb.EntityEnterpriseContext instance, org.jboss.ejb.GenericEntityObjectFactory factory)
return pm.findEntity(finderMethod, args, instance, factory);
|
public org.jboss.ejb.Container | getContainer()
return container;
|
public org.jboss.ejb.EntityPersistenceManager | getDelegatePersistenceManager()Return the real EntityPersistenceManager to which this interceptor delegates.
return pm;
|
public java.lang.Object | invoke(org.jboss.invocation.Invocation mi)
Object key = ((EnterpriseContext) mi.getEnterpriseContext()).getInstance();
try
{
ccm.pushMetaAwareObject(key, unsharableResources);
try
{
return getNext().invoke(mi);
}
finally
{
ccm.popMetaAwareObject(unsharableResources);
}
}
catch (ResourceException e)
{
InvocationType type = mi.getType();
boolean isLocal = (type == InvocationType.LOCAL || type == InvocationType.LOCALHOME);
if (isLocal)
throw new EJBException("Resource problem during invoke", e);
else
throw new RemoteException("Resource problem during invoke", e);
}
|
public void | invokeEjbStore(org.jboss.ejb.EntityEnterpriseContext ctx)
Object key = ctx.getInstance();
try
{
ccm.pushMetaAwareObject(key, unsharableResources);
try
{
pm.invokeEjbStore(ctx);
}
finally
{
ccm.popMetaAwareObject(unsharableResources);
}
}
catch (ResourceException e)
{
throw new RemoteException("Could not store!: ", e);
}
|
public java.lang.Object | invokeHome(org.jboss.invocation.Invocation mi)
EnterpriseContext ctx = (EnterpriseContext) mi.getEnterpriseContext();
if (ctx == null)
return getNext().invokeHome(mi);
else
{
Object key = ctx.getInstance();
try
{
ccm.pushMetaAwareObject(key, unsharableResources);
try
{
return getNext().invokeHome(mi);
}
finally
{
ccm.popMetaAwareObject(unsharableResources);
}
}
catch (ResourceException e)
{
InvocationType type = mi.getType();
boolean isLocal = (type == InvocationType.LOCAL || type == InvocationType.LOCALHOME);
if (isLocal)
throw new EJBException("Resource problem during invokeHome", e);
else
throw new RemoteException("Resource problem during invokeHome", e);
}
}
|
public boolean | isModified(org.jboss.ejb.EntityEnterpriseContext ctx)
return pm.isModified(ctx);
|
public boolean | isStoreRequired(org.jboss.ejb.EntityEnterpriseContext instance)
return pm.isStoreRequired(instance);
|
public void | loadEntity(org.jboss.ejb.EntityEnterpriseContext instance)
pm.loadEntity(instance);
|
public void | passivateEntity(org.jboss.ejb.EntityEnterpriseContext instance)
pm.passivateEntity(instance);
|
public void | postCreateEntity(java.lang.reflect.Method m, java.lang.Object[] args, org.jboss.ejb.EntityEnterpriseContext instance)
pm.postCreateEntity(m, args, instance);
|
public void | removeEntity(org.jboss.ejb.EntityEnterpriseContext instance)
pm.removeEntity(instance);
|
public void | setContainer(org.jboss.ejb.Container container)
this.container = container;
|
public void | start()
log.debug("start called in CachedConnectionInterceptor");
if (container == null)
{
log.warn("container is null, can't steal persistence manager");
return;
}
if (container instanceof EntityContainer)
{
EntityContainer ec = (EntityContainer) container;
if (ec.getPersistenceManager() == null)
{
log.info("no persistence manager in container!");
return;
}
if (ec.getPersistenceManager() == this)
{
log.info(" persistence manager in container already set!");
return;
}
pm = ec.getPersistenceManager();
ec.setPersistenceManager(this);
}
// get the JNDI names for all resources that are referenced "Unshareable"
BeanMetaData bmd = container.getBeanMetaData();
ApplicationMetaData appMetaData = bmd.getApplicationMetaData();
ResourceRefMetaData resRefMetaData;
String jndiName;
for (Iterator iter = bmd.getResourceReferences(); iter.hasNext();)
{
resRefMetaData = (ResourceRefMetaData) iter.next();
jndiName = resRefMetaData.getJndiName();
if (jndiName == null)
{
jndiName = appMetaData.getResourceByName(resRefMetaData.getResourceName());
}
if (jndiName != null && resRefMetaData.isShareable() == false)
{
int i = jndiName.indexOf(':");
if (jndiName.charAt(i + 1) == '/")
{
i++;
}
unsharableResources.add(jndiName.substring(i + 1));
}
}
|
public void | stop()
if (container != null && pm != null && ((EntityContainer) container).getPersistenceManager() == this)
{
((EntityContainer) container).setPersistenceManager(pm);
pm = null;
}
unsharableResources.clear();
|
public void | storeEntity(org.jboss.ejb.EntityEnterpriseContext ctx)
Object key = ctx.getInstance();
try
{
ccm.pushMetaAwareObject(key, unsharableResources);
try
{
pm.storeEntity(ctx);
}
finally
{
ccm.popMetaAwareObject(unsharableResources);
}
}
catch (ResourceException e)
{
throw new RemoteException("Could not store!: ", e);
}
|