Package javax.ejb

Examples of javax.ejb.EJBLocalObject


        if (!relatedEntity.getLocalInterface().isInstance(o)) {
            throw CmpMessages.MESSAGES.invalidArgumentType(entity.getLocalInterface().getName());
        }

        EJBLocalObject local = (EJBLocalObject) o;
        try {
            return local.getPrimaryKey();
        } catch (NoSuchObjectLocalException e) {
            throw new IllegalStateException(e);
        }
    }
View Full Code Here


            }
        }

        public void cascadeDelete(CmpEntityBeanContext ctx) throws RemoveException {
            if (manager.registerCascadeDelete(ctx.getPrimaryKeyUnchecked(), ctx.getPrimaryKeyUnchecked())) {
                EJBLocalObject value = (EJBLocalObject) getValue(ctx);
                if (value != null) {
                    changeValue(null);

                    final Object relatedId = value.getPrimaryKey();
                    final JDBCStoreManager2 relatedManager = (JDBCStoreManager2) relatedEntity.getManager();

                    if (!relatedManager.isCascadeDeleted(relatedId)) {
                        value.remove();
                    }
                }

                manager.unregisterCascadeDelete(ctx.getPrimaryKeyUnchecked());
            }
View Full Code Here

            new EJBLocalObjectInvocationHandler(proxyInvocationInfoMap,
                                                localIntf);
        localObjImpl = handler;
       
        try {
            EJBLocalObject localObjectProxy = (EJBLocalObject) ejbLocalObjectProxyCtor.newInstance(new Object[]{handler});
            handler.setProxy(localObjectProxy);
        } catch (ClassCastException e) {
            String msg = localStrings.getLocalString("ejb.basecontainer_invalid_local_interface",
                    "Local component interface [{0}] is invalid since it does not extend javax.ejb.EJBLocalObject.", localIntf);
            throw new IllegalArgumentException(msg, e);
View Full Code Here

/*     */   {
/* 300 */     EntityContainer container = this.relatedManager.getContainer();
/*     */
/* 333 */     if (container.getLocalProxyFactory() != null)
/*     */     {
/* 335 */       EJBLocalObject ejbObject = container.getLocalProxyFactory().getEntityEJBLocalObject(relatedId);
/* 336 */       ejbObject.remove();
/*     */     }
/*     */     else
/*     */     {
/* 340 */       EJBObject ejbObject = (EJBObject)container.getProxyFactory().getEntityEJBObject(relatedId);
/* 341 */       ejbObject.remove();
/*     */     }
/*     */   }
View Full Code Here

/* 125 */     this.factory = factory;
/*     */   }
/*     */
/*     */   Boolean isIdentical(Object a, Object b)
/*     */   {
/* 139 */     EJBLocalObject ejb = (EJBLocalObject)a;
/* 140 */     Boolean isIdentical = Boolean.FALSE;
/* 141 */     if (ejb != null)
/*     */     {
/* 143 */       isIdentical = new Boolean(ejb.toString().equals(b));
/*     */     }
/* 145 */     return isIdentical;
/*     */   }
View Full Code Here

/* 284 */     return getEntityEJBLocalObject(id);
/*     */   }
/*     */
/*     */   public EJBLocalObject getEntityEJBLocalObject(Object id, boolean create)
/*     */   {
/* 289 */     EJBLocalObject result = null;
/* 290 */     if (id != null)
/*     */     {
/* 292 */       Transaction tx = this.cache.getTransaction();
/* 293 */       if (tx == null)
/*     */       {
View Full Code Here

/*  763 */     throw new EJBException(e);
/*      */   }
/*      */
/*      */   public EJBLocalObject getRelatedEntityByFK(Object fk)
/*      */   {
/*  779 */     EJBLocalObject relatedLocalObject = null;
/*  780 */     EntityContainer relatedContainer = getRelatedContainer();
/*      */
/*  782 */     if ((this.hasFKFieldsMappedToCMPFields) && (this.relatedManager.getReadAheadCache().getPreloadDataMap(fk, false) == null))
/*      */     {
/*  786 */       EJBLocalHome relatedHome = relatedContainer.getLocalProxyFactory().getEJBLocalHome();
View Full Code Here

/*      */
/*      */   private Object getRelatedPrimaryKey(Object localObject)
/*      */   {
/* 1859 */     if (this.relatedEntity.getLocalInterface().isAssignableFrom(localObject.getClass()))
/*      */     {
/* 1861 */       EJBLocalObject local = (EJBLocalObject)localObject;
/*      */       try
/*      */       {
/* 1864 */         relatedId = local.getPrimaryKey();
/*      */       }
/*      */       catch (NoSuchObjectLocalException e)
/*      */       {
/*      */         Object relatedId;
/* 1868 */         throw new IllegalArgumentException(e.getMessage());
View Full Code Here

/*      */
/*      */     public void cascadeDelete(EntityEnterpriseContext ctx) throws RemoveException
/*      */     {
/*  715 */       if (JDBCCMRFieldBridge2.this.manager.registerCascadeDelete(ctx.getId(), ctx.getId()))
/*      */       {
/*  717 */         EJBLocalObject value = (EJBLocalObject)getValue(ctx);
/*  718 */         if (value != null)
/*      */         {
/*  720 */           changeValue(null);
/*      */
/*  722 */           Object relatedId = value.getPrimaryKey();
/*  723 */           JDBCStoreManager2 relatedManager = (JDBCStoreManager2)JDBCCMRFieldBridge2.this.relatedEntity.getManager();
/*      */
/*  725 */           if (!relatedManager.isCascadeDeleted(relatedId))
/*      */           {
/*  727 */             value.remove();
/*      */           }
/*      */         }
/*      */
/*  731 */         JDBCCMRFieldBridge2.this.manager.unregisterCascadeDelete(ctx.getId());
/*      */       }
View Full Code Here

/*  653 */     if (!this.relatedEntity.getLocalInterface().isInstance(o))
/*      */     {
/*  655 */       throw new IllegalArgumentException("Argument must be of type " + this.entity.getLocalInterface().getName());
/*      */     }
/*      */
/*  658 */     EJBLocalObject local = (EJBLocalObject)o;
/*      */     try
/*      */     {
/*  661 */       return local.getPrimaryKey();
/*      */     }
/*      */     catch (NoSuchObjectLocalException e) {
/*      */     }
/*  665 */     throw new IllegalArgumentException(e.getMessage());
/*      */   }
View Full Code Here

TOP

Related Classes of javax.ejb.EJBLocalObject

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.