FileDocCategorySizeDatePackage
EJBObjectImpl.javaAPI DocGlassfish v2 API7716Fri May 04 22:32:58 BST 2007com.sun.ejb.containers

EJBObjectImpl

public abstract class EJBObjectImpl extends EJBLocalRemoteObject implements EJBObject
EJBObjectImpl implements EJBObject methods for EJBs. It is extended by the generated concrete type-specific EJBObject implementation (e.g. Hello_EJBObject). Instances of this class are NEVER given to beans or clients. Beans and clients get only stubs (instances of the stub class generated by rmic).

Fields Summary
private static final Logger
_logger
private static Class[]
NO_PARAMS
private static com.sun.enterprise.util.LocalStringManagerImpl
localStrings
private static Method
REMOVE_METHOD
private transient Remote
stub
private transient Remote
ejbObject
private transient Map
businessStubs
private transient Map
businessEJBObjects
private transient boolean
beingCreated
private boolean
isRemoteHomeView
Constructors Summary
protected EJBObjectImpl()

                    

        
    
Methods Summary
public final EJBHomegetEJBHome()

        container.authorizeRemoteMethod(BaseContainer.EJBObject_getEJBHome);
        
        return container.getEJBHomeStub();
    
public java.rmi.RemotegetEJBObject()
Get the Remote object corresponding to an EJBObjectImpl for the RemoteHome view.

        return ejbObject;
    
public java.rmi.RemotegetEJBObject(java.lang.String generatedBusinessInterface)
Get the Remote object corresponding to an EJBObjectImpl for the RemoteBusiness view.

        return (java.rmi.Remote) businessEJBObjects.get
            (generatedBusinessInterface);
    
public final HandlegetHandle()
This is called when the EJB client does ejbref.getHandle(). Return a serializable implementation of javax.ejb.Handle.

        container.authorizeRemoteMethod(BaseContainer.EJBObject_getHandle);

        // We can assume the stub an EJBObject since getHandle() is only
        // visible through the RemoteHome view.
        return new HandleImpl((EJBObject)stub);
    
public java.lang.ObjectgetPrimaryKey()

        if ( container instanceof EntityContainer ) {
            container.authorizeRemoteMethod(
                BaseContainer.EJBObject_getPrimaryKey);
            
            return primaryKey;
        }
        else {
            throw new RemoteException(localStrings.getLocalString(
                "containers.invalid_operation",
                "Invalid operation for Session EJBs."));
        }
    
public final java.rmi.RemotegetStub()

        return stub;
    
public final java.rmi.RemotegetStub(java.lang.String generatedBusinessInterface)

        return (java.rmi.Remote) businessStubs.get(generatedBusinessInterface);
    
final booleanisBeingCreated()

        return beingCreated;
    
public booleanisIdentical(EJBObject ejbo)

        container.authorizeRemoteMethod(BaseContainer.EJBObject_isIdentical);
        
        return container.isIdentical(this, ejbo);
    
booleanisRemoteHomeView()

        return isRemoteHomeView;
    
public final voidremove()
This is called when the EJB client does ejbref.remove(). or EJBHome/LocalHome.remove(primaryKey). Since there is no generated code in the *_EJBObjectImpl class for remove, we need to call preInvoke, postInvoke etc here.


        // authorization is performed within container

        container.removeBean(this, REMOVE_METHOD, false);
    
final voidsetBeingCreated(boolean b)

        beingCreated = b;
    
public voidsetEJBObject(java.rmi.Remote ejbObject)

        this.ejbObject = ejbObject;
    
public voidsetEJBObject(java.lang.String generatedBusinessInterface, java.rmi.Remote ejbObject)

        businessEJBObjects.put(generatedBusinessInterface, ejbObject);
    
voidsetIsRemoteHomeView(boolean flag)

        isRemoteHomeView = flag;
    
final voidsetStub(java.rmi.Remote stub)

        this.stub = stub;
    
final voidsetStub(java.lang.String generatedBusinessInterface, java.rmi.Remote stub)
Stubs are keyed by the name of generated RMI-IIOP version of each remote business interface.

        businessStubs.put(generatedBusinessInterface, stub);