Package com.sun.ejb.containers

Examples of com.sun.ejb.containers.EJBLocalObjectImpl$SerializableLocalObject


       
        if ( isLocal ) {
            // create EJBLocalObject irrespective of local/remote EjbInvocation
            // this is necessary to make EntityContext.getPrimaryKey and
            // EntityContext.getEJBObject work.
            EJBLocalObjectImpl localObjImpl = internalGetEJBLocalObjectImpl(primaryKey, true);
           
            // associate the context with the ejbLocalObject
            containerStateManager.attachObject(inv, (EJBContextImpl)inv.context, null, localObjImpl);
        }
       
View Full Code Here


     */
    public EJBLocalObject getEJBLocalObjectForPrimaryKey
        (Object pkey, EJBContext ctx) {

        EntityContextImpl context = (EntityContextImpl) ctx;
        EJBLocalObjectImpl ejbLocalObjectImpl =
            internalGetEJBLocalObjectImpl(pkey);

        if (context.isCascadeDeleteBeforeEJBRemove()) {
            JavaEETransaction current = null;
            try {
                current = (JavaEETransaction) transactionManager.getTransaction();
            } catch ( SystemException ex ) {
                throw new EJBException(ex);
            }
      ActiveTxCache activeTxCache = (current == null) ? null :
    (ActiveTxCache) (ejbContainerUtilImpl.getActiveTxCache(current));
            if (activeTxCache != null) {
    EntityContextImpl ctx2 = (EntityContextImpl)
      activeTxCache.get(this, pkey);
    if ((ctx2 != null) &&
        (ctx2.isCascadeDeleteAfterSuperEJBRemove())) {
        return null;
    }
      }
      return (EJBLocalObject) ejbLocalObjectImpl.getClientObject();
        }

        return (EJBLocalObject) ejbLocalObjectImpl.getClientObject();
    }
View Full Code Here

     * is no standard API defined in EJB2.0 for the PM to get an EJBLocalObject
     * for a primary key (findByPrimaryKey cant be used because it may
     * not run in the same tx).
     */
    public EJBLocalObject getEJBLocalObjectForPrimaryKey(Object pkey) {
        EJBLocalObjectImpl localObjectImpl =
            internalGetEJBLocalObjectImpl(pkey);
  return (localObjectImpl != null) ?
            (EJBLocalObject) localObjectImpl.getClientObject() : null;
    }
View Full Code Here

     * Remove a bean. Used by the PersistenceManager.
     * This is needed because the PM's remove must bypass tx/security checks.
     */
    public void removeBeanUnchecked(EJBLocalObject localObj) {
        // First convert client EJBLocalObject to EJBLocalObjectImpl
        EJBLocalObjectImpl localObjectImpl =
            EJBLocalObjectImpl.toEJBLocalObjectImpl(localObj);
        internalRemoveBeanUnchecked(localObjectImpl, true);
    }
View Full Code Here

   
    protected EJBLocalObjectImpl internalGetEJBLocalObjectImpl
        (Object primaryKey, boolean incrementRefCount, boolean cacheEJBO) {
        // check if the EJBLocalObject exists in the store.
        try {
            EJBLocalObjectImpl localObjImpl = (EJBLocalObjectImpl)
                ejbLocalObjectStore.get(primaryKey, incrementRefCount);
            if ( localObjImpl == null ) {

                // and associate the EJBLocalObjectImpl with the primary key
                localObjImpl = instantiateEJBLocalObjectImpl(primaryKey);
View Full Code Here

        // we're sure that no concurrent thread can be using this
        // context, so no need to synchronize.
       
        // set EJBObject/LocalObject for the context
        if ( inv.isLocal ) {
            EJBLocalObjectImpl localObjImpl =
                internalGetEJBLocalObjectImpl(primaryKey, true);
            containerStateManager.attachObject(inv, context, null, localObjImpl);
            // No need to create/set EJBObject if this EJB isRemote too.
        // This saves remote object creation overhead.
        // The EJBObject and stub will get created lazily if needed
View Full Code Here

       
        if ( isLocal ) {
            // create EJBLocalObject irrespective of local/remote EjbInvocation
            // this is necessary to make EntityContext.getPrimaryKey and
            // EntityContext.getEJBObject work.
            EJBLocalObjectImpl localObjImpl = internalGetEJBLocalObjectImpl(primaryKey, true);
           
            // associate the context with the ejbLocalObject
            containerStateManager.attachObject(inv, (EJBContextImpl)inv.context, null, localObjImpl);
        }
       
View Full Code Here

    public EJBLocalObject getEJBLocalObjectForPrimaryKey
        (Object pkey, EJBContext ctx) {
        // EntityContextImpl should always be used in conjunction with EntityContainer so we can always cast
        assert ctx instanceof EntityContextImpl;
        EntityContextImpl context = (EntityContextImpl) ctx;
        EJBLocalObjectImpl ejbLocalObjectImpl =
            internalGetEJBLocalObjectImpl(pkey);

        if (context.isCascadeDeleteBeforeEJBRemove()) {
            JavaEETransaction current = null;
            try {
                current = (JavaEETransaction) transactionManager.getTransaction();
            } catch ( SystemException ex ) {
                throw new EJBException(ex);
            }
      ActiveTxCache activeTxCache = (current == null) ? null :
    (ActiveTxCache) (ejbContainerUtilImpl.getActiveTxCache(current));
            if (activeTxCache != null) {
    EntityContextImpl ctx2 = (EntityContextImpl)
      activeTxCache.get(this, pkey);
    if ((ctx2 != null) &&
        (ctx2.isCascadeDeleteAfterSuperEJBRemove())) {
        return null;
    }
      }
      return (EJBLocalObject) ejbLocalObjectImpl.getClientObject();
        }

        return (EJBLocalObject) ejbLocalObjectImpl.getClientObject();
    }
View Full Code Here

     * is no standard API defined in EJB2.0 for the PM to get an EJBLocalObject
     * for a primary key (findByPrimaryKey cant be used because it may
     * not run in the same tx).
     */
    public EJBLocalObject getEJBLocalObjectForPrimaryKey(Object pkey) {
        EJBLocalObjectImpl localObjectImpl =
            internalGetEJBLocalObjectImpl(pkey);
  return (localObjectImpl != null) ?
            (EJBLocalObject) localObjectImpl.getClientObject() : null;
    }
View Full Code Here

     * Remove a bean. Used by the PersistenceManager.
     * This is needed because the PM's remove must bypass tx/security checks.
     */
    public void removeBeanUnchecked(EJBLocalObject localObj) {
        // First convert client EJBLocalObject to EJBLocalObjectImpl
        EJBLocalObjectImpl localObjectImpl =
            EJBLocalObjectImpl.toEJBLocalObjectImpl(localObj);
        internalRemoveBeanUnchecked(localObjectImpl, true);
    }
View Full Code Here

TOP

Related Classes of com.sun.ejb.containers.EJBLocalObjectImpl$SerializableLocalObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.