Package org.apache.catalina.mbeans
Class MBeanFactory
java.lang.Object
org.apache.catalina.mbeans.MBeanFactory
- Author:
- Amy Roh
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateAjpConnector
(String parent, String address, int port) Create a new AjpConnectorcreateDataSourceRealm
(String parent, String dataSourceName, String roleNameCol, String userCredCol, String userNameCol, String userRoleTable, String userTable) Create a new DataSource Realm.createHttpConnector
(String parent, String address, int port) Create a new HttpConnectorcreateHttpsConnector
(String parent, String address, int port) Create a new HttpsConnectorcreateJDBCRealm
(String parent, String driverName, String connectionName, String connectionPassword, String connectionURL) Deprecated.This method will be removed in Tomcat 10.createJNDIRealm
(String parent) Create a new JNDI Realm.createMemoryRealm
(String parent) Create a new Memory Realm.createStandardContext
(String parent, String path, String docBase) Create a new StandardContext.createStandardContext
(String parent, String path, String docBase, boolean xmlValidation, boolean xmlNamespaceAware) Create a new StandardContext.createStandardHost
(String parent, String name, String appBase, boolean autoDeploy, boolean deployOnStartup, boolean deployXML, boolean unpackWARs) Create a new StandardHost.createStandardManager
(String parent) Create a new StandardManager.createStandardServiceEngine
(String domain, String defaultHost, String baseDir) Creates a new StandardService and StandardEngine.createUserDatabaseRealm
(String parent, String resourceName) Create a new UserDatabaseRealm.createValve
(String className, String parent) Create a new Valve and associate it with aContainer
.createWebappLoader
(String parent) Create a new Web Application Loader.void
removeConnector
(String name) Remove an existing Connector.void
removeContext
(String contextName) Remove an existing Context.void
removeHost
(String name) Remove an existing Host.void
removeLoader
(String name) Remove an existing Loader.void
removeManager
(String name) Remove an existing Manager.void
removeRealm
(String name) Remove an existing Realm.void
removeService
(String name) Remove an existing Service.void
removeValve
(String name) Remove an existing Valve.void
setContainer
(Object container) Set the container that this factory was created for.
-
Field Details
-
sm
-
-
Constructor Details
-
MBeanFactory
public MBeanFactory()
-
-
Method Details
-
setContainer
Set the container that this factory was created for.- Parameters:
container
- The associated container
-
createAjpConnector
Create a new AjpConnector- Parameters:
parent
- MBean Name of the associated parent componentaddress
- The IP address on which to bindport
- TCP port number to listen on- Returns:
- the object name of the created connector
- Throws:
Exception
- if an MBean cannot be created or registered
-
createDataSourceRealm
public String createDataSourceRealm(String parent, String dataSourceName, String roleNameCol, String userCredCol, String userNameCol, String userRoleTable, String userTable) throws Exception Create a new DataSource Realm.- Parameters:
parent
- MBean Name of the associated parent componentdataSourceName
- the datasource nameroleNameCol
- the column name for the role namesuserCredCol
- the column name for the user credentialsuserNameCol
- the column name for the user namesuserRoleTable
- the table name for the roles tableuserTable
- the table name for the users- Returns:
- the object name of the created realm
- Throws:
Exception
- if an MBean cannot be created or registered
-
createHttpConnector
Create a new HttpConnector- Parameters:
parent
- MBean Name of the associated parent componentaddress
- The IP address on which to bindport
- TCP port number to listen on- Returns:
- the object name of the created connector
- Throws:
Exception
- if an MBean cannot be created or registered
-
createHttpsConnector
Create a new HttpsConnector- Parameters:
parent
- MBean Name of the associated parent componentaddress
- The IP address on which to bindport
- TCP port number to listen on- Returns:
- the object name of the created connector
- Throws:
Exception
- if an MBean cannot be created or registered
-
createJDBCRealm
@Deprecated public String createJDBCRealm(String parent, String driverName, String connectionName, String connectionPassword, String connectionURL) throws Exception Deprecated.This method will be removed in Tomcat 10. Use a DataSourceRealm instead.Create a new JDBC Realm.- Parameters:
parent
- MBean Name of the associated parent componentdriverName
- JDBC driver nameconnectionName
- the user name for the connectionconnectionPassword
- the password for the connectionconnectionURL
- the connection URL to the database- Returns:
- the object name of the created realm
- Throws:
Exception
- if an MBean cannot be created or registered
-
createJNDIRealm
Create a new JNDI Realm.- Parameters:
parent
- MBean Name of the associated parent component- Returns:
- the object name of the created realm
- Throws:
Exception
- if an MBean cannot be created or registered
-
createMemoryRealm
Create a new Memory Realm.- Parameters:
parent
- MBean Name of the associated parent component- Returns:
- the object name of the created realm
- Throws:
Exception
- if an MBean cannot be created or registered
-
createStandardContext
Create a new StandardContext.- Parameters:
parent
- MBean Name of the associated parent componentpath
- The context path for this ContextdocBase
- Document base directory (or WAR) for this Context- Returns:
- the object name of the created context
- Throws:
Exception
- if an MBean cannot be created or registered
-
createStandardContext
public String createStandardContext(String parent, String path, String docBase, boolean xmlValidation, boolean xmlNamespaceAware) throws Exception Create a new StandardContext.- Parameters:
parent
- MBean Name of the associated parent componentpath
- The context path for this ContextdocBase
- Document base directory (or WAR) for this ContextxmlValidation
- if XML descriptors should be validatedxmlNamespaceAware
- if the XML processor should namespace aware- Returns:
- the object name of the created context
- Throws:
Exception
- if an MBean cannot be created or registered
-
createStandardHost
public String createStandardHost(String parent, String name, String appBase, boolean autoDeploy, boolean deployOnStartup, boolean deployXML, boolean unpackWARs) throws Exception Create a new StandardHost.- Parameters:
parent
- MBean Name of the associated parent componentname
- Unique name of this HostappBase
- Application base directory nameautoDeploy
- Should we auto deploy?deployOnStartup
- Deploy on server startup?deployXML
- Should we deploy Context XML config files property?unpackWARs
- Should we unpack WARs when auto deploying?- Returns:
- the object name of the created host
- Throws:
Exception
- if an MBean cannot be created or registered
-
createStandardServiceEngine
public String createStandardServiceEngine(String domain, String defaultHost, String baseDir) throws Exception Creates a new StandardService and StandardEngine.- Parameters:
domain
- Domain name for the container instancedefaultHost
- Name of the default host to be used in the EnginebaseDir
- Base directory value for Engine- Returns:
- the object name of the created service
- Throws:
Exception
- if an MBean cannot be created or registered
-
createStandardManager
Create a new StandardManager.- Parameters:
parent
- MBean Name of the associated parent component- Returns:
- the object name of the created manager
- Throws:
Exception
- if an MBean cannot be created or registered
-
createUserDatabaseRealm
Create a new UserDatabaseRealm.- Parameters:
parent
- MBean Name of the associated parent componentresourceName
- Global JNDI resource name of the associated UserDatabase- Returns:
- the object name of the created realm
- Throws:
Exception
- if an MBean cannot be created or registered
-
createValve
Create a new Valve and associate it with aContainer
.- Parameters:
className
- The fully qualified class name of theValve
to createparent
- The MBean name of the associated parentContainer
.- Returns:
- The MBean name of the
Valve
that was created ornull
if theValve
does not implementJmxEnabled
. - Throws:
Exception
- if an MBean cannot be created or registered
-
createWebappLoader
Create a new Web Application Loader.- Parameters:
parent
- MBean Name of the associated parent component- Returns:
- the object name of the created loader
- Throws:
Exception
- if an MBean cannot be created or registered
-
removeConnector
Remove an existing Connector.- Parameters:
name
- MBean Name of the component to remove- Throws:
Exception
- if a component cannot be removed
-
removeContext
Remove an existing Context.- Parameters:
contextName
- MBean Name of the component to remove- Throws:
Exception
- if a component cannot be removed
-
removeHost
Remove an existing Host.- Parameters:
name
- MBean Name of the component to remove- Throws:
Exception
- if a component cannot be removed
-
removeLoader
Remove an existing Loader.- Parameters:
name
- MBean Name of the component to remove- Throws:
Exception
- if a component cannot be removed
-
removeManager
Remove an existing Manager.- Parameters:
name
- MBean Name of the component to remove- Throws:
Exception
- if a component cannot be removed
-
removeRealm
Remove an existing Realm.- Parameters:
name
- MBean Name of the component to remove- Throws:
Exception
- if a component cannot be removed
-
removeService
Remove an existing Service.- Parameters:
name
- MBean Name of the component to remove- Throws:
Exception
- if a component cannot be removed
-
removeValve
Remove an existing Valve.- Parameters:
name
- MBean Name of the component to remove- Throws:
Exception
- if a component cannot be removed
-