/* */ public Object invoke(Invocation mi)
/* */ throws Exception
/* */ {
/* 130 */ Object key = mi.getId();
/* */
/* 132 */ EntityEnterpriseContext ctx = null;
/* 133 */ EntityContainer ec = (EntityContainer)this.container;
/* */ InvocationType type;
/* 134 */ if ((mi.getTransaction() == null) ||
/* 138 */ (ctx == null))
/* */ {
/* 140 */ InstancePool pool = ec.getInstancePool();
/* */ try
/* */ {
/* 143 */ ctx = (EntityEnterpriseContext)pool.get();
/* */ }
/* */ catch (EJBException e)
/* */ {
/* 147 */ throw e;
/* */ }
/* */ catch (RemoteException e)
/* */ {
/* 151 */ throw e;
/* */ }
/* */ catch (Exception e)
/* */ {
/* 155 */ type = mi.getType();
/* 156 */ boolean isLocal = (type == InvocationType.LOCAL) || (type == InvocationType.LOCALHOME);
/* 157 */ if (isLocal) {
/* 158 */ throw new EJBException("Unable to get an instance from the pool", e);
/* */ }
/* 160 */ throw new RemoteException("Unable to get an intance from the pool", e);
/* */ }
/* 162 */ ctx.setCacheKey(key);
/* 163 */ ctx.setId(key);
/* 164 */ EntityPersistenceManager pm = ec.getPersistenceManager();
/* 165 */ pm.activateEntity(ctx);
/* */ }
/* */
/* 168 */ boolean trace = this.log.isTraceEnabled();
/* 169 */ if (trace) this.log.trace("Begin invoke, key=" + key);
/* */
/* 173 */ ctx.setTransaction(mi.getTransaction());
/* */
/* 176 */ ctx.setPrincipal(mi.getPrincipal());
/* */
/* 178 */ EnterpriseBeanPolicyContextHandler.setEnterpriseBean(ctx.getInstance());
/* */
/* 181 */ mi.setEnterpriseContext(ctx);
/* */
/* 183 */ if (ejbTimeout.equals(mi.getMethod()))
/* 184 */ AllowedOperationsAssociation.pushInMethodFlag(IN_EJB_TIMEOUT);