/** * MF FIXME these are implemented on the client */ public EJBLocalHome getEJBLocalHome(Invocation mi) { return localProxyFactory.getEJBLocalHome(); }
public Object next() { verifyIteratorIsValid(); try { currentId = idIterator.next(); return localFactory.getEntityEJBLocalObject(currentId); } catch(ConcurrentModificationException e) { throw new IllegalStateException("Underlying collection has " + "been modified"); } }
public Object[] toArray(Object a[]) { List idList = getIdList(); Collection c = cmrField.getRelatedInvoker().getEntityLocalCollection(idList); return c.toArray(a); }
/** * The EJBDeployer calls this method. The EJBDeployer has set * all the plugins and interceptors that this bean requires and now proceeds * to initialize the chain. The method looks for the standard classes in * the URL, sets up the naming environment of the bean. The concrete * container classes should override this method to introduce * implementation specific initialization behaviour. * * @throws Exception if loading the bean class failed * (ClassNotFoundException) or setting up "java:" * naming environment failed (DeploymentException) */ protected void createService() throws Exception { // Acquire classes from CL beanClass = classLoader.loadClass(metaData.getEjbClass()); if (metaData.getLocalHome() != null) localHomeInterface = classLoader.loadClass(metaData.getLocalHome()); if (metaData.getLocal() != null) localInterface = classLoader.loadClass(metaData.getLocal()); localProxyFactory.setContainer(this); localProxyFactory.create(); if (localHomeInterface != null) ejbModule.addLocalHome(this, localProxyFactory.getEJBLocalHome()); ejbModule.createMissingPermissions(this, metaData); // Allow the policy to incorporate the policy configs Policy.getPolicy().refresh(); }
EJBLocalHome relatedHome = relatedContainer.getLocalProxyFactory().getEJBLocalHome(); try relatedLocalObject = relatedContainer.getLocalProxyFactory().getEntityEJBLocalObject(fk);
public EJBLocalObject createLocalHome() throws CreateException { if (localProxyFactory == null) { String msg = "No ProxyFactory, check for ProxyFactoryFinderInterceptor"; throw new IllegalStateException(msg); } createCount++; return localProxyFactory.getStatelessSessionEJBLocalObject(); }
public EJBLocalObject getEJBLocalObject() { AllowedOperationsAssociation.assertAllowedIn("getEJBLocalObject", IN_EJB_CREATE | IN_EJB_REMOVE | IN_EJB_ACTIVATE | IN_EJB_PASSIVATE | IN_BUSINESS_METHOD | IN_AFTER_BEGIN | IN_BEFORE_COMPLETION | IN_AFTER_COMPLETION); if (con.getLocalHomeClass()==null) throw new IllegalStateException( "No local interface for bean." ); if (ejbLocalObject == null) { ejbLocalObject = ((StatefulSessionContainer)con).getLocalProxyFactory().getStatefulSessionEJBLocalObject(id); } return ejbLocalObject; }
/** * A default implementation of starting the container service. * The container registers it's dynamic MBean interface in the JMX base. * * The concrete container classes should override this method to introduce * implementation specific start behaviour. * * todo implement the service lifecycle methods in an xmbean interceptor so * non lifecycle managed ops are blocked when mbean is not started. * * @throws Exception An exception that occured during start */ protected void startService() throws Exception { // Setup "java:comp/env" namespace setupEnvironment(); localProxyFactory.start(); }
/** * A default implementation of stopping the container service (no-op). The * concrete container classes should override this method to introduce * implementation specific stop behaviour. */ protected void stopService() throws Exception { localProxyFactory.stop(); removeTimerService(null); teardownEnvironment(); }
/** * A default implementation of destroying the container service (no-op). * The concrete container classes should override this method to introduce * implementation specific destroy behaviour. */ protected void destroyService() throws Exception { cleanENC(); localProxyFactory.destroy(); ejbModule.removeLocalHome(this); beanClass = null; homeInterface = null; remoteInterface = null; localHomeInterface = null; localInterface = null; methodPermissionsCache.clear(); // InvocationStatistics holds refs to Methods from // application classes, so to avoid a classloader // leak, lets not just resetStats() but also replace // the object invokeStats.resetStats(); // in case someone else has a ref invokeStats = new InvocationStatistics(); marshalledInvocationMapping.clear(); }
public EJBLocalObject getEJBLocalObject() { AllowedOperationsAssociation.assertAllowedIn("getEJBLocalObject", IN_EJB_CREATE | IN_EJB_REMOVE | IN_BUSINESS_METHOD | IN_EJB_TIMEOUT | IN_SERVICE_ENDPOINT_METHOD); if (con.getLocalHomeClass()==null) throw new IllegalStateException( "No local interface for bean." ); if (ejbLocalObject == null) { ejbLocalObject = ((StatelessSessionContainer)con).getLocalProxyFactory().getStatelessSessionEJBLocalObject(); } return ejbLocalObject; }
ctx.setEJBLocalObject(getLocalProxyFactory().getStatefulSessionEJBLocalObject(id));
public Object[] toArray() { Set value = state.getLoadedValue(ctx); Object[] result = (Object[])Array.newInstance(relatedEntity.getLocalInterface(), value.size()); LocalProxyFactory relatedPF = relatedContainer.getLocalProxyFactory(); int i = 0; for(Iterator iter = value.iterator(); iter.hasNext();) { Object id = iter.next(); result[i++] = relatedPF.getEntityEJBLocalObject(id); } return result; }
public EJBLocalHome getEJBLocalHome(Invocation mi) { return localProxyFactory.getEJBLocalHome(); }
public Object[] toArray() { List idList = getIdList(); Collection c = cmrField.getRelatedInvoker().getEntityLocalCollection(idList); return c.toArray(); }
public Object next() { try { curId = idIter.next(); } catch(ConcurrentModificationException e) { throw new IllegalStateException(e.getMessage()); } return relatedContainer.getLocalProxyFactory().getEntityEJBLocalObject(curId); } };
public EJBLocalHome getEJBLocalHome() { if (con.getLocalHomeClass() == null) throw new IllegalStateException("No local home defined."); if (con instanceof EntityContainer) return ((EntityContainer) con).getLocalProxyFactory().getEJBLocalHome(); else if (con instanceof StatelessSessionContainer) return ((StatelessSessionContainer) con).getLocalProxyFactory().getEJBLocalHome(); else if (con instanceof StatefulSessionContainer) return ((StatefulSessionContainer) con).getLocalProxyFactory().getEJBLocalHome(); // Should never get here throw new EJBException("No EJBLocalHome available (BUG!)"); }
public Object[] toArray(Object a[]) { Set value = state.getLoadedValue(ctx); if(a == null || a.length < value.size()) { a = (Object[])Array.newInstance(entity.getLocalInterface(), value.size()); } LocalProxyFactory relatedPF = relatedContainer.getLocalProxyFactory(); int i = 0; for(Iterator iter = value.iterator(); iter.hasNext();) { Object id = iter.next(); a[i++] = relatedPF.getEntityEJBLocalObject(id); } return a; }
/** * This method is called only for CMR fields with foreign key fields mapped to CMP fields * to check the validity of the foreign key value. * * @param fk the foreign key to check * @return true if there is related entity with the equal primary key */ public boolean isForeignKeyValid(Object fk) { boolean valid; if(relatedManager.getReadAheadCache().getPreloadDataMap(fk, false) != null) { valid = true; } else { EJBLocalHome relatedHome = getRelatedContainer().getLocalProxyFactory().getEJBLocalHome(); try { relatedFindByPrimaryKey.invoke(relatedHome, new Object[]{fk}); valid = true; } catch(Exception ignore) { // no such entity. it is ok to ignore valid = false; } } return valid; }
public Object getValue(EntityEnterpriseContext ctx) { Object value = getLoadedValue(ctx); if(value == null) { localObject = null; } else if(localObject == null) { localObject = relatedContainer.getLocalProxyFactory().getEntityEJBLocalObject(value); } return localObject; }