/** * Returns the container specified by the given canonical object name * which is expected to be of the given type. * Never returns null. * * @param oid the canonical object name of the container * @param type the container type * @return the container * @throws IllegalStateException if the container is not registered */ @SuppressWarnings("unchecked") public static <T extends Container> T getContainer(String oid, Class<T> type) { return (T) getContainer(oid); }
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception { Reference ref = (Reference) obj; String containerGuid = (String) ref.get("containerGuid").getContent(); boolean isClustered = Boolean.getBoolean((String)ref.get("isClustered").getContent()); EJBContainer container = (EJBContainer)Ejb3Registry.getContainer(containerGuid); if (container == null && isClustered) { String containerClusterUid = (String) ref.get("containerClusterUid").getContent(); container = (EJBContainer)Ejb3Registry.getClusterContainer(containerClusterUid); } return container.peekContext().getEJBContext(); } }
Container container = Ejb3Registry.getContainer(guid); return container.getEjbName();
Container container = Ejb3Registry.getContainer(guid); return container.getEjbName();
public Object invoke(Invocation invocation) throws Throwable { if (isLocal()) { String guid = (String)invocation.getMetaData(IS_LOCAL, GUID); Container container = Ejb3Registry.getContainer(guid); return invokeLocal(invocation, container); } return invocation.invokeNext(); }
protected SessionContext getDelegate() { if(delegate == null) { StatefulContainer container = (StatefulContainer)Ejb3Registry.getContainer(containerGuid); if (container == null && isClustered) container = (StatefulContainer)Ejb3Registry.getClusterContainer(containerClusterUid); delegate = new StatefulSessionContextDelegate(container.getCache().get(id, false)); } return delegate; }