Class MEJBMBeanServerConnectionFactory
- java.lang.Object
-
- org.codehaus.cargo.container.jonas.internal.MEJBMBeanServerConnectionFactory
-
- All Implemented Interfaces:
CallbackHandler,MBeanServerConnectionFactory
public class MEJBMBeanServerConnectionFactory extends Object implements MBeanServerConnectionFactory, CallbackHandler
Server connection factory based on the MEJB API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classMEJBMBeanServerConnectionFactory.MEJBProxyMEJB proxy.
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_JAAS_FILEDefault JAAS file name.static StringDEFAULT_JNDI_INITIAL_CTX_FACTORYDefault JOnAS initial context factory.static StringDEFAULT_JNDI_MEJB_PATHDefault path for MEJB on JNDI.static StringDEFAULT_PROVIDER_URIDefault provider URI.protected StringinitialContextFactoryThe initial context to use.protected StringjaasEntryJAAS entry to use.protected StringjaasFileJAAS configuration file.protected ContextjndiContextThe JNDI context.protected LoggerloggerThe logger.protected StringmejbJndiPathMEJB JNDI path.protected StringpasswordPassword to use.protected StringusernameUser name to use.
-
Constructor Summary
Constructors Constructor Description MEJBMBeanServerConnectionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MBeanServerConnectioncreateConnection(Hashtable<String,Object> props)Create the MBean server proxy connection.voiddestroy()Destroys the factory and any underlying IO sockets.MBeanServerConnectiongetServerConnection(RuntimeConfiguration configuration)Create a new MBean server connection.voidhandle(Callback[] callbacks)protected Hashtable<String,Object>readConfiguration(RuntimeConfiguration configuration)Fills the private variables based on the runtime configuration.
-
-
-
Field Detail
-
DEFAULT_JNDI_INITIAL_CTX_FACTORY
public static final String DEFAULT_JNDI_INITIAL_CTX_FACTORY
Default JOnAS initial context factory.- See Also:
- Constant Field Values
-
DEFAULT_PROVIDER_URI
public static final String DEFAULT_PROVIDER_URI
Default provider URI.- See Also:
- Constant Field Values
-
DEFAULT_JNDI_MEJB_PATH
public static final String DEFAULT_JNDI_MEJB_PATH
Default path for MEJB on JNDI.- See Also:
- Constant Field Values
-
DEFAULT_JAAS_FILE
public static final String DEFAULT_JAAS_FILE
Default JAAS file name.- See Also:
- Constant Field Values
-
logger
protected Logger logger
The logger.
-
mejbJndiPath
protected String mejbJndiPath
MEJB JNDI path.
-
initialContextFactory
protected String initialContextFactory
The initial context to use.
-
jaasFile
protected String jaasFile
JAAS configuration file.
-
jaasEntry
protected String jaasEntry
JAAS entry to use.
-
username
protected String username
User name to use.
-
password
protected String password
Password to use.
-
jndiContext
protected Context jndiContext
The JNDI context.
-
-
Method Detail
-
getServerConnection
public MBeanServerConnection getServerConnection(RuntimeConfiguration configuration) throws Exception
Create a new MBean server connection.- Specified by:
getServerConnectionin interfaceMBeanServerConnectionFactory- Parameters:
configuration- Runtime Configuration- Returns:
- a MBeanServerConnection
- Throws:
Exception- if the connection cannot be done
-
readConfiguration
protected Hashtable<String,Object> readConfiguration(RuntimeConfiguration configuration)
Fills the private variables based on the runtime configuration.- Parameters:
configuration- Runtime configuration.- Returns:
- Properties to use for the InitialContext.
-
createConnection
protected MBeanServerConnection createConnection(Hashtable<String,Object> props) throws Exception
Create the MBean server proxy connection.- Parameters:
props- Properties to use for the InitialContext.- Returns:
- The MEJB proxy.
- Throws:
Exception- If anything fails.
-
destroy
public void destroy()
Destroys the factory and any underlying IO sockets.- Specified by:
destroyin interfaceMBeanServerConnectionFactory
-
handle
public void handle(Callback[] callbacks) throws UnsupportedCallbackException
- Specified by:
handlein interfaceCallbackHandler- Throws:
UnsupportedCallbackException
-
-