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 2015/11/20 21:28:46 UTC
svn commit: r1715416 -
/tomcat/trunk/java/org/apache/catalina/core/StandardService.java
Author: markt
Date: Fri Nov 20 20:28:46 2015
New Revision: 1715416
URL: http://svn.apache.org/viewvc?rev=1715416&view=rev
Log:
Clean-up
Modified:
tomcat/trunk/java/org/apache/catalina/core/StandardService.java
Modified: tomcat/trunk/java/org/apache/catalina/core/StandardService.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardService.java?rev=1715416&r1=1715415&r2=1715416&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardService.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardService.java Fri Nov 20 20:28:46 2015
@@ -115,7 +115,7 @@ public class StandardService extends Lif
@Override
public Engine getContainer() {
- return (this.engine);
+ return engine;
}
@@ -146,7 +146,6 @@ public class StandardService extends Lif
// Report this property change to interested listeners
support.firePropertyChange("container", oldEngine, this.engine);
-
}
@@ -155,9 +154,7 @@ public class StandardService extends Lif
*/
@Override
public String getName() {
-
- return (this.name);
-
+ return name;
}
@@ -168,9 +165,7 @@ public class StandardService extends Lif
*/
@Override
public void setName(String name) {
-
this.name = name;
-
}
@@ -179,9 +174,7 @@ public class StandardService extends Lif
*/
@Override
public Server getServer() {
-
- return (this.server);
-
+ return this.server;
}
@@ -192,15 +185,12 @@ public class StandardService extends Lif
*/
@Override
public void setServer(Server server) {
-
this.server = server;
-
}
// --------------------------------------------------------- Public Methods
-
/**
* Add a new Connector to the set of defined Connectors, and associate it
* with this Service's Container.
@@ -233,6 +223,7 @@ public class StandardService extends Lif
}
+
public ObjectName[] getConnectorNames() {
ObjectName results[] = new ObjectName[connectors.length];
for (int i=0; i<results.length; i++) {
@@ -248,9 +239,7 @@ public class StandardService extends Lif
* @param listener The listener to add
*/
public void addPropertyChangeListener(PropertyChangeListener listener) {
-
support.addPropertyChangeListener(listener);
-
}
@@ -259,9 +248,7 @@ public class StandardService extends Lif
*/
@Override
public Connector[] findConnectors() {
-
return connectors;
-
}
@@ -306,7 +293,6 @@ public class StandardService extends Lif
// Report this property change to interested listeners
support.firePropertyChange("connector", connector, null);
}
-
}
@@ -316,9 +302,7 @@ public class StandardService extends Lif
* @param listener The listener to remove
*/
public void removePropertyChangeListener(PropertyChangeListener listener) {
-
support.removePropertyChangeListener(listener);
-
}
@@ -327,12 +311,10 @@ public class StandardService extends Lif
*/
@Override
public String toString() {
-
StringBuilder sb = new StringBuilder("StandardService[");
sb.append(getName());
sb.append("]");
return (sb.toString());
-
}
@@ -345,16 +327,18 @@ public class StandardService extends Lif
synchronized (executors) {
if (!executors.contains(ex)) {
executors.add(ex);
- if (getState().isAvailable())
+ if (getState().isAvailable()) {
try {
ex.start();
} catch (LifecycleException x) {
log.error("Executor.start", x);
}
+ }
}
}
}
+
/**
* Retrieves all executors
* @return Executor[]
@@ -368,6 +352,7 @@ public class StandardService extends Lif
}
}
+
/**
* Retrieves executor by name, null if not found
* @param executorName String
@@ -384,6 +369,7 @@ public class StandardService extends Lif
return null;
}
+
/**
* Removes an executor from the service
* @param ex Executor
@@ -402,7 +388,6 @@ public class StandardService extends Lif
}
-
/**
* Start nested components ({@link Executor}s, {@link Connector}s and
* {@link Container}s) and implement the requirements of
@@ -561,6 +546,7 @@ public class StandardService extends Lif
}
}
+
@Override
protected void destroyInternal() throws LifecycleException {
mapperListener.destroy();
@@ -572,8 +558,7 @@ public class StandardService extends Lif
connector.destroy();
} catch (Exception e) {
log.error(sm.getString(
- "standardService.connector.destroyFailed",
- connector), e);
+ "standardService.connector.destroyFailed", connector), e);
}
}
}
@@ -590,19 +575,21 @@ public class StandardService extends Lif
super.destroyInternal();
}
+
/**
* Return the parent class loader for this component.
*/
@Override
public ClassLoader getParentClassLoader() {
if (parentClassLoader != null)
- return (parentClassLoader);
+ return parentClassLoader;
if (server != null) {
- return (server.getParentClassLoader());
+ return server.getParentClassLoader();
}
- return (ClassLoader.getSystemClassLoader());
+ return ClassLoader.getSystemClassLoader();
}
+
/**
* Set the parent class loader for this server.
*
@@ -616,6 +603,7 @@ public class StandardService extends Lif
this.parentClassLoader);
}
+
@Override
protected String getDomainInternal() {
String domain = null;
@@ -636,6 +624,7 @@ public class StandardService extends Lif
return domain;
}
+
@Override
public final String getObjectNameKeyProperties() {
return "type=Service";
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org