Skip to content

Commit

Permalink
Revert "Fix services sync"
Browse files Browse the repository at this point in the history
This reverts commit f29b312.
  • Loading branch information
cesarhernandezgt committed Mar 29, 2024
1 parent 4d7b527 commit d04da3d
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions java/org/apache/catalina/core/StandardServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -572,22 +572,18 @@ public Service findService(String name) {
*/
@Override
public Service[] findServices() {
synchronized (servicesLock) {
return services.clone();
}
return services;
}

/**
* @return the JMX service names.
*/
public ObjectName[] getServiceNames() {
synchronized (servicesLock) {
ObjectName[] onames = new ObjectName[services.length];
for (int i = 0; i < services.length; i++) {
onames[i] = ((StandardService) services[i]).getObjectName();
}
return onames;
ObjectName[] onames = new ObjectName[services.length];
for (int i = 0; i < services.length; i++) {
onames[i] = ((StandardService) services[i]).getObjectName();
}
return onames;
}


Expand Down Expand Up @@ -796,10 +792,8 @@ protected void stopInternal() throws LifecycleException {
fireLifecycleEvent(CONFIGURE_STOP_EVENT, null);

// Stop our defined Services
synchronized (servicesLock) {
for (Service service : services) {
service.stop();
}
for (Service service : services) {
service.stop();
}

globalNamingResources.stop();
Expand Down Expand Up @@ -856,20 +850,16 @@ protected void initInternal() throws LifecycleException {
}
}
// Initialize our defined Services
synchronized (servicesLock) {
for (Service service : services) {
service.init();
}
for (Service service : services) {
service.init();
}
}

@Override
protected void destroyInternal() throws LifecycleException {
// Destroy our defined Services
synchronized (servicesLock) {
for (Service service : services) {
service.destroy();
}
for (Service service : services) {
service.destroy();
}

globalNamingResources.destroy();
Expand Down

0 comments on commit d04da3d

Please sign in to comment.