org.ow2.jasmine.monitoring.eventswitch.connectors
Class EJB3Connector<BeanType>

java.lang.Object
  extended by org.ow2.jasmine.monitoring.eventswitch.connectors.EJB3Connector<BeanType>
Type Parameters:
BeanType - Type of bean accessed using this wrapper. This must be set to the remote interface of the bean, bean can be stateful or stateless.

public class EJB3Connector<BeanType>
extends java.lang.Object

Defines an abstract EJB3 connector.


Constructor Summary
EJB3Connector()
           
 
Method Summary
 void connect()
          Obtains the reference to the wanted stateless or stateful bean using a given configuration.
 void disconnect()
          Sets the reference to the wanted stateless or stateful bean to null.
protected  BeanType getBean()
          Returns a reference to the stateful or stateless bean.
 void setConfiguration(java.util.Map<java.lang.String,java.lang.String> conf)
          Sets the configuration to use for the EJB connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EJB3Connector

public EJB3Connector()
Method Detail

setConfiguration

public final void setConfiguration(java.util.Map<java.lang.String,java.lang.String> conf)
Sets the configuration to use for the EJB connection.

Parameters:
conf - Configuration: configures all Context environment variables as well as the object name to look for. It contains mappings to: - Any number of string constants defined in Context. Example: to set the Context.INITIAL_CONTEXT_FACTORY on the Map conf to factory, use: conf.put("Context.INITIAL_CONTEXT_FACTORY", factory); - The "Wrapper.LOOKUP_BEAN" key, the value of which is looked up on the server and set as remote bean. That bean is at @link MuleEJB3Wrapper#getBean()}.

getBean

protected final BeanType getBean()
                          throws javax.naming.NamingException,
                                 java.io.IOException
Returns a reference to the stateful or stateless bean. It will call connect() if the reference hadn't been set yet.

Returns:
Reference to the stateful or stateless bean.
Throws:
javax.naming.NamingException - On naming failure.
java.io.IOException - On configuration file failure.

connect

public void connect()
             throws javax.naming.NamingException,
                    java.io.IOException
Obtains the reference to the wanted stateless or stateful bean using a given configuration. This will create the initial Context and set the bean reference. If no security manager has been defined, the default RMI security manager will be created.

Throws:
javax.naming.NamingException - On naming failure.
java.io.IOException - On configuration file failure.
See Also:
MuleEJB3Wrapper#setConfiguration(Map), MuleEJB3Wrapper#getBean()

disconnect

public void disconnect()
Sets the reference to the wanted stateless or stateful bean to null.



Copyright © 2011 OW2 Consortium. All Rights Reserved.