Skip to content

Commit

Permalink
Merge pull request #54 from ropalka/master-sync-with-12-branch
Browse files Browse the repository at this point in the history
Master sync with 12 branch
  • Loading branch information
ropalka committed Oct 19, 2017
2 parents 8b2b149 + dbeea5f commit 14b4281
Show file tree
Hide file tree
Showing 16 changed files with 641 additions and 630 deletions.
4 changes: 0 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@
<name>test.log.output</name>
<value>${project.build.directory}/surefire-reports</value>
</property>
<property>
<name>jboss.msc.profile.output</name>
<value>${project.build.testOutputDirectory}/prof.txt</value>
</property>
<property>
<name>java.util.logging.manager</name>
<value>org.jboss.logmanager.LogManager</value>
Expand Down
26 changes: 2 additions & 24 deletions src/main/java/org/jboss/msc/service/ServiceContainerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,7 @@ final class ServiceContainerImpl extends ServiceTargetImpl implements ServiceCon

private static final AtomicInteger SERIAL = new AtomicInteger(1);

static final String PROFILE_OUTPUT;

static {
PROFILE_OUTPUT = doPrivileged(new PrivilegedAction<String>() {
public String run() {
return System.getProperty("jboss.msc.profile.output");
}
});
ServiceLogger.ROOT.greeting(Version.getVersionString());
}

Expand Down Expand Up @@ -153,8 +146,6 @@ private ShutdownHookHolder() {
}
}

private final Writer profileOutput;

private TerminateListener.Info terminateInfo = null;

private volatile boolean down = false;
Expand Down Expand Up @@ -377,15 +368,6 @@ private void printServiceStatus(Collection<ServiceStatus> serviceStatuses, Print
this.mBeanServer = mBeanServer;
this.objectName = objectName;
final Set<Reference<ServiceContainerImpl, Void>> set = ShutdownHookHolder.containers;
Writer profileOutput = null;
if (PROFILE_OUTPUT != null) {
try {
profileOutput = new OutputStreamWriter(new FileOutputStream(PROFILE_OUTPUT));
} catch (FileNotFoundException e) {
// ignore
}
}
this.profileOutput = profileOutput;
synchronized (set) {
// if the shutdown hook was triggered, then no services can ever come up in any new containers.
if (ShutdownHookHolder.down) {
Expand Down Expand Up @@ -460,10 +442,6 @@ public String getName() {
return name;
}

Writer getProfileOutput() {
return profileOutput;
}

long getStart() {
return start;
}
Expand Down Expand Up @@ -565,7 +543,7 @@ public void run() {
final HashSet<ServiceControllerImpl<?>> done = new HashSet<ServiceControllerImpl<?>>();
for (ServiceRegistrationImpl registration : registry.values()) {
ServiceControllerImpl<?> serviceInstance = registration.getInstance();
if (serviceInstance != null && serviceInstance.getSubstate() != Substate.CANCELLED && done.add(serviceInstance)) {
if (serviceInstance != null && serviceInstance.getSubstate() != Substate.CANCELLED && serviceInstance.getSubstate() != Substate.REMOVED && done.add(serviceInstance)) {
try {
serviceInstance.addListener(shutdownListener);
} catch (IllegalArgumentException e) {
Expand Down Expand Up @@ -828,7 +806,7 @@ private void detectCircularity(IdentityHashSet<? extends Dependent> dependents,
}
if (visited.add(controller)) {
synchronized (controller) {
if (controller.getSubstateLocked() == Substate.CANCELLED) {
if (controller.getSubstateLocked() == Substate.CANCELLED || controller.getSubstateLocked() == Substate.REMOVED) {
continue;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/jboss/msc/service/ServiceController.java
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,9 @@ enum Transition {
REMOVING_to_REMOVED(Substate.REMOVING, Substate.REMOVED),
/**
* Transition from {@link Substate#REMOVING REMOVING} to {@link Substate#DOWN DOWN}.
* @deprecated was never supposed to work
*/
@Deprecated
REMOVING_to_DOWN(Substate.REMOVING, Substate.DOWN),
/**
* Transition from {@link Substate#DOWN DOWN} to {@link Substate#REMOVING REMOVING}.
Expand Down

0 comments on commit 14b4281

Please sign in to comment.