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 class
MEJBMBeanServerConnectionFactory.MEJBProxy
MEJB proxy.
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_JAAS_FILE
Default JAAS file name.static String
DEFAULT_JNDI_INITIAL_CTX_FACTORY
Default JOnAS initial context factory.static String
DEFAULT_JNDI_MEJB_PATH
Default path for MEJB on JNDI.static String
DEFAULT_PROVIDER_URI
Default provider URI.protected String
initialContextFactory
The initial context to use.protected String
jaasEntry
JAAS entry to use.protected String
jaasFile
JAAS configuration file.protected Context
jndiContext
The JNDI context.protected Logger
logger
The logger.protected String
mejbJndiPath
MEJB JNDI path.protected String
password
Password to use.protected String
username
User name to use.
-
Constructor Summary
Constructors Constructor Description MEJBMBeanServerConnectionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MBeanServerConnection
createConnection(Hashtable<String,Object> props)
Create the MBean server proxy connection.void
destroy()
Destroys the factory and any underlying IO sockets.MBeanServerConnection
getServerConnection(RuntimeConfiguration configuration)
Create a new MBean server connection.void
handle(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:
getServerConnection
in 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:
destroy
in interfaceMBeanServerConnectionFactory
-
handle
public void handle(Callback[] callbacks) throws UnsupportedCallbackException
- Specified by:
handle
in interfaceCallbackHandler
- Throws:
UnsupportedCallbackException
-
-