You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2011/10/22 23:14:03 UTC
svn commit: r1187796 - /tomcat/trunk/java/org/apache/catalina/mbeans/
Author: markt
Date: Sat Oct 22 21:14:02 2011
New Revision: 1187796
URL: http://svn.apache.org/viewvc?rev=1187796&view=rev
Log:
Whitespace removal from /java/org/apache/catalina/mbeans
Modified:
tomcat/trunk/java/org/apache/catalina/mbeans/ClassNameMBean.java
tomcat/trunk/java/org/apache/catalina/mbeans/ConnectorMBean.java
tomcat/trunk/java/org/apache/catalina/mbeans/Constants.java
tomcat/trunk/java/org/apache/catalina/mbeans/ContainerMBean.java
tomcat/trunk/java/org/apache/catalina/mbeans/ContextEnvironmentMBean.java
tomcat/trunk/java/org/apache/catalina/mbeans/ContextMBean.java
tomcat/trunk/java/org/apache/catalina/mbeans/ContextResourceLinkMBean.java
tomcat/trunk/java/org/apache/catalina/mbeans/ContextResourceMBean.java
tomcat/trunk/java/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java
tomcat/trunk/java/org/apache/catalina/mbeans/GroupMBean.java
tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java
tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java
tomcat/trunk/java/org/apache/catalina/mbeans/MemoryUserDatabaseMBean.java
tomcat/trunk/java/org/apache/catalina/mbeans/NamingResourcesMBean.java
tomcat/trunk/java/org/apache/catalina/mbeans/RoleMBean.java
tomcat/trunk/java/org/apache/catalina/mbeans/ServiceMBean.java
tomcat/trunk/java/org/apache/catalina/mbeans/UserMBean.java
tomcat/trunk/java/org/apache/catalina/mbeans/mbeans-descriptors.xml
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/ClassNameMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/ClassNameMBean.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/ClassNameMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/ClassNameMBean.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/ConnectorMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/ConnectorMBean.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/ConnectorMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/ConnectorMBean.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -98,7 +98,7 @@ public class ConnectorMBean extends Clas
}
-
+
/**
* Set the value of a specific attribute of this MBean.
*
@@ -135,7 +135,7 @@ public class ConnectorMBean extends Clas
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
}
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/Constants.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/Constants.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/Constants.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/Constants.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/ContainerMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/ContainerMBean.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/ContainerMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/ContainerMBean.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -52,28 +52,28 @@ public class ContainerMBean extends Base
* @exception RuntimeOperationsException if an IllegalArgumentException
* occurs
*/
- public ContainerMBean()
+ public ContainerMBean()
throws MBeanException, RuntimeOperationsException {
-
+
super();
}
-
+
/**
* Add a new child Container to those associated with this Container,
* if supported. Won't start the child yet. Has to be started with a call to
* Start method after necessary configurations are done.
- *
+ *
* @param type ClassName of the child to be added
* @param name Name of the child to be added
- *
+ *
* @exception MBeanException if the child cannot be added
*/
- public void addChild(String type, String name) throws MBeanException{
+ public void addChild(String type, String name) throws MBeanException{
Container contained = null;
try {
contained = (Container)Class.forName(type).newInstance();
contained.setName(name);
-
+
if(contained instanceof StandardHost){
HostConfig config = new HostConfig();
contained.addLifecycleListener(config);
@@ -89,9 +89,9 @@ public class ContainerMBean extends Base
} catch (ClassNotFoundException e) {
throw new MBeanException(e);
}
-
+
boolean oldValue= true;
-
+
ContainerBase container = null;
try {
container = (ContainerBase)getManagedResource();
@@ -113,7 +113,7 @@ public class ContainerMBean extends Base
}
}
}
-
+
/**
* Remove an existing child Container from association with this parent
* Container.
@@ -135,15 +135,15 @@ public class ContainerMBean extends Base
}
}
}
-
+
/**
* Adds a valve to this Container instance.
*
* @param valveType ClassName of the valve to be added
- *
+ *
* @exception MBeanException if a component cannot be removed
*/
- public String addValve(String valveType) throws MBeanException{
+ public String addValve(String valveType) throws MBeanException{
Valve valve = null;
try {
valve = (Valve)Class.forName(valveType).newInstance();
@@ -154,11 +154,11 @@ public class ContainerMBean extends Base
} catch (ClassNotFoundException e) {
throw new MBeanException(e);
}
-
+
if (valve == null) {
return null;
}
-
+
try {
ContainerBase container = (ContainerBase)getManagedResource();
container.addValve(valve);
@@ -169,10 +169,10 @@ public class ContainerMBean extends Base
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
return ((LifecycleMBeanBase)valve).getObjectName().toString();
}
-
+
/**
* Remove an existing Valve.
*
@@ -191,7 +191,7 @@ public class ContainerMBean extends Base
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
ObjectName oname;
try {
oname = new ObjectName(valveName);
@@ -200,7 +200,7 @@ public class ContainerMBean extends Base
} catch (NullPointerException e) {
throw new MBeanException(e);
}
-
+
if(container != null){
Valve[] valves = container.getPipeline().getValves();
for (int i = 0; i < valves.length; i++) {
@@ -211,7 +211,7 @@ public class ContainerMBean extends Base
}
}
}
-
+
/**
* Add a LifecycleEvent listener to this component.
*
@@ -228,7 +228,7 @@ public class ContainerMBean extends Base
} catch (ClassNotFoundException e) {
throw new MBeanException(e);
}
-
+
if(listener != null){
try {
ContainerBase container = (ContainerBase)getManagedResource();
@@ -242,12 +242,12 @@ public class ContainerMBean extends Base
}
}
}
-
+
/**
* Remove a LifecycleEvent listeners from this component.
*
- * @param type The ClassName of the listeners to be removed.
- * Note that all the listeners having given ClassName will be removed.
+ * @param type The ClassName of the listeners to be removed.
+ * Note that all the listeners having given ClassName will be removed.
*/
public void removeLifeCycleListeners(String type) throws MBeanException{
ContainerBase container=null;
@@ -260,7 +260,7 @@ public class ContainerMBean extends Base
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
LifecycleListener[] listeners = container.findLifecycleListeners();
for(LifecycleListener listener: listeners){
if(listener.getClass().getName().equals(type)){
@@ -269,7 +269,7 @@ public class ContainerMBean extends Base
}
}
-
+
/**
* List the class name of each of the lifecycle listeners added to this
* container.
@@ -296,7 +296,7 @@ public class ContainerMBean extends Base
return result.toArray(new String[result.size()]);
}
-
+
/**
* List the class name of each of the container listeners added to this
* container.
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/ContextEnvironmentMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/ContextEnvironmentMBean.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/ContextEnvironmentMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/ContextEnvironmentMBean.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -67,7 +67,7 @@ public class ContextEnvironmentMBean ext
// ------------------------------------------------------------- Attributes
-
+
/**
* Set the value of a specific attribute of this MBean.
*
@@ -87,7 +87,7 @@ public class ContextEnvironmentMBean ext
ReflectionException {
super.setAttribute(attribute);
-
+
ContextEnvironment ce = null;
try {
ce = (ContextEnvironment) getManagedResource();
@@ -96,12 +96,12 @@ public class ContextEnvironmentMBean ext
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
- // cannot use side-effects. It's removed and added back each time
+
+ // cannot use side-effects. It's removed and added back each time
// there is a modification in a resource.
NamingResources nr = ce.getNamingResources();
nr.removeEnvironment(ce.getName());
nr.addEnvironment(ce);
}
-
+
}
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/ContextMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/ContextMBean.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/ContextMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/ContextMBean.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,16 +32,16 @@ import org.apache.catalina.deploy.Securi
public class ContextMBean extends ContainerMBean {
public ContextMBean() throws MBeanException, RuntimeOperationsException {
-
+
super();
}
-
+
/**
* Return the set of application parameters for this application.
*/
public String[] findApplicationParameters() throws MBeanException {
-
- Context context;
+
+ Context context;
try {
context = (Context)getManagedResource();
} catch (InstanceNotFoundException e) {
@@ -51,24 +51,24 @@ public class ContextMBean extends Contai
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
ApplicationParameter[] params = context.findApplicationParameters();
String[] stringParams = new String[params.length];
for(int counter=0; counter < params.length; counter++){
stringParams[counter]=params[counter].toString();
}
-
+
return stringParams;
-
+
}
-
+
/**
* Return the security constraints for this web application.
* If there are none, a zero-length array is returned.
*/
public String[] findConstraints() throws MBeanException {
- Context context;
+ Context context;
try {
context = (Context)getManagedResource();
} catch (InstanceNotFoundException e) {
@@ -78,17 +78,17 @@ public class ContextMBean extends Contai
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
SecurityConstraint[] constraints = context.findConstraints();
String[] stringConstraints = new String[constraints.length];
for(int counter=0; counter < constraints.length; counter++){
stringConstraints[counter]=constraints[counter].toString();
}
-
+
return stringConstraints;
-
+
}
-
+
/**
* Return the error page entry for the specified HTTP error code,
* if any; otherwise return <code>null</code>.
@@ -97,7 +97,7 @@ public class ContextMBean extends Contai
*/
public String findErrorPage(int errorCode) throws MBeanException {
- Context context;
+ Context context;
try {
context = (Context)getManagedResource();
} catch (InstanceNotFoundException e) {
@@ -107,11 +107,11 @@ public class ContextMBean extends Contai
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
return context.findErrorPage(errorCode).toString();
-
+
}
-
+
/**
* Return the error page entry for the specified Java exception type,
* if any; otherwise return <code>null</code>.
@@ -120,7 +120,7 @@ public class ContextMBean extends Contai
*/
public String findErrorPage(String exceptionType) throws MBeanException {
- Context context;
+ Context context;
try {
context = (Context)getManagedResource();
} catch (InstanceNotFoundException e) {
@@ -130,18 +130,18 @@ public class ContextMBean extends Contai
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
return context.findErrorPage(exceptionType).toString();
-
+
}
-
+
/**
* Return the set of defined error pages for all specified error codes
* and exception types.
*/
public String[] findErrorPages() throws MBeanException {
-
- Context context;
+
+ Context context;
try {
context = (Context)getManagedResource();
} catch (InstanceNotFoundException e) {
@@ -151,17 +151,17 @@ public class ContextMBean extends Contai
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
ErrorPage[] pages = context.findErrorPages();
String[] stringPages = new String[pages.length];
for(int counter=0; counter < pages.length; counter++){
stringPages[counter]=pages[counter].toString();
}
-
+
return stringPages;
-
+
}
-
+
/**
* Return the filter definition for the specified filter name, if any;
* otherwise return <code>null</code>.
@@ -169,8 +169,8 @@ public class ContextMBean extends Contai
* @param name Filter name to look up
*/
public String findFilterDef(String name) throws MBeanException {
-
- Context context;
+
+ Context context;
try {
context = (Context)getManagedResource();
} catch (InstanceNotFoundException e) {
@@ -180,18 +180,18 @@ public class ContextMBean extends Contai
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
FilterDef filterDef = context.findFilterDef(name);
return filterDef.toString();
-
+
}
-
+
/**
* Return the set of defined filters for this Context.
*/
public String[] findFilterDefs() throws MBeanException {
-
- Context context;
+
+ Context context;
try {
context = (Context)getManagedResource();
} catch (InstanceNotFoundException e) {
@@ -201,23 +201,23 @@ public class ContextMBean extends Contai
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
ApplicationParameter[] params = context.findApplicationParameters();
String[] stringParams = new String[params.length];
for(int counter=0; counter < params.length; counter++){
stringParams[counter]=params[counter].toString();
}
-
+
return stringParams;
-
+
}
-
+
/**
* Return the set of filter mappings for this Context.
*/
public String[] findFilterMaps() throws MBeanException {
-
- Context context;
+
+ Context context;
try {
context = (Context)getManagedResource();
} catch (InstanceNotFoundException e) {
@@ -227,15 +227,15 @@ public class ContextMBean extends Contai
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
FilterMap[] maps = context.findFilterMaps();
String[] stringMaps = new String[maps.length];
for(int counter=0; counter < maps.length; counter++){
stringMaps[counter]=maps[counter].toString();
}
-
+
return stringMaps;
-
+
}
}
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/ContextResourceLinkMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/ContextResourceLinkMBean.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/ContextResourceLinkMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/ContextResourceLinkMBean.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -83,7 +83,7 @@ public class ContextResourceLinkMBean ex
public Object getAttribute(String name)
throws AttributeNotFoundException, MBeanException,
ReflectionException {
-
+
// Validate the input parameters
if (name == null)
throw new RuntimeOperationsException
@@ -98,14 +98,14 @@ public class ContextResourceLinkMBean ex
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
String value = null;
if ("global".equals(name)) {
return (cl.getGlobal());
} else if ("description".equals(name)) {
return (cl.getDescription());
} else if ("name".equals(name)) {
- return (cl.getName());
+ return (cl.getName());
} else if ("type".equals(name)) {
return (cl.getType());
} else {
@@ -115,11 +115,11 @@ public class ContextResourceLinkMBean ex
("Cannot find attribute "+name);
}
}
-
+
return value;
-
+
}
-
+
/**
* Set the value of a specific attribute of this MBean.
*
@@ -137,20 +137,20 @@ public class ContextResourceLinkMBean ex
public void setAttribute(Attribute attribute)
throws AttributeNotFoundException, MBeanException,
ReflectionException {
-
+
// Validate the input parameters
if (attribute == null)
throw new RuntimeOperationsException
(new IllegalArgumentException("Attribute is null"),
"Attribute is null");
-
+
String name = attribute.getName();
Object value = attribute.getValue();
if (name == null)
throw new RuntimeOperationsException
(new IllegalArgumentException("Attribute name is null"),
- "Attribute name is null");
-
+ "Attribute name is null");
+
ContextResourceLink crl = null;
try {
crl = (ContextResourceLink) getManagedResource();
@@ -159,24 +159,24 @@ public class ContextResourceLinkMBean ex
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
if ("global".equals(name)) {
crl.setGlobal((String)value);
} else if ("description".equals(name)) {
crl.setDescription((String)value);
} else if ("name".equals(name)) {
- crl.setName((String)value);
+ crl.setName((String)value);
} else if ("type".equals(name)) {
crl.setType((String)value);
} else {
crl.setProperty(name, ""+value);
}
-
- // cannot use side-effects. It's removed and added back each time
+
+ // cannot use side-effects. It's removed and added back each time
// there is a modification in a resource.
NamingResources nr = crl.getNamingResources();
nr.removeResourceLink(crl.getName());
nr.addResourceLink(crl);
}
-
+
}
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/ContextResourceMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/ContextResourceMBean.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/ContextResourceMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/ContextResourceMBean.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -84,7 +84,7 @@ public class ContextResourceMBean extend
public Object getAttribute(String name)
throws AttributeNotFoundException, MBeanException,
ReflectionException {
-
+
// Validate the input parameters
if (name == null)
throw new RuntimeOperationsException
@@ -99,16 +99,16 @@ public class ContextResourceMBean extend
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
String value = null;
if ("auth".equals(name)) {
return (cr.getAuth());
} else if ("description".equals(name)) {
return (cr.getDescription());
} else if ("name".equals(name)) {
- return (cr.getName());
+ return (cr.getName());
} else if ("scope".equals(name)) {
- return (cr.getScope());
+ return (cr.getScope());
} else if ("type".equals(name)) {
return (cr.getType());
} else {
@@ -118,12 +118,12 @@ public class ContextResourceMBean extend
("Cannot find attribute "+name);
}
}
-
+
return value;
-
+
}
-
+
/**
* Set the value of a specific attribute of this MBean.
*
@@ -152,8 +152,8 @@ public class ContextResourceMBean extend
if (name == null)
throw new RuntimeOperationsException
(new IllegalArgumentException("Attribute name is null"),
- "Attribute name is null");
-
+ "Attribute name is null");
+
ContextResource cr = null;
try {
cr = (ContextResource) getManagedResource();
@@ -162,26 +162,26 @@ public class ContextResourceMBean extend
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
if ("auth".equals(name)) {
cr.setAuth((String)value);
} else if ("description".equals(name)) {
cr.setDescription((String)value);
} else if ("name".equals(name)) {
- cr.setName((String)value);
+ cr.setName((String)value);
} else if ("scope".equals(name)) {
- cr.setScope((String)value);
+ cr.setScope((String)value);
} else if ("type".equals(name)) {
cr.setType((String)value);
} else {
cr.setProperty(name, ""+value);
}
-
- // cannot use side-effects. It's removed and added back each time
+
+ // cannot use side-effects. It's removed and added back each time
// there is a modification in a resource.
NamingResources nr = cr.getNamingResources();
nr.removeResource(cr.getName());
nr.addResource(cr);
}
-
+
}
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/GroupMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/GroupMBean.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/GroupMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/GroupMBean.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -51,10 +51,10 @@ import org.apache.tomcat.util.res.String
* properties for configuring JMX.
*/
public class JmxRemoteLifecycleListener implements LifecycleListener {
-
+
private static final Log log =
LogFactory.getLog(JmxRemoteLifecycleListener.class);
-
+
/**
* The string resources for this package.
*/
@@ -74,7 +74,7 @@ public class JmxRemoteLifecycleListener
protected boolean useLocalPorts = false;
protected JMXConnectorServer csPlatform = null;
-
+
/**
* Get the port on which the Platform RMI server is exported. This is the
* port that is normally chosen by the RMI stack.
@@ -83,7 +83,7 @@ public class JmxRemoteLifecycleListener
public int getRmiServerPortPlatform() {
return rmiServerPortPlatform;
}
-
+
/**
* Set the port on which the Platform RMI server is exported. This is the
* port that is normally chosen by the RMI stack.
@@ -92,7 +92,7 @@ public class JmxRemoteLifecycleListener
public void setRmiServerPortPlatform(int theRmiServerPortPlatform) {
rmiServerPortPlatform = theRmiServerPortPlatform;
}
-
+
/**
* Get the port on which the Platform RMI registry is exported.
* @return The port number
@@ -100,7 +100,7 @@ public class JmxRemoteLifecycleListener
public int getRmiRegistryPortPlatform() {
return rmiRegistryPortPlatform;
}
-
+
/**
* Set the port on which the Platform RMI registry is exported.
* @param theRmiRegistryPortPlatform The port number
@@ -108,7 +108,7 @@ public class JmxRemoteLifecycleListener
public void setRmiRegistryPortPlatform(int theRmiRegistryPortPlatform) {
rmiRegistryPortPlatform = theRmiRegistryPortPlatform;
}
-
+
/**
* Get the flag that indicates that local ports should be used for all
* connections. If using SSH tunnels, or similar, this should be set to
@@ -118,7 +118,7 @@ public class JmxRemoteLifecycleListener
public boolean getUseLocalPorts() {
return useLocalPorts;
}
-
+
/**
* Set the flag that indicates that local ports should be used for all
* connections. If using SSH tunnels, or similar, this should be set to
@@ -129,7 +129,7 @@ public class JmxRemoteLifecycleListener
public void setUseLocalPorts(boolean useLocalPorts) {
this.useLocalPorts = useLocalPorts;
}
-
+
private void init() {
// Get all the other parameters required from the standard system
// properties. Only need to get the parameters that affect the creation
@@ -165,17 +165,17 @@ public class JmxRemoteLifecycleListener
accessFile = System.getProperty(
"com.sun.management.jmxremote.access.file",
"jmxremote.access");
-
+
loginModuleName = System.getProperty(
"com.sun.management.jmxremote.login.config");
}
-
+
@Override
public void lifecycleEvent(LifecycleEvent event) {
// When the server starts, configure JMX/RMI
if (Lifecycle.START_EVENT == event.getType()) {
- // Configure using standard jmx system properties
+ // Configure using standard jmx system properties
init();
// Prevent an attacker guessing the RMI object ID
@@ -193,7 +193,7 @@ public class JmxRemoteLifecycleListener
ssf = new SslRMIServerSocketFactory(ciphers, protocols,
clientAuth);
}
-
+
// Force the use of local ports if required
if (useLocalPorts) {
csf = new RmiClientLocalhostSocketFactory(csf);
@@ -221,7 +221,7 @@ public class JmxRemoteLifecycleListener
csPlatform = createServer("Platform", rmiRegistryPortPlatform,
rmiServerPortPlatform, env,
ManagementFactory.getPlatformMBeanServer());
-
+
} else if (Lifecycle.STOP_EVENT == event.getType()) {
destroyServer("Platform", csPlatform);
}
@@ -230,7 +230,7 @@ public class JmxRemoteLifecycleListener
private JMXConnectorServer createServer(String serverName,
int theRmiRegistryPort, int theRmiServerPort,
HashMap<String,Object> theEnv, MBeanServer theMBeanServer) {
-
+
// Create the RMI registry
try {
LocateRegistry.createRegistry(theRmiRegistryPort);
@@ -257,7 +257,7 @@ public class JmxRemoteLifecycleListener
serverName, url.toString()), e);
return null;
}
-
+
// Start the JMX server with the connection string
JMXConnectorServer cs = null;
try {
@@ -295,7 +295,7 @@ public class JmxRemoteLifecycleListener
private static final String FORCED_HOST = "localhost";
private RMIClientSocketFactory factory = null;
-
+
public RmiClientLocalhostSocketFactory(RMIClientSocketFactory theFactory) {
factory = theFactory;
}
@@ -309,6 +309,6 @@ public class JmxRemoteLifecycleListener
}
}
-
+
}
}
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -60,7 +60,7 @@ import org.apache.catalina.valves.ValveB
public class MBeanFactory {
- private static final org.apache.juli.logging.Log log =
+ private static final org.apache.juli.logging.Log log =
org.apache.juli.logging.LogFactory.getLog(MBeanFactory.class);
/**
@@ -84,7 +84,7 @@ public class MBeanFactory {
public MBeanFactory() {
super();
-
+
}
@@ -138,14 +138,14 @@ public class MBeanFactory {
}
return t;
}
-
+
/**
- * Get Parent ContainerBase to add its child component
+ * Get Parent ContainerBase to add its child component
* from parent's ObjectName
*/
- private ContainerBase getParentContainerFromParent(ObjectName pname)
+ private ContainerBase getParentContainerFromParent(ObjectName pname)
throws Exception {
-
+
String type = pname.getKeyProperty("type");
String j2eeType = pname.getKeyProperty("j2eeType");
Service service = getService(pname);
@@ -170,29 +170,29 @@ public class MBeanFactory {
}
}
return null;
-
+
}
/**
- * Get Parent ContainerBase to add its child component
+ * Get Parent ContainerBase to add its child component
* from child component's ObjectName as a String
- */
- private ContainerBase getParentContainerFromChild(ObjectName oname)
+ */
+ private ContainerBase getParentContainerFromChild(ObjectName oname)
throws Exception {
-
+
String hostName = oname.getKeyProperty("host");
String path = oname.getKeyProperty("path");
Service service = getService(oname);
StandardEngine engine = (StandardEngine) service.getContainer();
- if (hostName == null) {
+ if (hostName == null) {
// child's container is Engine
return engine;
- } else if (path == null) {
+ } else if (path == null) {
// child's container is Host
StandardHost host = (StandardHost) engine.findChild(hostName);
return host;
- } else {
+ } else {
// child's container is Context
StandardHost host = (StandardHost) engine.findChild(hostName);
path = getPathStr(path);
@@ -201,9 +201,9 @@ public class MBeanFactory {
}
}
-
+
private Service getService(ObjectName oname) throws Exception {
-
+
if (container instanceof Service) {
// Don't bother checking the domain - this is the only option
return (Service) container;
@@ -223,12 +223,12 @@ public class MBeanFactory {
if (service == null ||
!service.getObjectName().getDomain().equals(domain)) {
throw new Exception("Service with the domain is not found");
- }
+ }
return service;
}
-
-
+
+
/**
* Create a new AccessLoggerValve.
*
@@ -249,7 +249,7 @@ public class MBeanFactory {
return (oname.toString());
}
-
+
/**
* Create a new AjpConnector
@@ -265,7 +265,7 @@ public class MBeanFactory {
return createConnector(parent, address, port, true, false);
}
-
+
/**
* Create a new DataSource Realm.
*
@@ -273,8 +273,8 @@ public class MBeanFactory {
*
* @exception Exception if an MBean cannot be created or registered
*/
- public String createDataSourceRealm(String parent, String dataSourceName,
- String roleNameCol, String userCredCol, String userNameCol,
+ public String createDataSourceRealm(String parent, String dataSourceName,
+ String roleNameCol, String userCredCol, String userNameCol,
String userRoleTable, String userTable) throws Exception {
// Create a new DataSourceRealm instance
@@ -297,7 +297,7 @@ public class MBeanFactory {
return (oname.toString());
} else {
return null;
- }
+ }
}
@@ -344,10 +344,10 @@ public class MBeanFactory {
ObjectName pname = new ObjectName(parent);
Service service = getService(pname);
service.addConnector(retobj);
-
+
// Return the corresponding MBean name
ObjectName coname = retobj.getObjectName();
-
+
return (coname.toString());
}
@@ -373,7 +373,7 @@ public class MBeanFactory {
*
* @exception Exception if an MBean cannot be created or registered
*/
- public String createJDBCRealm(String parent, String driverName,
+ public String createJDBCRealm(String parent, String driverName,
String connectionName, String connectionPassword, String connectionURL)
throws Exception {
@@ -396,7 +396,7 @@ public class MBeanFactory {
return (oname.toString());
} else {
return null;
- }
+ }
}
@@ -426,7 +426,7 @@ public class MBeanFactory {
return (oname.toString());
} else {
return null;
- }
+ }
}
@@ -456,7 +456,7 @@ public class MBeanFactory {
return (oname.toString());
} else {
return null;
- }
+ }
}
@@ -503,7 +503,7 @@ public class MBeanFactory {
containerBase.getPipeline().addValve(valve);
ObjectName oname = valve.getObjectName();
return (oname.toString());
-
+
}
@@ -528,8 +528,8 @@ public class MBeanFactory {
return (oname.toString());
}
-
-
+
+
/**
* Create a new StandardContext.
*
@@ -539,13 +539,13 @@ public class MBeanFactory {
*
* @exception Exception if an MBean cannot be created or registered
*/
- public String createStandardContext(String parent,
+ public String createStandardContext(String parent,
String path,
String docBase)
throws Exception {
-
+
return createStandardContext(parent, path, docBase, false, false,
- false, false);
+ false, false);
}
@@ -558,7 +558,7 @@ public class MBeanFactory {
*
* @exception Exception if an MBean cannot be created or registered
*/
- public String createStandardContext(String parent,
+ public String createStandardContext(String parent,
String path,
String docBase,
boolean xmlValidation,
@@ -576,7 +576,7 @@ public class MBeanFactory {
context.setXmlNamespaceAware(xmlNamespaceAware);
context.setTldValidation(tldValidation);
context.setTldNamespaceAware(tldNamespaceAware);
-
+
ContextConfig contextConfig = new ContextConfig();
context.addLifecycleListener(contextConfig);
@@ -632,7 +632,7 @@ public class MBeanFactory {
String appBase,
boolean autoDeploy,
boolean deployOnStartup,
- boolean deployXML,
+ boolean deployXML,
boolean unpackWARs)
throws Exception {
@@ -644,7 +644,7 @@ public class MBeanFactory {
host.setDeployOnStartup(deployOnStartup);
host.setDeployXML(deployXML);
host.setUnpackWARs(unpackWARs);
-
+
// add HostConfig for active reloading
HostConfig hostConfig = new HostConfig();
host.addLifecycleListener(hostConfig);
@@ -666,7 +666,7 @@ public class MBeanFactory {
*
* @param domain Domain name for the container instance
* @param defaultHost Name of the default host to be used in the Engine
- * @param baseDir Base directory value for Engine
+ * @param baseDir Base directory value for Engine
*
* @exception Exception if an MBean cannot be created or registered
*/
@@ -676,7 +676,7 @@ public class MBeanFactory {
if (!(container instanceof Server)) {
throw new Exception("Container not Server");
}
-
+
StandardEngine engine = new StandardEngine();
engine.setDomain(domain);
engine.setName(domain);
@@ -686,13 +686,13 @@ public class MBeanFactory {
Service service = new StandardService();
service.setContainer(engine);
service.setName(domain);
-
+
((Server) container).addService(service);
-
+
return engine.getObjectName().toString();
}
-
-
+
+
/**
* Create a new StandardManager.
*
@@ -711,14 +711,14 @@ public class MBeanFactory {
ContainerBase containerBase = getParentContainerFromParent(pname);
if (containerBase != null) {
containerBase.setManager(manager);
- }
+ }
ObjectName oname = manager.getObjectName();
if (oname != null) {
return (oname.toString());
} else {
return null;
}
-
+
}
@@ -737,7 +737,7 @@ public class MBeanFactory {
// Create a new UserDatabaseRealm instance
UserDatabaseRealm realm = new UserDatabaseRealm();
realm.setResourceName(resourceName);
-
+
// Add the new instance to its parent component
ObjectName pname = new ObjectName(parent);
ContainerBase containerBase = getParentContainerFromParent(pname);
@@ -746,13 +746,13 @@ public class MBeanFactory {
// Return the corresponding MBean name
ObjectName oname = realm.getObjectName();
// FIXME getObjectName() returns null
- //ObjectName oname =
+ //ObjectName oname =
// MBeanUtils.createObjectName(pname.getDomain(), realm);
if (oname != null) {
return (oname.toString());
} else {
return null;
- }
+ }
}
@@ -775,13 +775,13 @@ public class MBeanFactory {
ContainerBase containerBase = getParentContainerFromParent(pname);
if (containerBase != null) {
containerBase.setLoader(loader);
- }
+ }
// FIXME add Loader.getObjectName
//ObjectName oname = loader.getObjectName();
- ObjectName oname =
+ ObjectName oname =
MBeanUtils.createObjectName(pname.getDomain(), loader);
return (oname.toString());
-
+
}
@@ -869,7 +869,7 @@ public class MBeanFactory {
} catch (Exception e) {
log.warn("Error during context [" + context.getName() + "] destroy ", e);
}
-
+
}
}
@@ -909,9 +909,9 @@ public class MBeanFactory {
ObjectName oname = new ObjectName(name);
// Acquire a reference to the component to be removed
- ContainerBase container = getParentContainerFromChild(oname);
+ ContainerBase container = getParentContainerFromChild(oname);
container.setLoader(null);
-
+
}
@@ -926,7 +926,7 @@ public class MBeanFactory {
ObjectName oname = new ObjectName(name);
// Acquire a reference to the component to be removed
- ContainerBase container = getParentContainerFromChild(oname);
+ ContainerBase container = getParentContainerFromChild(oname);
container.setManager(null);
}
@@ -943,7 +943,7 @@ public class MBeanFactory {
ObjectName oname = new ObjectName(name);
// Acquire a reference to the component to be removed
- ContainerBase container = getParentContainerFromChild(oname);
+ ContainerBase container = getParentContainerFromChild(oname);
container.setRealm(null);
}
@@ -960,10 +960,10 @@ public class MBeanFactory {
if (!(container instanceof Server)) {
throw new Exception();
}
-
+
// Acquire a reference to the component to be removed
ObjectName oname = new ObjectName(name);
- Service service = getService(oname);
+ Service service = getService(oname);
((Server) container).removeService(service);
}
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -127,7 +127,7 @@ public class MBeanUtils {
}
-
+
/**
* Create, register, and return an MBean for this
* <code>ContextEnvironment</code> object.
@@ -218,8 +218,8 @@ public class MBeanUtils {
mserver.registerMBean(mbean, oname);
return (mbean);
- }
-
+ }
+
/**
* Create, register, and return an MBean for this
@@ -345,7 +345,7 @@ public class MBeanUtils {
}
-
+
/**
* Create, register, and return an MBean for this
* <code>Role</code> object.
@@ -454,7 +454,7 @@ public class MBeanUtils {
ObjectName name = null;
try {
- Object addressObj = IntrospectionUtils.getProperty(connector, "address");
+ Object addressObj = IntrospectionUtils.getProperty(connector, "address");
Integer port = (Integer)
IntrospectionUtils.getProperty(connector, "port");
@@ -500,12 +500,12 @@ public class MBeanUtils {
name = new ObjectName(domain + ":j2eeType=WebModule,name=//" +
host.getName()+ cn.getDisplayName() +
",J2EEApplication=none,J2EEServer=none");
-
+
return (name);
}
-
+
/**
* Create an <code>ObjectName</code> for this
* <code>Service</code> object.
@@ -520,25 +520,25 @@ public class MBeanUtils {
throws MalformedObjectNameException {
ObjectName name = null;
- Object container =
+ Object container =
environment.getNamingResources().getContainer();
if (container instanceof Server) {
- name = new ObjectName(domain + ":type=Environment" +
+ name = new ObjectName(domain + ":type=Environment" +
",resourcetype=Global,name=" + environment.getName());
- } else if (container instanceof Context) {
+ } else if (container instanceof Context) {
Context context = ((Context)container);
ContextName cn = new ContextName(context.getName());
Container host = context.getParent();
- name = new ObjectName(domain + ":type=Environment" +
- ",resourcetype=Context,context=" + cn.getDisplayName() +
+ name = new ObjectName(domain + ":type=Environment" +
+ ",resourcetype=Context,context=" + cn.getDisplayName() +
",host=" + host.getName() +
",name=" + environment.getName());
- }
+ }
return (name);
}
-
-
+
+
/**
* Create an <code>ObjectName</code> for this
* <code>ContextResource</code> object.
@@ -554,28 +554,28 @@ public class MBeanUtils {
ObjectName name = null;
String quotedResourceName = ObjectName.quote(resource.getName());
- Object container =
+ Object container =
resource.getNamingResources().getContainer();
- if (container instanceof Server) {
+ if (container instanceof Server) {
name = new ObjectName(domain + ":type=Resource" +
- ",resourcetype=Global,class=" + resource.getType() +
+ ",resourcetype=Global,class=" + resource.getType() +
",name=" + quotedResourceName);
- } else if (container instanceof Context) {
+ } else if (container instanceof Context) {
Context context = ((Context)container);
ContextName cn = new ContextName(context.getName());
Container host = context.getParent();
name = new ObjectName(domain + ":type=Resource" +
- ",resourcetype=Context,context=" + cn.getDisplayName() +
+ ",resourcetype=Context,context=" + cn.getDisplayName() +
",host=" + host.getName() +
",class=" + resource.getType() +
",name=" + quotedResourceName);
}
-
+
return (name);
}
-
-
+
+
/**
* Create an <code>ObjectName</code> for this
* <code>ContextResourceLink</code> object.
@@ -591,23 +591,23 @@ public class MBeanUtils {
ObjectName name = null;
String quotedResourceLinkName
- = ObjectName.quote(resourceLink.getName());
- Object container =
+ = ObjectName.quote(resourceLink.getName());
+ Object container =
resourceLink.getNamingResources().getContainer();
- if (container instanceof Server) {
+ if (container instanceof Server) {
name = new ObjectName(domain + ":type=ResourceLink" +
- ",resourcetype=Global" +
+ ",resourcetype=Global" +
",name=" + quotedResourceLinkName);
- } else if (container instanceof Context) {
+ } else if (container instanceof Context) {
Context context = ((Context)container);
ContextName cn = new ContextName(context.getName());
Container host = context.getParent();
name = new ObjectName(domain + ":type=ResourceLink" +
- ",resourcetype=Context,context=" + cn.getDisplayName() +
+ ",resourcetype=Context,context=" + cn.getDisplayName() +
",host=" + host.getName() +
",name=" + quotedResourceLinkName);
}
-
+
return (name);
}
@@ -741,8 +741,8 @@ public class MBeanUtils {
return (name);
}
-
-
+
+
/**
* Create an <code>ObjectName</code> for this
* <code>Server</code> object.
@@ -757,19 +757,19 @@ public class MBeanUtils {
throws MalformedObjectNameException {
ObjectName name = null;
- Object container = resources.getContainer();
- if (container instanceof Server) {
- name = new ObjectName(domain + ":type=NamingResources" +
+ Object container = resources.getContainer();
+ if (container instanceof Server) {
+ name = new ObjectName(domain + ":type=NamingResources" +
",resourcetype=Global");
- } else if (container instanceof Context) {
+ } else if (container instanceof Context) {
Context context = ((Context)container);
ContextName cn = new ContextName(context.getName());
Container host = context.getParent();
- name = new ObjectName(domain + ":type=NamingResources" +
- ",resourcetype=Context,context=" + cn.getDisplayName() +
+ name = new ObjectName(domain + ":type=NamingResources" +
+ ",resourcetype=Context,context=" + cn.getDisplayName() +
",host=" + host.getName());
}
-
+
return (name);
}
@@ -793,7 +793,7 @@ public class MBeanUtils {
}
-
+
/**
* Create an <code>ObjectName</code> for this
* <code>Realm</code> object.
@@ -883,7 +883,7 @@ public class MBeanUtils {
throws MalformedObjectNameException {
ObjectName name = null;
- name = new ObjectName(domain + ":type=Service,serviceName=" +
+ name = new ObjectName(domain + ":type=Service,serviceName=" +
service.getName());
return (name);
@@ -964,7 +964,7 @@ public class MBeanUtils {
throw new MalformedObjectNameException(
"Cannot create mbean for non-contained valve " +
valve);
- }
+ }
if (container instanceof Engine) {
String local="";
int seq = getSeq(local);
@@ -972,7 +972,7 @@ public class MBeanUtils {
if( seq > 0 ) {
ext=",seq=" + seq;
}
- name = new ObjectName(domain + ":type=Valve,name=" + className +
+ name = new ObjectName(domain + ":type=Valve,name=" + className +
ext + local );
} else if (container instanceof Host) {
String local=",host=" +container.getName();
@@ -981,7 +981,7 @@ public class MBeanUtils {
if( seq > 0 ) {
ext=",seq=" + seq;
}
- name = new ObjectName(domain + ":type=Valve,name=" + className +
+ name = new ObjectName(domain + ":type=Valve,name=" + className +
ext + local );
} else if (container instanceof Context) {
Context context = ((Context)container);
@@ -994,7 +994,7 @@ public class MBeanUtils {
if( seq > 0 ) {
ext=",seq=" + seq;
}
- name = new ObjectName(domain + ":type=Valve,name=" + className +
+ name = new ObjectName(domain + ":type=Valve,name=" + className +
ext + local );
}
@@ -1122,7 +1122,7 @@ public class MBeanUtils {
}
-
+
/**
* Deregister the MBean for this
* <code>ContextEnvironment</code> object.
@@ -1147,8 +1147,8 @@ public class MBeanUtils {
mserver.unregisterMBean(oname);
}
-
-
+
+
/**
* Deregister the MBean for this
* <code>ContextResource</code> object.
@@ -1179,8 +1179,8 @@ public class MBeanUtils {
mserver.unregisterMBean(oname);
}
-
-
+
+
/**
* Deregister the MBean for this
* <code>ContextResourceLink</code> object.
@@ -1204,8 +1204,8 @@ public class MBeanUtils {
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
- }
-
+ }
+
/**
* Deregister the MBean for this
* <code>Engine</code> object.
@@ -1323,8 +1323,8 @@ public class MBeanUtils {
mserver.unregisterMBean(oname);
}
-
-
+
+
/**
* Deregister the MBean for this
* <code>NamingResources</code> object.
@@ -1349,8 +1349,8 @@ public class MBeanUtils {
mserver.unregisterMBean(oname);
}
-
-
+
+
/**
* Deregister the MBean for this
* <code>Realm</code> object.
@@ -1425,7 +1425,7 @@ public class MBeanUtils {
ObjectName oname = createObjectName(domain, server);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
-
+
// Global String cache - fixed name
oname = new ObjectName("Catalina:type=StringCache");
if( mserver.isRegistered(oname) )
@@ -1530,7 +1530,7 @@ public class MBeanUtils {
ObjectName query = null;
Set<ObjectName> results = null;
-
+
// Groups
query = new ObjectName(
"Users:type=Group,database=" + userDatabase + ",*");
@@ -1538,7 +1538,7 @@ public class MBeanUtils {
for(ObjectName result : results) {
mserver.unregisterMBean(result);
}
-
+
// Roles
query = new ObjectName(
"Users:type=Role,database=" + userDatabase + ",*");
@@ -1546,7 +1546,7 @@ public class MBeanUtils {
for(ObjectName result : results) {
mserver.unregisterMBean(result);
}
-
+
// Users
query = new ObjectName(
"Users:type=User,database=" + userDatabase + ",*");
@@ -1594,76 +1594,76 @@ public class MBeanUtils {
}
-
+
/**
* Determine the name of the domain to register MBeans for from a given
* Service.
- *
- * @param service
+ *
+ * @param service
*/
public static String getDomain(Service service) {
-
+
// Null service -> return null
if (service == null) {
return null;
}
-
+
String domain = null;
-
+
Container engine = service.getContainer();
-
+
// Use the engine name first
if (engine != null) {
domain = engine.getName();
}
-
- // No engine or no engine name, use the service name
+
+ // No engine or no engine name, use the service name
if (domain == null) {
domain = service.getName();
}
-
+
// No service name, use null
return domain;
}
-
+
/**
* Determine the name of the domain to register MBeans for from a given
* Container.
- *
+ *
* @param container
*/
public static String getDomain(Container container) {
-
+
String domain = null;
-
+
Container c = container;
-
+
while (!(c instanceof Engine) && c != null) {
c = c.getParent();
}
-
+
if (c != null) {
domain = c.getName();
}
-
+
return domain;
}
-
+
/**
* Calculate the key properties string to be added to an object's
* {@link ObjectName} to indicate that it is associated with that container.
- *
- * @param container The container the object is associated with
+ *
+ * @param container The container the object is associated with
* @return A string suitable for appending to the ObjectName
*/
public static String getContainerKeyProperties(Container container) {
-
+
Container c = container;
StringBuilder keyProperties = new StringBuilder();
int containerCount = 0;
-
+
// Work up container hierarchy, add a component to the name for
// each container
while (!(c instanceof Engine)) {
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/MemoryUserDatabaseMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/MemoryUserDatabaseMBean.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/MemoryUserDatabaseMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/MemoryUserDatabaseMBean.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/NamingResourcesMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/NamingResourcesMBean.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/NamingResourcesMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/NamingResourcesMBean.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -64,7 +64,7 @@ public class NamingResourcesMBean extend
// ----------------------------------------------------- Instance Variables
-
+
/**
* The configuration information registry for our managed beans.
*/
@@ -78,14 +78,14 @@ public class NamingResourcesMBean extend
registry.findManagedBean("NamingResources");
// ------------------------------------------------------------- Attributes
-
+
/**
- * Return the MBean Names of the set of defined environment entries for
+ * Return the MBean Names of the set of defined environment entries for
* this web application
*/
public String[] getEnvironments() {
- ContextEnvironment[] envs =
+ ContextEnvironment[] envs =
((NamingResources)this.resource).findEnvironments();
ArrayList<String> results = new ArrayList<String>();
for (int i = 0; i < envs.length; i++) {
@@ -103,15 +103,15 @@ public class NamingResourcesMBean extend
return results.toArray(new String[results.size()]);
}
-
-
+
+
/**
* Return the MBean Names of all the defined resource references for this
* application.
*/
public String[] getResources() {
-
- ContextResource[] resources =
+
+ ContextResource[] resources =
((NamingResources)this.resource).findResources();
ArrayList<String> results = new ArrayList<String>();
for (int i = 0; i < resources.length; i++) {
@@ -129,15 +129,15 @@ public class NamingResourcesMBean extend
return results.toArray(new String[results.size()]);
}
-
-
+
+
/**
- * Return the MBean Names of all the defined resource link references for
+ * Return the MBean Names of all the defined resource link references for
* this application.
*/
public String[] getResourceLinks() {
-
- ContextResourceLink[] resourceLinks =
+
+ ContextResourceLink[] resourceLinks =
((NamingResources)this.resource).findResourceLinks();
ArrayList<String> results = new ArrayList<String>();
for (int i = 0; i < resourceLinks.length; i++) {
@@ -164,9 +164,9 @@ public class NamingResourcesMBean extend
*
* @param envName New environment entry name
* @param type The type of the new environment entry
- * @param value The value of the new environment entry
+ * @param value The value of the new environment entry
*/
- public String addEnvironment(String envName, String type, String value)
+ public String addEnvironment(String envName, String type, String value)
throws MalformedObjectNameException {
NamingResources nresources = (NamingResources) this.resource;
@@ -183,25 +183,25 @@ public class NamingResourcesMBean extend
env.setType(type);
env.setValue(value);
nresources.addEnvironment(env);
-
+
// Return the corresponding MBean name
ManagedBean managed = registry.findManagedBean("ContextEnvironment");
ObjectName oname =
MBeanUtils.createObjectName(managed.getDomain(), env);
return (oname.toString());
-
+
}
-
+
/**
* Add a resource reference for this web application.
*
* @param resourceName New resource reference name
* @param type New resource reference type
*/
- public String addResource(String resourceName, String type)
+ public String addResource(String resourceName, String type)
throws MalformedObjectNameException {
-
+
NamingResources nresources = (NamingResources) this.resource;
if (nresources == null) {
return null;
@@ -215,7 +215,7 @@ public class NamingResourcesMBean extend
resource.setName(resourceName);
resource.setType(type);
nresources.addResource(resource);
-
+
// Return the corresponding MBean name
ManagedBean managed = registry.findManagedBean("ContextResource");
ObjectName oname =
@@ -223,7 +223,7 @@ public class NamingResourcesMBean extend
return (oname.toString());
}
-
+
/**
* Add a resource link reference for this web application.
*
@@ -232,31 +232,31 @@ public class NamingResourcesMBean extend
*/
public String addResourceLink(String resourceLinkName, String type)
throws MalformedObjectNameException {
-
+
NamingResources nresources = (NamingResources) this.resource;
if (nresources == null) {
return null;
}
- ContextResourceLink resourceLink =
+ ContextResourceLink resourceLink =
nresources.findResourceLink(resourceLinkName);
if (resourceLink != null) {
throw new IllegalArgumentException
- ("Invalid resource link name - already exists'" +
+ ("Invalid resource link name - already exists'" +
resourceLinkName + "'");
}
resourceLink = new ContextResourceLink();
resourceLink.setName(resourceLinkName);
resourceLink.setType(type);
nresources.addResourceLink(resourceLink);
-
+
// Return the corresponding MBean name
ManagedBean managed = registry.findManagedBean("ContextResourceLink");
ObjectName oname =
MBeanUtils.createObjectName(managed.getDomain(), resourceLink);
return (oname.toString());
}
-
-
+
+
/**
* Remove any environment entry with the specified name.
*
@@ -276,8 +276,8 @@ public class NamingResourcesMBean extend
nresources.removeEnvironment(envName);
}
-
-
+
+
/**
* Remove any resource reference with the specified name.
*
@@ -296,10 +296,10 @@ public class NamingResourcesMBean extend
("Invalid resource name '" + resourceName + "'");
}
nresources.removeResource(resourceName);
-
+
}
-
-
+
+
/**
* Remove any resource link reference with the specified name.
*
@@ -312,7 +312,7 @@ public class NamingResourcesMBean extend
if (nresources == null) {
return;
}
- ContextResourceLink resourceLink =
+ ContextResourceLink resourceLink =
nresources.findResourceLink(resourceLinkName);
if (resourceLink == null) {
throw new IllegalArgumentException
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/RoleMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/RoleMBean.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/RoleMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/RoleMBean.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/ServiceMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/ServiceMBean.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/ServiceMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/ServiceMBean.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -29,13 +29,13 @@ import org.apache.tomcat.util.modeler.Ba
public class ServiceMBean extends BaseModelMBean {
- public ServiceMBean()
+ public ServiceMBean()
throws MBeanException, RuntimeOperationsException {
-
+
super();
-
+
}
-
+
/**
* Add a new Connector to the set of defined Connectors, and associate it
* with this Service's Container.
@@ -44,12 +44,12 @@ public class ServiceMBean extends BaseMo
* @param port TCP port number to listen on
* @param isAjp Create a AJP/1.3 Connector
* @param isSSL Create a secure Connector
- *
- * @throws MBeanException
+ *
+ * @throws MBeanException
*/
public void addConnector(String address, int port, boolean isAjp, boolean isSSL) throws MBeanException {
-
- Service service;
+
+ Service service;
try {
service = (Service)getManagedResource();
} catch (InstanceNotFoundException e) {
@@ -59,29 +59,29 @@ public class ServiceMBean extends BaseMo
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
Connector connector = new Connector();
if ((address!=null) && (address.length()>0)) {
connector.setProperty("address", address);
}
-
+
connector.setPort(port);
connector.setProtocol(isAjp ? "AJP/1.3" : "HTTP/1.1");
connector.setSecure(isSSL);
connector.setScheme(isSSL ? "https" : "http");
- service.addConnector(connector);
+ service.addConnector(connector);
}
-
+
/**
* Adds a named executor to the service
* @param type Classname of the Executor to be added
- * @throws MBeanException
+ * @throws MBeanException
*/
public void addExecutor(String type) throws MBeanException {
-
- Service service;
+
+ Service service;
try {
service = (Service)getManagedResource();
} catch (InstanceNotFoundException e) {
@@ -91,7 +91,7 @@ public class ServiceMBean extends BaseMo
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
Executor executor;
try {
executor = (Executor)Class.forName(type).newInstance();
@@ -102,18 +102,18 @@ public class ServiceMBean extends BaseMo
} catch (ClassNotFoundException e) {
throw new MBeanException(e);
}
-
+
service.addExecutor(executor);
-
+
}
-
+
/**
* Find and return the set of Connectors associated with this Service.
- * @throws MBeanException
+ * @throws MBeanException
*/
public String[] findConnectors() throws MBeanException {
-
- Service service;
+
+ Service service;
try {
service = (Service)getManagedResource();
} catch (InstanceNotFoundException e) {
@@ -123,25 +123,25 @@ public class ServiceMBean extends BaseMo
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
- Connector[] connectors = service.findConnectors();
+
+ Connector[] connectors = service.findConnectors();
String[] str = new String[connectors.length];
-
+
for(int i=0; i< connectors.length; i++){
str[i] = connectors[i].toString();
}
-
+
return str;
}
-
+
/**
* Retrieves all executors
- * @throws MBeanException
+ * @throws MBeanException
*/
public String[] findExecutors() throws MBeanException {
- Service service;
+ Service service;
try {
service = (Service)getManagedResource();
} catch (InstanceNotFoundException e) {
@@ -151,25 +151,25 @@ public class ServiceMBean extends BaseMo
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
Executor[] executors = service.findExecutors();
String[] str = new String[executors.length];
-
+
for(int i=0; i< executors.length; i++){
str[i] = executors[i].toString();
}
-
+
return str;
}
-
+
/**
* Retrieves executor by name
* @param name Name of the executor to be retrieved
- * @throws MBeanException
+ * @throws MBeanException
*/
public String getExecutor(String name) throws MBeanException{
-
- Service service;
+
+ Service service;
try {
service = (Service)getManagedResource();
} catch (InstanceNotFoundException e) {
@@ -179,10 +179,10 @@ public class ServiceMBean extends BaseMo
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
-
+
Executor executor = service.getExecutor(name);
return executor.toString();
-
+
}
}
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/UserMBean.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/UserMBean.java?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/UserMBean.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/UserMBean.java Sat Oct 22 21:14:02 2011
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: tomcat/trunk/java/org/apache/catalina/mbeans/mbeans-descriptors.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/mbeans-descriptors.xml?rev=1187796&r1=1187795&r2=1187796&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/mbeans-descriptors.xml (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/mbeans-descriptors.xml Sat Oct 22 21:14:02 2011
@@ -137,7 +137,7 @@
description="MBean Name of the associated parent component"
type="java.lang.String"/>
</operation>
-
+
<operation name="createUserDatabaseRealm"
description="Create a new UserDatabaseRealm"
impact="ACTION"
@@ -222,13 +222,13 @@
type="java.lang.String"/>
<parameter name="autoDeploy"
description="The auto deploy flag for this Host"
- type="boolean"/>
+ type="boolean"/>
<parameter name="deployOnStartup"
description="The deploy on startup flag for this Host"
type="boolean"/>
<parameter name="deployXML"
description="deploy Context XML config files property"
- type="boolean"/>
+ type="boolean"/>
<parameter name="unpackWARs"
description="Unpack WARs property"
type="boolean"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org