Skip to content

Commit

Permalink
Add isShutdownComplete() query method
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd committed Dec 7, 2010
1 parent 33f1383 commit dee63af
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ public void shutdown() {
throw new UnsupportedOperationException();
}

/** {@inheritDoc} */
public boolean isShutdownComplete() {
throw new UnsupportedOperationException();
}

/** {@inheritDoc} */
public void dumpServices() {
throw new UnsupportedOperationException();
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/org/jboss/msc/service/ServiceContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ public interface ServiceContainer extends ServiceTarget, ServiceRegistry {
*/
void shutdown();

/**
* Determine whether the container is completely shut down.
*
* @return {@code true} if shutdown is complete
*/
boolean isShutdownComplete();

/**
* Add a terminate listener to this container.
* The added {@code listener} will be invoked when this container shutdown process is complete.
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/jboss/msc/service/ServiceContainerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,12 @@ public void shutdown() {
shutdownListener.listenerAddedToAllServices();
}

public boolean isShutdownComplete() {
synchronized (this) {
return terminateInfo != null;
}
}

public void dumpServices() {
dumpServices(System.out);
}
Expand Down

0 comments on commit dee63af

Please sign in to comment.