Class SunContainerHelper

    • Method Detail

      • getEJBObject

        public jakarta.ejb.EJBObject getEJBObject​(Object pk,
                                                  Object container)
        Get an EJBObject reference for this primary key and Container helper. This is SunContainerHelper specific code.
        Specified by:
        getEJBObject in interface ContainerHelper
        Parameters:
        pk - the primary key instance.
        container - a Container instance for the request.
        Returns:
        a corresponding EJBObject instance to be used by the client.
        See Also:
        getContainer(java.lang.Object)
      • getEJBLocalObject

        public jakarta.ejb.EJBLocalObject getEJBLocalObject​(Object pk,
                                                            Object container)
        Get an EJBLocalObject reference for this primary key and Container helper. This is SunContainerHelper specific code.
        Specified by:
        getEJBLocalObject in interface ContainerHelper
        Parameters:
        pk - the primary key instance.
        container - a helper instance for the request.
        Returns:
        a corresponding EJBLocalObject instance to be used by the client.
        See Also:
        getContainer(java.lang.Object)
      • getEJBLocalObject

        public jakarta.ejb.EJBLocalObject getEJBLocalObject​(Object pk,
                                                            Object container,
                                                            jakarta.ejb.EJBContext context)
        Get an EJBLocalObject reference for this primary key and Container helper, and EJBContext of the calling bean. Allows the container to check if this method is called during ejbRemove that is part of a cascade-delete remove. This is SunContainerHelper specific code.
        Specified by:
        getEJBLocalObject in interface ContainerHelper
        Parameters:
        pk - the primary key instance.
        container - a helper instance for the request.
        context - an EJBContext of the calling bean.
        Returns:
        a corresponding EJBLocalObject instance to be used by the client.
        See Also:
        getContainer(java.lang.Object)
      • removeByEJBLocalObject

        public void removeByEJBLocalObject​(jakarta.ejb.EJBLocalObject ejb,
                                           Object container)
        Remove a bean for a given EJBLocalObject and Container helper. This is SunContainerHelper specific code.
        Specified by:
        removeByEJBLocalObject in interface ContainerHelper
        Parameters:
        ejb - the EJBLocalObject for the bean to be removed.
        container - a Container instance for the request.
        See Also:
        getContainer(java.lang.Object)
      • removeByPK

        public void removeByPK​(Object pk,
                               Object container)
        Remove a bean for a given primary key and Container helper. This is SunContainerHelper specific code.
        Specified by:
        removeByPK in interface ContainerHelper
        Parameters:
        pk - the primary key for the bean to be removed.
        container - a Container instance for the request.
        See Also:
        getContainer(java.lang.Object)
      • assertValidLocalObject

        public void assertValidLocalObject​(Object o,
                                           Object container)
        Verify that this instance is of a valid local interface type for a given Container helper. This is SunContainerHelper specific code.
        Specified by:
        assertValidLocalObject in interface ContainerHelper
        Parameters:
        o - the instance to be verified.
        container - a Container instance for the request.
        See Also:
        getContainer(java.lang.Object)
      • assertValidRemoteObject

        public void assertValidRemoteObject​(Object o,
                                            Object container)
        Verify that this instance is of a valid remote interface type for a given Container helper. This is SunContainerHelper specific code.
        Specified by:
        assertValidRemoteObject in interface ContainerHelper
        Parameters:
        o - the instance to be verified.
        container - a Container instance for the request.
        See Also:
        getContainer(java.lang.Object)
      • setCascadeDeleteAfterSuperEJBRemove

        public void setCascadeDeleteAfterSuperEJBRemove​(jakarta.ejb.EntityContext context)
        Mark the bean as already removed during cascade-delete operation for a given EntityContext. Called by the generated ejbRemove method before calling ejbRemove of the related beans (via removeByEJBLocalObject) that are to be cascade-deleted. This is SunContainerHelper specific code.
        Specified by:
        setCascadeDeleteAfterSuperEJBRemove in interface ContainerHelper
        Parameters:
        context - the EntityContext of the bean beeing removed.
      • preSelect

        public void preSelect​(Object container)
        Called in a CMP supported environment. Notifies the container that ejbSelect had been called. This is SunContainerHelper specific code.
        Specified by:
        preSelect in interface ContainerHelper
        Parameters:
        container - a Container instance for the request.
        See Also:
        getContainer(java.lang.Object)
      • getNumericConverterPolicy

        public int getNumericConverterPolicy​(Object container)
        Called in CMP environment to get NumericConverter policy referenced by this Container instance.
        Specified by:
        getNumericConverterPolicy in interface ContainerHelper
        Parameters:
        container - a Container instance for the request
        Returns:
        a valid NumericConverter policy type
        See Also:
        getContainer(java.lang.Object)
      • beginInternalTransaction

        public void beginInternalTransaction​(PersistenceManager pm)
        Called in a unspecified transaction context of a managed environment. According to p.364 of EJB 2.0 spec, CMP may need to manage its own transaction when its transaction attribute is NotSupported, Never, Supports. This is a generic implementation. Application server may like to overwrite this if necessary.
        Specified by:
        beginInternalTransaction in interface ContainerHelper
        Parameters:
        pm - PersistenceManager
      • commitInternalTransaction

        public void commitInternalTransaction​(PersistenceManager pm)
        Called in a unspecified transaction context of a managed environment. According to p.364 of EJB 2.0 spec, CMP may need to manage its own transaction when its transaction attribute is NotSupported, Never, Supports. This is a generic implementation. Application server may like to overwrite this if necessary.
        Specified by:
        commitInternalTransaction in interface ContainerHelper
        Parameters:
        pm - PersistenceManager
      • rollbackInternalTransaction

        public void rollbackInternalTransaction​(PersistenceManager pm)
        Called in a unspecified transaction context of a managed environment. According to p.364 of EJB 2.0 spec, CMP may need to manage its own transaction when its transaction attribute is NotSupported, Never, Supports. This is a generic implementation. Application server may like to overwrite this if necessary.
        Specified by:
        rollbackInternalTransaction in interface ContainerHelper
        Parameters:
        pm - PersistenceManager
      • suspendCurrentTransaction

        public jakarta.transaction.Transaction suspendCurrentTransaction()
        Called from read-only beans to suspend current transaction. This will guarantee that PersistenceManager is not bound to any transaction.
        Specified by:
        suspendCurrentTransaction in interface ContainerHelper
        Returns:
        jakarta.transaction.Transaction object representing the suspended transaction. Returns null if the calling thread is not associated with a transaction.
      • resumeCurrentTransaction

        public void resumeCurrentTransaction​(jakarta.transaction.Transaction tx)
        Called from read-only beans to resume current transaction. This will guarantee that the transaction continues to run after read-only bean accessed its PersistenceManager.
        Specified by:
        resumeCurrentTransaction in interface ContainerHelper
        Parameters:
        tx - - The jakarta.transaction.Transaction object that represents the transaction to be resumed. If this object had been returned by #suspendCurrentTransaction() call it will be null in case calling thread was not associated with a transaction.