org.openejb.core.ivm
Class IntraVmMetaData

java.lang.Object
  extended by org.openejb.core.ivm.IntraVmMetaData
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EJBMetaData

public class IntraVmMetaData
extends java.lang.Object
implements javax.ejb.EJBMetaData, java.io.Serializable

IntraVM server implementation of the javax.ejb.EJBMetaData interface.

Author:
David Blevins, Richard Monson-Haefel
See Also:
Serialized Form

Field Summary
static byte ENTITY
          Constant held by the type member variable to specify that this MetaData implementation represents an EntityBean.
protected  java.lang.Class homeClass
          The Class of the bean's home interface.
protected  javax.ejb.EJBHome homeStub
          The EJBHome stub/proxy for this bean deployment.
protected  java.lang.Class keyClass
          The Class of the bean's primary key or null if the bean is of a type that does not require a primary key.
protected  java.lang.Class remoteClass
          The Class of the bean's remote interface.
static byte STATEFUL
          Constant held by the type member variable to specify that this MetaData implementation represents a stateful SessionBean.
static byte STATELESS
          Constant held by the type member variable to specify that this MetaData implementation represents a stateless SessionBean.
protected  byte type
          The type of bean that this MetaData implementation represents.
 
Constructor Summary
IntraVmMetaData(java.lang.Class homeInterface, java.lang.Class remoteInterface, byte typeOfBean)
          Constructs a IntraVmMetaData object to represent the MetaData of a bean deployment of the specified type with the specified home and remote interfaces.
IntraVmMetaData(java.lang.Class homeInterface, java.lang.Class remoteInterface, java.lang.Class primaryKeyClass, byte typeOfBean)
          Constructs a IntraVmMetaData object to represent the MetaData of a bean deployment of the specified type, with the specified home and remote interfaces and primary key class.
 
Method Summary
 javax.ejb.EJBHome getEJBHome()
          Gets the EJBHome stub/proxy for this bean deployment.
 java.lang.Class getHomeInterfaceClass()
          Returns the Class of the bean's home interface.
 java.lang.Class getPrimaryKeyClass()
          Returns the Class of the bean's primary key or null if the bean is of a type that does not require a primary key.
 java.lang.Class getRemoteInterfaceClass()
          Returns the Class of the bean's remote interface.
 boolean isSession()
          Returns true if this MetaData represents a bean deployment of type SessionBean.
 boolean isStatelessSession()
          Returns true if this MetaData represents a bean deployment that is a stateless SessionBean.
 void setEJBHome(javax.ejb.EJBHome home)
          Sets the EJBHome stub/proxy for this bean deployment.
protected  java.lang.Object writeReplace()
          If the meta data is being copied between bean instances in a RPC call we use the IntraVmArtifact
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTITY

public static final byte ENTITY
Constant held by the type member variable to specify that this MetaData implementation represents an EntityBean.

See Also:
type, Constant Field Values

STATEFUL

public static final byte STATEFUL
Constant held by the type member variable to specify that this MetaData implementation represents a stateful SessionBean.

See Also:
type, Constant Field Values

STATELESS

public static final byte STATELESS
Constant held by the type member variable to specify that this MetaData implementation represents a stateless SessionBean.

See Also:
type, Constant Field Values

homeClass

protected java.lang.Class homeClass
The Class of the bean's home interface.


remoteClass

protected java.lang.Class remoteClass
The Class of the bean's remote interface.


keyClass

protected java.lang.Class keyClass
The Class of the bean's primary key or null if the bean is of a type that does not require a primary key.


homeStub

protected javax.ejb.EJBHome homeStub
The EJBHome stub/proxy for this bean deployment.


type

protected byte type
The type of bean that this MetaData implementation represents.

See Also:
ENTITY, STATEFUL, STATELESS
Constructor Detail

IntraVmMetaData

public IntraVmMetaData(java.lang.Class homeInterface,
                       java.lang.Class remoteInterface,
                       byte typeOfBean)
Constructs a IntraVmMetaData object to represent the MetaData of a bean deployment of the specified type with the specified home and remote interfaces.

Parameters:
homeInterface - The Class of the bean's home interface.
remoteInterface - The Class of the bean's remote interface.
typeOfBean - One of the ENTITY, STATEFUL or STATELESS constants that specify the type of bean this MetaData will represent.

IntraVmMetaData

public IntraVmMetaData(java.lang.Class homeInterface,
                       java.lang.Class remoteInterface,
                       java.lang.Class primaryKeyClass,
                       byte typeOfBean)
Constructs a IntraVmMetaData object to represent the MetaData of a bean deployment of the specified type, with the specified home and remote interfaces and primary key class.

Parameters:
homeInterface - The Class of the bean's home interface.
remoteInterface - The Class of the bean's remote interface.
primaryKeyClass - The primary key class of the bean that this MetaData will represent.
typeOfBean - One of the ENTITY, STATEFUL or STATELESS constants that specify the type of bean this MetaData will represent.
Method Detail

getHomeInterfaceClass

public java.lang.Class getHomeInterfaceClass()
Returns the Class of the bean's home interface.

Specified by:
getHomeInterfaceClass in interface javax.ejb.EJBMetaData
Returns:
the Class of the bean's home interface

getRemoteInterfaceClass

public java.lang.Class getRemoteInterfaceClass()
Returns the Class of the bean's remote interface.

Specified by:
getRemoteInterfaceClass in interface javax.ejb.EJBMetaData
Returns:
the Class of the bean's remote interface

getPrimaryKeyClass

public java.lang.Class getPrimaryKeyClass()
Returns the Class of the bean's primary key or null if the bean is of a type that does not require a primary key. EJB 1.1, section 5.5: If the EJBMetaData.getPrimaryKeyClass() method is invoked on a EJBMetaData object for a Session bean, the method throws the java.lang.RuntimeException. UnsupportedOperationException is a java.lang.RuntimeException

Specified by:
getPrimaryKeyClass in interface javax.ejb.EJBMetaData
Returns:
Class

isSession

public boolean isSession()
Returns true if this MetaData represents a bean deployment of type SessionBean.

Specified by:
isSession in interface javax.ejb.EJBMetaData
Returns:
boolean

isStatelessSession

public boolean isStatelessSession()
Returns true if this MetaData represents a bean deployment that is a stateless SessionBean.

Specified by:
isStatelessSession in interface javax.ejb.EJBMetaData
Returns:
boolean

setEJBHome

public void setEJBHome(javax.ejb.EJBHome home)
Sets the EJBHome stub/proxy for this bean deployment.

Parameters:
home - The EJBHome stub/proxy for this bean deployment.

getEJBHome

public javax.ejb.EJBHome getEJBHome()
Gets the EJBHome stub/proxy for this bean deployment.

Specified by:
getEJBHome in interface javax.ejb.EJBMetaData
Returns:
The EJBHome stub/proxy for this bean deployment.

writeReplace

protected java.lang.Object writeReplace()
                                 throws java.io.ObjectStreamException
If the meta data is being copied between bean instances in a RPC call we use the IntraVmArtifact

If the meta data is referenced by a stateful bean that is being passivated by the container, we allow this object to be serialized.

If the meta data is serialized outside the core container system, we allow the application server to handle it.

Returns:
Object
Throws:
java.io.ObjectStreamException


Copyright © 1999-2011 OpenEJB. All Rights Reserved.