public static final String guid(Container container) { return guid(container, vmid); }
/** * Reports the existance of a container. * * @param container the container to check * @return true if found, false otherwise */ public static boolean hasContainer(Container container) { return hasContainer(guid(container)); }
/** * Unregisters a container. * * @param container the container to unregister * @throws IllegalStateException if the container is not registered */ public static void unregister(Container container) { String guid = guid(container); if(!hasContainer(guid)) throw new IllegalStateException("Container " + guid + " + is not registered"); containers.remove(guid); if (container.isClustered()) clusterContainers.remove(clusterUid(container)); log.debug("Unregistered container " + guid); }
/** * Registers a container. * * @param container the container to register * @throws IllegalStateException if the container is already registered */ public static void register(Container container) { String guid = guid(container); if(hasContainer(guid)) throw new IllegalStateException("Container " + guid + " + is already registered"); containers.put(guid, container); if (container.isClustered()) clusterContainers.put(clusterUid(container), container); log.debug("Registered container " + guid); }
/** * An incoming context from serialization. * * @param container * @param beanMO */ protected StatefulBeanContext(StatefulContainer container, MarshalledObject beanMO) { super(container); assert beanMO != null : "beanMO is null"; this.containerClusterUid = Ejb3Registry.clusterUid(container); this.containerGuid = Ejb3Registry.guid(container); this.isClustered = container.isClustered(); this.beanMO = beanMO; }
/** * A brand new stateful session bean. * * @param container * @param bean */ protected StatefulBeanContext(StatefulContainer container, Object bean) { super(container, bean); this.containerClusterUid = Ejb3Registry.clusterUid(container); this.containerGuid = Ejb3Registry.guid(container); this.isClustered = container.isClustered(); this.id = new GUID(); }
public StatefulBeanContextReference(StatefulBeanContext beanContext) { assert beanContext != null : "beanContext is null"; this.beanContext = beanContext; oid = beanContext.getId(); containerGuid = Ejb3Registry.guid(beanContext.getContainer()); containerClusterUid = Ejb3Registry.clusterUid(beanContext.getContainer()); isClustered = beanContext.getContainer().isClustered(); }
protected void lockedStart() throws Exception { super.lockedStart(); this.registerWithAopDispatcher(); // Obtain registrar JndiSessionRegistrarBase registrar = this.getJndiRegistrar(); // Bind all appropriate references/factories to Global JNDI for Client access, if a JNDI Registrar is present if (registrar != null) { String guid = Ejb3Registry.guid(this); registrar.bindEjb(this.getInitialContext(), this.getMetaData(), this.getClassloader(), this.getObjectName() .getCanonicalName(), guid, this.getAdvisor()); } else { log.debug("No " + JndiSessionRegistrarBase.class.getSimpleName() + " was found; bypassing binding of Proxies to " + this.getName() + " in Global JNDI."); } }
public StatefulSessionContextImpl(StatefulBeanContext beanContext) { assert beanContext != null : "beanContext is null"; this.delegate = new StatefulSessionContextDelegate(beanContext); this.containerGuid = Ejb3Registry.guid(beanContext.getContainer()); this.containerClusterUid =Ejb3Registry.clusterUid(beanContext.getContainer()); this.id = beanContext.getId(); this.isClustered = beanContext.getContainer().isClustered(); }