org.jboss.ejb3.nointerface.mc
Class NoInterfaceViewJNDIBinder<T extends org.jboss.metadata.ejb.jboss.JBossSessionBean31MetaData>

java.lang.Object
  extended by org.jboss.ejb3.nointerface.mc.NoInterfaceViewJNDIBinder<T>
Direct Known Subclasses:
StatefulNoInterfaceJNDIBinder, StatelessNoInterfaceJNDIBinder

public abstract class NoInterfaceViewJNDIBinder<T extends org.jboss.metadata.ejb.jboss.JBossSessionBean31MetaData>
extends java.lang.Object

NoInterfaceViewJNDIBinder A NoInterfaceViewJNDIBinder corresponds to a EJB which is eligible for a no-interface view This MC bean has dependencies (like the container) injected as necessary. During its START phase this NoInterfaceViewJNDIBinder creates a no-interface view and binds it to the jndi.


Field Summary
protected  java.lang.Class<?> beanClass
          The bean class for which the no-interface view corresponds
protected  org.jboss.kernel.spi.dependency.KernelControllerContext endpointContext
          The endpoint for which this NoInterfaceViewJNDIBinder holds an no-interface view
protected  javax.naming.Context jndiCtx
          JNDI naming context
protected  T sessionBeanMetadata
          The bean metadata
 
Constructor Summary
protected NoInterfaceViewJNDIBinder(javax.naming.Context ctx, java.lang.Class<?> beanClass, T sessionBeanMetadata)
          Constructor
 
Method Summary
abstract  void bindNoInterfaceView()
          Bind the no-interface view
protected  org.jboss.metadata.ejb.jboss.jndi.resolver.spi.SessionBean31JNDINameResolver getJNDINameResolver()
          Returns the jndi name resolver, which will be responsible for returning the appropriate jndi names for various views of the session bean
static
<T extends org.jboss.metadata.ejb.jboss.JBossSessionBean31MetaData>
NoInterfaceViewJNDIBinder<T>
getNoInterfaceViewJndiBinder(javax.naming.Context ctx, java.lang.Class<?> beanClass, T sessionBeanMetadata)
          Returns an appropriate instance of NoInterfaceViewJNDIBinder based on the sessionBeanMetadata
 void onStart()
          Will be called when the dependencies of this NoInterfaceViewJNDIBinder are resolved and this MC bean reaches the START state.
 void onStop()
          Does any relevant cleanup
 void setEndpointContext(org.jboss.kernel.spi.dependency.KernelControllerContext endpointContext)
           
abstract  void unbindNoInterfaceView()
          Unbind the no-interface view
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endpointContext

protected org.jboss.kernel.spi.dependency.KernelControllerContext endpointContext
The endpoint for which this NoInterfaceViewJNDIBinder holds an no-interface view


beanClass

protected java.lang.Class<?> beanClass
The bean class for which the no-interface view corresponds


sessionBeanMetadata

protected T extends org.jboss.metadata.ejb.jboss.JBossSessionBean31MetaData sessionBeanMetadata
The bean metadata


jndiCtx

protected javax.naming.Context jndiCtx
JNDI naming context

Constructor Detail

NoInterfaceViewJNDIBinder

protected NoInterfaceViewJNDIBinder(javax.naming.Context ctx,
                                    java.lang.Class<?> beanClass,
                                    T sessionBeanMetadata)
Constructor

Parameters:
beanClass -
sessionBeanMetadata -
Method Detail

getNoInterfaceViewJndiBinder

public static <T extends org.jboss.metadata.ejb.jboss.JBossSessionBean31MetaData> NoInterfaceViewJNDIBinder<T> getNoInterfaceViewJndiBinder(javax.naming.Context ctx,
                                                                                                                                            java.lang.Class<?> beanClass,
                                                                                                                                            T sessionBeanMetadata)
Returns an appropriate instance of NoInterfaceViewJNDIBinder based on the sessionBeanMetadata

Parameters:
ctx - JNDI naming context into which this NoInterfaceViewJNDIBinder will be responsible for binding/unbinding objects
beanClass - Bean class
sessionBeanMetadata - Session bean metadata of the bean class
Returns:

bindNoInterfaceView

public abstract void bindNoInterfaceView()
                                  throws javax.naming.NamingException
Bind the no-interface view

Throws:
javax.naming.NamingException - If any exception while binding to JNDI

unbindNoInterfaceView

public abstract void unbindNoInterfaceView()
                                    throws javax.naming.NamingException
Unbind the no-interface view

Throws:
javax.naming.NamingException - If any exception while unbinding from JNDI

onStart

public void onStart()
             throws java.lang.Exception
Will be called when the dependencies of this NoInterfaceViewJNDIBinder are resolved and this MC bean reaches the START state. At this point, the endpointContext associated with this NoInterfaceViewJNDIBinder is injected and is at a minimal of DESCRIBED state. We now create a no-interface view for the corresponding bean. Note: No validations (like whether the bean is eligible for no-interface view) is done at this stage. It's assumed that the presence of a NoInterfaceViewJNDIBinder indicates that the corresponding bean is eligible for no-interface view.

Throws:
java.lang.Exception

onStop

public void onStop()
            throws java.lang.Exception
Does any relevant cleanup

Throws:
java.lang.Exception

setEndpointContext

public void setEndpointContext(org.jboss.kernel.spi.dependency.KernelControllerContext endpointContext)
                        throws java.lang.Exception
Parameters:
endpointContext - The KernelControllerContext corresponding to the endpoint
Throws:
java.lang.Exception

getJNDINameResolver

protected org.jboss.metadata.ejb.jboss.jndi.resolver.spi.SessionBean31JNDINameResolver getJNDINameResolver()
Returns the jndi name resolver, which will be responsible for returning the appropriate jndi names for various views of the session bean

Returns: