| Method from org.jboss.resource.connectionmanager.CachedConnectionInterceptor Detail: |
public void activateEntity(EntityEnterpriseContext instance) throws RemoteException {
pm.activateEntity(instance);
}
|
public Object createBeanClassInstance() throws Exception {
return pm.createBeanClassInstance();
}
|
public void createEntity(Method m,
Object[] args,
EntityEnterpriseContext instance) throws Exception {
pm.createEntity(m, args, instance);
}
|
public Collection findEntities(Method finderMethod,
Object[] args,
EntityEnterpriseContext instance,
GenericEntityObjectFactory factory) throws Exception {
return pm.findEntities(finderMethod, args, instance, factory);
}
|
public Object findEntity(Method finderMethod,
Object[] args,
EntityEnterpriseContext instance,
GenericEntityObjectFactory factory) throws Exception {
return pm.findEntity(finderMethod, args, instance, factory);
}
|
public Container getContainer() {
return container;
}
|
public EntityPersistenceManager getDelegatePersistenceManager() {
return pm;
}
Return the real EntityPersistenceManager to which this interceptor delegates. |
public Object invoke(Invocation mi) throws Exception {
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(EntityEnterpriseContext ctx) throws RemoteException {
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 Object invokeHome(Invocation mi) throws Exception {
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(EntityEnterpriseContext ctx) throws Exception {
return pm.isModified(ctx);
}
|
public boolean isStoreRequired(EntityEnterpriseContext instance) throws Exception {
return pm.isStoreRequired(instance);
}
|
public void loadEntity(EntityEnterpriseContext instance) throws RemoteException {
pm.loadEntity(instance);
}
|
public void passivateEntity(EntityEnterpriseContext instance) throws RemoteException {
pm.passivateEntity(instance);
}
|
public void postCreateEntity(Method m,
Object[] args,
EntityEnterpriseContext instance) throws Exception {
pm.postCreateEntity(m, args, instance);
}
|
public void removeEntity(EntityEnterpriseContext instance) throws RemoveException, RemoteException {
pm.removeEntity(instance);
}
|
public void setContainer(Container container) {
this.container = container;
}
|
public void start() throws Exception {
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(EntityEnterpriseContext ctx) throws RemoteException {
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);
}
}
|